diff --git a/DEPS b/DEPS index 78cf605..2474de15 100644 --- a/DEPS +++ b/DEPS
@@ -56,7 +56,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. - 'buildtools_revision': '31d4daad5d9af672d4e234570a24f3fd844bb713', + 'buildtools_revision': 'b53a03df323e7fa7dafd892adbe70bf9f3cc97f7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -664,7 +664,8 @@ { 'name': 'gn_win', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=win32', '--no_auth', @@ -675,7 +676,8 @@ { 'name': 'gn_mac', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=darwin', '--no_auth', @@ -686,7 +688,8 @@ { 'name': 'gn_linux64', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -698,7 +701,8 @@ { 'name': 'clang_format_win', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=win32', '--no_auth', @@ -709,7 +713,8 @@ { 'name': 'clang_format_mac', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=darwin', '--no_auth', @@ -720,7 +725,8 @@ { 'name': 'clang_format_linux', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -732,7 +738,8 @@ { 'name': 'luci-go_win', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=win32', '--no_auth', @@ -743,7 +750,8 @@ { 'name': 'luci-go_mac', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=darwin', '--no_auth', @@ -754,7 +762,8 @@ { 'name': 'luci-go_linux', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -766,7 +775,8 @@ { 'name': 'eu-strip', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -777,7 +787,8 @@ { 'name': 'drmemory', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=win32', '--no_auth', @@ -800,7 +811,8 @@ { 'name': 'apache_win32', 'pattern': '\\.sha1', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=win32', '--directory', @@ -821,7 +833,8 @@ { "name": "wasm_fuzzer", "pattern": ".", - "action": [ "download_from_google_storage", + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', "--no_resume", "--no_auth", "-u", @@ -832,7 +845,8 @@ { "name": "wasm_asmjs_fuzzer", "pattern": ".", - "action": [ "download_from_google_storage", + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', "--no_resume", "--no_auth", "-u", @@ -853,7 +867,8 @@ { 'name': 'node_linux64', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--extract', @@ -865,7 +880,8 @@ { 'name': 'node_mac', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=darwin', '--extract', @@ -877,7 +893,8 @@ { 'name': 'node_win', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=win32', '--no_auth', @@ -890,7 +907,8 @@ { 'name': 'webui_node_modules', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--extract', '--no_auth', @@ -916,7 +934,8 @@ { 'name': 'checkstyle', 'pattern': '.', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--no_auth', '--bucket', 'chromium-android-tools/checkstyle', @@ -1124,7 +1143,8 @@ { 'name': 'gvr_static_shim_android_arm', 'pattern': '\\.sha1', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -1135,7 +1155,8 @@ { 'name': 'gvr_static_shim_android_arm64', 'pattern': '\\.sha1', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -1146,7 +1167,8 @@ { 'name': 'gvr_common_aar', 'pattern': '\\.sha1', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth', @@ -1157,7 +1179,8 @@ { 'name': 'vr_controller_test_api', 'pattern': '\\.sha1', - 'action': [ 'download_from_google_storage', + 'action': [ 'python', + 'src/third_party/depot_tools/download_from_google_storage.py', '--no_resume', '--platform=linux*', '--no_auth',
diff --git a/android_webview/browser/aw_devtools_manager_delegate.cc b/android_webview/browser/aw_devtools_manager_delegate.cc index b57931c..bc7303f 100644 --- a/android_webview/browser/aw_devtools_manager_delegate.cc +++ b/android_webview/browser/aw_devtools_manager_delegate.cc
@@ -14,7 +14,6 @@ #include "content/public/browser/web_contents.h" using content::DevToolsAgentHost; -using content::RenderFrameHost; namespace android_webview { @@ -25,9 +24,7 @@ } std::string AwDevToolsManagerDelegate::GetTargetDescription( - RenderFrameHost* host) { - content::WebContents* web_contents = - content::WebContents::FromRenderFrameHost(host); + content::WebContents* web_contents) { android_webview::BrowserViewRenderer* bvr = android_webview::BrowserViewRenderer::FromWebContents(web_contents); if (!bvr)
diff --git a/android_webview/browser/aw_devtools_manager_delegate.h b/android_webview/browser/aw_devtools_manager_delegate.h index a5c8fbd..7251d3f 100644 --- a/android_webview/browser/aw_devtools_manager_delegate.h +++ b/android_webview/browser/aw_devtools_manager_delegate.h
@@ -23,7 +23,7 @@ ~AwDevToolsManagerDelegate() override; // content::DevToolsManagerDelegate implementation. - std::string GetTargetDescription(content::RenderFrameHost* host) override; + std::string GetTargetDescription(content::WebContents* web_contents) override; std::string GetDiscoveryPageHTML() override; private:
diff --git a/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt b/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt index e68193f..dcee1c8 100644 --- a/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt +++ b/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt
@@ -955,6 +955,7 @@ method createShadowRoot method getAttribute method getAttributeNS + method getAttributeNames method getAttributeNode method getAttributeNodeNS method getBoundingClientRect
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 11990bc..924f214 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -2960,7 +2960,7 @@ class TestObserver : public ScreenOrientationController::Observer { public: TestObserver() {} - ~TestObserver() override{}; + ~TestObserver() override {} void OnUserRotationLockChanged() override { count_++; }
diff --git a/ash/display/window_tree_host_manager_unittest.cc b/ash/display/window_tree_host_manager_unittest.cc index fc4db30d..46f47fa 100644 --- a/ash/display/window_tree_host_manager_unittest.cc +++ b/ash/display/window_tree_host_manager_unittest.cc
@@ -390,8 +390,8 @@ class WindowTreeHostManagerTest : public test::AshTestBase, public TestHelper { public: - WindowTreeHostManagerTest() : TestHelper(this){}; - ~WindowTreeHostManagerTest() override{}; + WindowTreeHostManagerTest() : TestHelper(this) {} + ~WindowTreeHostManagerTest() override {} private: DISALLOW_COPY_AND_ASSIGN(WindowTreeHostManagerTest);
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc index d17b318..db2beab 100644 --- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
@@ -1608,8 +1608,8 @@ class TestObserver : public wm::WindowStateObserver { public: - TestObserver(){}; - ~TestObserver() override{}; + TestObserver() {} + ~TestObserver() override {} // wm::WindowStateObserver: void OnPreWindowStateTypeChange(wm::WindowState* window_state,
diff --git a/base/allocator/partition_allocator/partition_alloc.cc b/base/allocator/partition_allocator/partition_alloc.cc index 1aa321f..7541eed 100644 --- a/base/allocator/partition_allocator/partition_alloc.cc +++ b/base/allocator/partition_allocator/partition_alloc.cc
@@ -1162,6 +1162,7 @@ *entry_ptr = PartitionFreelistMask(entry); entry_ptr = reinterpret_cast<PartitionFreelistEntry**>(entry); num_new_entries++; + last_slot = slotIndex; } // Terminate the freelist chain. *entry_ptr = nullptr;
diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java index b369e4d..d57cd3c 100644 --- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java +++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
@@ -426,16 +426,19 @@ * @see android.view.Window#setStatusBarColor(int color). */ public static void setStatusBarColor(Window window, int statusBarColor) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - // If both system bars are black, we can remove these from our layout, - // removing or shrinking the SurfaceFlinger overlay required for our views. - if (statusBarColor == Color.BLACK && window.getNavigationBarColor() == Color.BLACK) { - window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - } else { - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - } - window.setStatusBarColor(statusBarColor); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return; + + // If both system bars are black, we can remove these from our layout, + // removing or shrinking the SurfaceFlinger overlay required for our views. + // This benefits battery usage on L and M. However, this no longer provides a battery + // benefit as of N and starts to cause flicker bugs on O, so don't bother on O and up. + if (!BuildInfo.isAtLeastO() && statusBarColor == Color.BLACK + && window.getNavigationBarColor() == Color.BLACK) { + window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + } else { + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); } + window.setStatusBarColor(statusBarColor); } /**
diff --git a/base/memory/shared_memory_tracker.cc b/base/memory/shared_memory_tracker.cc index 7f16a68..10a5745 100644 --- a/base/memory/shared_memory_tracker.cc +++ b/base/memory/shared_memory_tracker.cc
@@ -89,11 +89,10 @@ pmd->CreateSharedGlobalAllocatorDump(dump_guid); global_dump->AddScalar(trace_event::MemoryAllocatorDump::kNameSize, trace_event::MemoryAllocatorDump::kUnitsBytes, size); - // TOOD(hajimehoshi): Detect which the shared memory comes from browser, - // renderer or GPU process. - // TODO(hajimehoshi): Shared memory reported by GPU and discardable is - // currently double-counted. Add ownership edges to avoid this. - pmd->AddOwnershipEdge(local_dump->guid(), global_dump->guid()); + + // The edges will be overriden by the clients with correct importance. + pmd->AddOverridableOwnershipEdge(local_dump->guid(), global_dump->guid(), + 0 /* importance */); } return true; }
diff --git a/base/power_monitor/power_monitor_unittest.cc b/base/power_monitor/power_monitor_unittest.cc index a162763..f1c2459 100644 --- a/base/power_monitor/power_monitor_unittest.cc +++ b/base/power_monitor/power_monitor_unittest.cc
@@ -17,7 +17,7 @@ power_monitor_.reset(new PowerMonitor( std::unique_ptr<PowerMonitorSource>(power_monitor_source_))); } - ~PowerMonitorTest() override{}; + ~PowerMonitorTest() override {} PowerMonitorTestSource* source() { return power_monitor_source_; } PowerMonitor* monitor() { return power_monitor_.get(); }
diff --git a/base/trace_event/memory_allocator_dump_guid.cc b/base/trace_event/memory_allocator_dump_guid.cc index bf4389a..e995d05 100644 --- a/base/trace_event/memory_allocator_dump_guid.cc +++ b/base/trace_event/memory_allocator_dump_guid.cc
@@ -12,14 +12,32 @@ namespace trace_event { namespace { + +bool g_use_shared_memory_guid = false; + uint64_t HashString(const std::string& str) { uint64_t hash[(kSHA1Length + sizeof(uint64_t) - 1) / sizeof(uint64_t)] = {0}; SHA1HashBytes(reinterpret_cast<const unsigned char*>(str.data()), str.size(), reinterpret_cast<unsigned char*>(hash)); return hash[0]; } + } // namespace +// static +bool MemoryAllocatorDumpGuid::UseSharedMemoryBasedGUIDs() { + // TODO(hajimehoshi): This should just become the default behavior once the + // Mojo GUID (crbug.com/604726) is fixed. + if (g_use_shared_memory_guid) + return true; + return false; +} + +// static +void MemoryAllocatorDumpGuid::SetUseSharedMemoryBasedGUIDsForTesting() { + g_use_shared_memory_guid = true; +} + MemoryAllocatorDumpGuid::MemoryAllocatorDumpGuid(uint64_t guid) : guid_(guid) {} MemoryAllocatorDumpGuid::MemoryAllocatorDumpGuid()
diff --git a/base/trace_event/memory_allocator_dump_guid.h b/base/trace_event/memory_allocator_dump_guid.h index 2a420a2..32bbc6b5 100644 --- a/base/trace_event/memory_allocator_dump_guid.h +++ b/base/trace_event/memory_allocator_dump_guid.h
@@ -16,6 +16,11 @@ class BASE_EXPORT MemoryAllocatorDumpGuid { public: + // If the clients of base::SharedMemory should use the global dump guid(s) + // created by SharedMemoryTracker. + static bool UseSharedMemoryBasedGUIDs(); + static void SetUseSharedMemoryBasedGUIDsForTesting(); + MemoryAllocatorDumpGuid(); explicit MemoryAllocatorDumpGuid(uint64_t guid);
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc index cb8d5fa7..4fa9ee1 100644 --- a/base/trace_event/process_memory_dump.cc +++ b/base/trace_event/process_memory_dump.cc
@@ -9,6 +9,7 @@ #include <vector> #include "base/memory/ptr_util.h" +#include "base/memory/shared_memory_tracker.h" #include "base/process/process_metrics.h" #include "base/strings/stringprintf.h" #include "base/trace_event/heap_profiler_heap_dump_writer.h" @@ -16,6 +17,7 @@ #include "base/trace_event/memory_infra_background_whitelist.h" #include "base/trace_event/process_memory_totals.h" #include "base/trace_event/trace_event_argument.h" +#include "base/unguessable_token.h" #include "build/build_config.h" #if defined(OS_IOS) @@ -382,6 +384,69 @@ } } +void ProcessMemoryDump::CreateSharedMemoryOwnershipEdge( + const MemoryAllocatorDumpGuid& client_local_dump_guid, + const MemoryAllocatorDumpGuid& client_global_dump_guid, + const UnguessableToken& shared_memory_guid, + int importance) { + CreateSharedMemoryOwnershipEdgeInternal( + client_local_dump_guid, client_global_dump_guid, shared_memory_guid, + importance, false /*is_weak*/); +} + +void ProcessMemoryDump::CreateWeakSharedMemoryOwnershipEdge( + const MemoryAllocatorDumpGuid& client_local_dump_guid, + const MemoryAllocatorDumpGuid& client_global_dump_guid, + const UnguessableToken& shared_memory_guid, + int importance) { + CreateSharedMemoryOwnershipEdgeInternal( + client_local_dump_guid, client_global_dump_guid, shared_memory_guid, + importance, true /*is_weak*/); +} + +void ProcessMemoryDump::CreateSharedMemoryOwnershipEdgeInternal( + const MemoryAllocatorDumpGuid& client_local_dump_guid, + const MemoryAllocatorDumpGuid& client_global_dump_guid, + const UnguessableToken& shared_memory_guid, + int importance, + bool is_weak) { + if (MemoryAllocatorDumpGuid::UseSharedMemoryBasedGUIDs()) { + DCHECK(!shared_memory_guid.is_empty()); + // New model where the global dumps created by SharedMemoryTracker are used + // for the clients. + + // The guid of the local dump created by SharedMemoryTracker for the memory + // segment. + auto local_shm_guid = + SharedMemoryTracker::GetDumpGUIDForTracing(shared_memory_guid); + + // The dump guid of the global dump created by the tracker for the memory + // segment. + auto global_shm_guid = + SharedMemoryTracker::GetGlobalDumpGUIDForTracing(shared_memory_guid); + + // Create an edge between local dump of the client and the local dump of the + // SharedMemoryTracker. Do not need to create the dumps here since the + // tracker would create them. + AddOwnershipEdge(client_local_dump_guid, local_shm_guid); + + // TODO(ssid): Handle the case of weak dumps here. This needs a new function + // GetOrCreaetGlobalDump() in PMD since we need to change the behavior of + // the created global dump. + // Create an edge that overrides the edge created by SharedMemoryTracker. + AddOwnershipEdge(local_shm_guid, global_shm_guid, importance); + } else { + // This is the old model where the clients create global dumps for + // themselves. + if (is_weak) + CreateWeakSharedGlobalAllocatorDump(client_global_dump_guid); + else + CreateSharedGlobalAllocatorDump(client_global_dump_guid); + AddOwnershipEdge(client_local_dump_guid, client_global_dump_guid, + importance); + } +} + void ProcessMemoryDump::AddSuballocation(const MemoryAllocatorDumpGuid& source, const std::string& target_node_name) { // Do not create new dumps for suballocations in background mode.
diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h index ec82c10..7fdb2dd 100644 --- a/base/trace_event/process_memory_dump.h +++ b/base/trace_event/process_memory_dump.h
@@ -30,6 +30,9 @@ #endif namespace base { + +class UnguessableToken; + namespace trace_event { class HeapProfilerSerializationState; @@ -150,6 +153,32 @@ const MemoryAllocatorDumpGuid& target, int importance); + // Creates ownership edges for memory backed by base::SharedMemory. Handles + // the case of cross process sharing and importnace of ownership for the case + // with and without the base::SharedMemory dump provider. The new version + // should just use global dumps created by SharedMemoryTracker and this + // function handles the transition until we get SharedMemory IDs through mojo + // channel crbug.com/713763. The weak version creates a weak global dump. + // |client_local_dump_guid| The guid of the local dump created by the client + // of base::SharedMemory. + // |client_global_dump_guid| The global guid given by the clients to create + // ownership edges of their own. These global dumps will no longer be required + // after the transition. + // |shared_memory_guid| The ID of the base::SharedMemory that is assigned + // globally, used to create global dump edges in the new model. + // |importance| Importance of the global dump edges to say if the current + // process owns the memory segment. + void CreateSharedMemoryOwnershipEdge( + const MemoryAllocatorDumpGuid& client_local_dump_guid, + const MemoryAllocatorDumpGuid& client_global_dump_guid, + const UnguessableToken& shared_memory_guid, + int importance); + void CreateWeakSharedMemoryOwnershipEdge( + const MemoryAllocatorDumpGuid& client_local_dump_guid, + const MemoryAllocatorDumpGuid& client_global_dump_guid, + const UnguessableToken& shared_memory_guid, + int importance); + const AllocatorDumpEdgesMap& allocator_dumps_edges_for_testing() const { return allocator_dumps_edges_; } @@ -201,6 +230,13 @@ MemoryAllocatorDump* AddAllocatorDumpInternal( std::unique_ptr<MemoryAllocatorDump> mad); + void CreateSharedMemoryOwnershipEdgeInternal( + const MemoryAllocatorDumpGuid& client_local_dump_guid, + const MemoryAllocatorDumpGuid& client_global_dump_guid, + const UnguessableToken& shared_memory_guid, + int importance, + bool is_weak); + MemoryAllocatorDump* GetBlackHoleMad(); ProcessMemoryTotals process_totals_;
diff --git a/base/trace_event/process_memory_dump_unittest.cc b/base/trace_event/process_memory_dump_unittest.cc index 4bddb61..3f3e88a 100644 --- a/base/trace_event/process_memory_dump_unittest.cc +++ b/base/trace_event/process_memory_dump_unittest.cc
@@ -8,10 +8,12 @@ #include "base/memory/aligned_memory.h" #include "base/memory/ptr_util.h" +#include "base/memory/shared_memory_tracker.h" #include "base/process/process_metrics.h" #include "base/trace_event/memory_allocator_dump_guid.h" #include "base/trace_event/memory_infra_background_whitelist.h" #include "base/trace_event/trace_event_argument.h" +#include "base/unguessable_token.h" #include "testing/gtest/include/gtest/gtest.h" namespace base { @@ -300,6 +302,66 @@ ASSERT_EQ(MemoryAllocatorDump::Flags::DEFAULT, shared_mad1->flags()); } +TEST(ProcessMemoryDumpTest, OldSharedMemoryOwnershipTest) { + std::unique_ptr<ProcessMemoryDump> pmd( + new ProcessMemoryDump(nullptr, kDetailedDumpArgs)); + const ProcessMemoryDump::AllocatorDumpEdgesMap& edges = + pmd->allocator_dumps_edges_for_testing(); + + auto* shm_dump1 = pmd->CreateAllocatorDump("shared_mem/seg1"); + + auto* client_dump1 = pmd->CreateAllocatorDump("discardable/segment1"); + MemoryAllocatorDumpGuid client_global_guid1(1); + auto shm_token1 = UnguessableToken::Create(); + MemoryAllocatorDumpGuid shm_global_guid1 = + SharedMemoryTracker::GetGlobalDumpGUIDForTracing(shm_token1); + pmd->AddOverridableOwnershipEdge(shm_dump1->guid(), shm_global_guid1, + 0 /* importance */); + + pmd->CreateSharedMemoryOwnershipEdge(client_dump1->guid(), + client_global_guid1, shm_token1, + 1 /* importance */); + + EXPECT_EQ(2u, edges.size()); + EXPECT_EQ(shm_global_guid1, edges.find(shm_dump1->guid())->second.target); + EXPECT_EQ(0, edges.find(shm_dump1->guid())->second.importance); + EXPECT_TRUE(edges.find(shm_dump1->guid())->second.overridable); + EXPECT_EQ(client_global_guid1, + edges.find(client_dump1->guid())->second.target); + EXPECT_EQ(1, edges.find(client_dump1->guid())->second.importance); + EXPECT_FALSE(edges.find(client_dump1->guid())->second.overridable); +} + +TEST(ProcessMemoryDumpTest, NewSharedMemoryOwnershipTest) { + std::unique_ptr<ProcessMemoryDump> pmd( + new ProcessMemoryDump(nullptr, kDetailedDumpArgs)); + const ProcessMemoryDump::AllocatorDumpEdgesMap& edges = + pmd->allocator_dumps_edges_for_testing(); + MemoryAllocatorDumpGuid::SetUseSharedMemoryBasedGUIDsForTesting(); + + auto* client_dump2 = pmd->CreateAllocatorDump("discardable/segment2"); + MemoryAllocatorDumpGuid client_global_guid2(2); + auto shm_token2 = UnguessableToken::Create(); + MemoryAllocatorDumpGuid shm_local_guid2 = + SharedMemoryTracker::GetDumpGUIDForTracing(shm_token2); + MemoryAllocatorDumpGuid shm_global_guid2 = + SharedMemoryTracker::GetGlobalDumpGUIDForTracing(shm_token2); + pmd->AddOverridableOwnershipEdge(shm_local_guid2, shm_global_guid2, + 0 /* importance */); + + pmd->CreateSharedMemoryOwnershipEdge(client_dump2->guid(), + client_global_guid2, shm_token2, + 1 /* importance */); + EXPECT_EQ(2u, edges.size()); + + EXPECT_EQ(shm_global_guid2, edges.find(shm_local_guid2)->second.target); + EXPECT_EQ(1, edges.find(shm_local_guid2)->second.importance); + EXPECT_FALSE(edges.find(shm_local_guid2)->second.overridable); + EXPECT_EQ(shm_local_guid2, edges.find(client_dump2->guid())->second.target); + EXPECT_EQ(0, edges.find(client_dump2->guid())->second.importance); + EXPECT_FALSE(edges.find(client_dump2->guid())->second.overridable); +} + TEST(ProcessMemoryDumpTest, BackgroundModeTest) { MemoryDumpArgs background_args = {MemoryDumpLevelOfDetail::BACKGROUND}; std::unique_ptr<ProcessMemoryDump> pmd(
diff --git a/build/win/merge_pgc_files.py b/build/win/merge_pgc_files.py index 024bc6b..fd2718e 100755 --- a/build/win/merge_pgc_files.py +++ b/build/win/merge_pgc_files.py
@@ -130,7 +130,7 @@ # happening with VS2017. if ret != 0: print ('Error while trying to merge several PGC files at the same time, ' - 'trying to merge them one by one.' + 'trying to merge them one by one.') for pgc_file in chunk: ret = merge_pgc_files( pgomgr_path,
diff --git a/cc/raster/task_graph_work_queue_unittest.cc b/cc/raster/task_graph_work_queue_unittest.cc index cf135c3..1968f3d 100644 --- a/cc/raster/task_graph_work_queue_unittest.cc +++ b/cc/raster/task_graph_work_queue_unittest.cc
@@ -14,7 +14,7 @@ FakeTaskImpl() {} // Overridden from Task: - void RunOnWorkerThread() override{}; + void RunOnWorkerThread() override {} private: ~FakeTaskImpl() override {}
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index f55d4d6..73520be 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -1090,8 +1090,6 @@ if (input_handler_client_) input_handler_client_->ReconcileElasticOverscrollAndRootScroll(); - active_tree_->UpdateScrollbarGeometries(); - if (const char* client_name = GetClientNameForMetrics()) { size_t total_memory = 0; for (const PictureLayerImpl* layer : active_tree()->picture_layers())
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 69fd2ff3..ed85c60c 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3375,6 +3375,73 @@ EXPECT_TRUE(animation_task_.Equals(base::Closure())); } +TEST_F(LayerTreeHostImplTest, ScrollBeforeMouseMove) { + LayerTreeSettings settings = DefaultSettings(); + settings.scrollbar_animator = LayerTreeSettings::AURA_OVERLAY; + settings.scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(20); + settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(20); + CreateHostImpl(settings, CreateCompositorFrameSink()); + + gfx::Size viewport_size(300, 200); + gfx::Size content_size(1000, 1000); + + CreateScrollAndContentsLayers(host_impl_->active_tree(), content_size); + auto* container = host_impl_->active_tree()->InnerViewportContainerLayer(); + container->SetBounds(viewport_size); + auto* root_scroll = host_impl_->active_tree()->OuterViewportScrollLayer(); + + container->test_properties()->AddChild(SolidColorScrollbarLayerImpl::Create( + host_impl_->active_tree(), 10, VERTICAL, 5, 0, false, true)); + SolidColorScrollbarLayerImpl* vert_scrollbar = + static_cast<SolidColorScrollbarLayerImpl*>( + container->test_properties()->children[1]); + + vert_scrollbar->SetScrollElementId(root_scroll->element_id()); + vert_scrollbar->SetBounds(gfx::Size(10, 200)); + vert_scrollbar->SetPosition(gfx::PointF(300, 0)); + vert_scrollbar->test_properties()->opacity_can_animate = true; + vert_scrollbar->SetCurrentPos(0); + + host_impl_->active_tree()->BuildLayerListAndPropertyTreesForTesting(); + host_impl_->active_tree()->UpdateScrollbarGeometries(); + + EXPECT_EQ(1ul, host_impl_->ScrollbarsFor(root_scroll->element_id()).size()); + auto* scrollbar_controller = + host_impl_->ScrollbarAnimationControllerForElementId( + root_scroll->element_id()); + + const float kDistanceToTriggerThumb = + SingleScrollbarAnimationControllerThinning:: + kMouseMoveDistanceToTriggerExpand; + + // Move the mouse near the thumb in the top position. + auto near_thumb_at_top = gfx::Point(300, -kDistanceToTriggerThumb + 1); + host_impl_->MouseMoveAt(near_thumb_at_top); + EXPECT_TRUE(scrollbar_controller->MouseIsNearScrollbarThumb(VERTICAL)); + + // Move the mouse away from the thumb. + host_impl_->MouseMoveAt(gfx::Point(300, -kDistanceToTriggerThumb - 1)); + EXPECT_FALSE(scrollbar_controller->MouseIsNearScrollbarThumb(VERTICAL)); + + // Scroll the page down which moves the thumb down. + host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), InputHandler::WHEEL); + host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, 100)).get()); + host_impl_->ScrollEnd(EndState().get()); + + // Move the mouse near the thumb in the top position. + host_impl_->MouseMoveAt(near_thumb_at_top); + EXPECT_FALSE(scrollbar_controller->MouseIsNearScrollbarThumb(VERTICAL)); + + // Scroll the page up which moves the thumb back up. + host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), InputHandler::WHEEL); + host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, -100)).get()); + host_impl_->ScrollEnd(EndState().get()); + + // Move the mouse near the thumb in the top position. + host_impl_->MouseMoveAt(near_thumb_at_top); + EXPECT_TRUE(scrollbar_controller->MouseIsNearScrollbarThumb(VERTICAL)); +} + void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale( float device_scale_factor) { LayerTreeSettings settings = DefaultSettings();
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 014c4ab..2a980f8 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -1019,6 +1019,11 @@ if (!needs_update_draw_properties_) return true; + // Ensure the scrollbar geometries are up-to-date for hit testing and quads + // generation. This may cause damage on the scrollbar layers which is why + // it occurs before we reset |needs_update_draw_properties_|. + UpdateScrollbarGeometries(); + // Calling UpdateDrawProperties must clear this flag, so there can be no // early outs before this. needs_update_draw_properties_ = false;
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index d78f1b7..5209cbf 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h
@@ -502,8 +502,11 @@ // Mark the scrollbar geometries (e.g., thumb size and position) as needing an // update. void SetScrollbarGeometriesNeedUpdate() { - if (IsActiveTree()) + if (IsActiveTree()) { scrollbar_geometries_need_update_ = true; + // Scrollbar geometries are updated in |UpdateDrawProperties|. + set_needs_update_draw_properties(); + } } bool ScrollbarGeometriesNeedUpdate() const { return scrollbar_geometries_need_update_;
diff --git a/chrome/VERSION b/chrome/VERSION index 4680c1c..49346bc 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=61 MINOR=0 -BUILD=3125 +BUILD=3126 PATCH=0
diff --git a/chrome/android/java/res/layout/main.xml b/chrome/android/java/res/layout/main.xml index 49ca55d..bd98a97 100644 --- a/chrome/android/java/res/layout/main.xml +++ b/chrome/android/java/res/layout/main.xml
@@ -29,7 +29,20 @@ android:id="@+id/bottom_container" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="start|bottom" /> + android:layout_gravity="start|bottom"> + + <HorizontalScrollView + android:id="@+id/keyboard_accessory" + android:layout_height="@dimen/keyboard_accessory_height" + android:layout_width="match_parent" + android:layout_gravity="start|bottom" + android:background="@drawable/keyboard_accessory_background" + android:contentDescription="@string/autofill_keyboard_accessory_content_description" + android:fillViewport="true" + android:scrollbars="none" + android:visibility="gone" /> + + </org.chromium.chrome.browser.snackbar.BottomContainer> <ViewStub android:id="@+id/bottombar_stub" @@ -92,15 +105,6 @@ </android.support.design.widget.CoordinatorLayout> - <HorizontalScrollView - android:id="@+id/keyboard_accessory" - android:layout_height="@dimen/keyboard_accessory_height" - android:layout_width="match_parent" - android:background="@drawable/keyboard_accessory_background" - android:contentDescription="@string/autofill_keyboard_accessory_content_description" - android:fillViewport="true" - android:scrollbars="none" - android:visibility="gone" /> </LinearLayout> <!-- This empty view is used as the anchor for custom menu -->
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java index 8606501..31e16b6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
@@ -201,6 +201,7 @@ setBackgroundResourceForGroupPosition( getItem().isFirstInGroup(), getItem().isLastInGroup()); + setLongClickable(item.isComplete()); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java index 478ad296..8c547ff 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java
@@ -20,10 +20,9 @@ import org.chromium.chrome.browser.widget.RadioButtonLayout; /** A {@link Fragment} that presents a set of search engines for the user to choose from. */ -public class DefaultSearchEngineFirstRunFragment - extends FirstRunPage implements TemplateUrlService.LoadListener { +public class DefaultSearchEngineFirstRunFragment extends FirstRunPage { @SearchEnginePromoType - private Integer mSearchEnginePromoDialoType; + private int mSearchEnginePromoDialoType; private boolean mShownRecorded; /** Layout that displays the available search engines to the user. */ @@ -42,16 +41,7 @@ mButton = (Button) rootView.findViewById(R.id.button_primary); mButton.setEnabled(false); - TemplateUrlService.getInstance().registerLoadListener(this); - if (!TemplateUrlService.getInstance().isLoaded()) TemplateUrlService.getInstance().load(); - - return rootView; - } - - @Override - public void onTemplateUrlServiceLoaded() { - TemplateUrlService.getInstance().unregisterLoadListener(this); - + assert TemplateUrlService.getInstance().isLoaded(); mSearchEnginePromoDialoType = LocaleManager.getInstance().getSearchEnginePromoShowType(); Runnable dismissRunnable = new Runnable() { @Override @@ -61,7 +51,8 @@ }; new DefaultSearchEngineDialogHelper( mSearchEnginePromoDialoType, mEngineLayout, mButton, dismissRunnable); - if (getUserVisibleHint()) recordShown(); + + return rootView; } @Override @@ -71,8 +62,6 @@ } private void recordShown() { - if (mSearchEnginePromoDialoType == null) return; - if (mShownRecorded) return; if (mSearchEnginePromoDialoType == LocaleManager.SEARCH_ENGINE_PROMO_SHOW_NEW) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java index ae0e1c5..f776cc79 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoUtils; import org.chromium.chrome.browser.preferences.datareduction.DataReductionProxyUma; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.search_engines.TemplateUrlService; import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider; import org.chromium.chrome.browser.util.IntentUtils; @@ -286,6 +287,23 @@ @Override public void finishNativeInitialization() { super.finishNativeInitialization(); + + final TemplateUrlService templateUrlService = TemplateUrlService.getInstance(); + if (templateUrlService.isLoaded()) { + onNativeDependenciesFullyInitialized(); + } else { + templateUrlService.registerLoadListener(new TemplateUrlService.LoadListener() { + @Override + public void onTemplateUrlServiceLoaded() { + templateUrlService.unregisterLoadListener(this); + onNativeDependenciesFullyInitialized(); + } + }); + templateUrlService.load(); + } + } + + private void onNativeDependenciesFullyInitialized() { mNativeSideIsInitialized = true; if (mDeferredCompleteFRE) { completeFirstRunExperience();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditText.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditText.java index 3bf95c8..6ec9d02 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditText.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditText.java
@@ -43,7 +43,7 @@ */ private boolean mDisableTextScrollingFromAutocomplete; - private boolean mInBatchEditMode; + private int mBatchEditNestCount; private int mBeforeBatchEditAutocompleteIndex = -1; private String mBeforeBatchEditFullText; private boolean mSelectionChangedInBatchMode; @@ -98,16 +98,6 @@ } /** - * @return Whether the URL is currently in batch edit mode triggered by an IME. No external - * text changes should be triggered while this is true. - */ - // isInBatchEditMode is a package protected method on TextView, so we intentionally chose - // a different name. - private boolean isHandlingBatchInput() { - return mInBatchEditMode; - } - - /** * @return The user text without the autocomplete text. */ public String getTextWithoutAutocomplete() { @@ -137,27 +127,12 @@ if (mLastEditWasDelete) return false; Editable text = getText(); - return isCursorAtEndOfTypedText() && !isHandlingBatchInput() + return isCursorAtEndOfTypedText() && mBatchEditNestCount == 0 && BaseInputConnection.getComposingSpanEnd(text) == BaseInputConnection.getComposingSpanStart(text); } - @Override - public void onBeginBatchEdit() { - if (DEBUG) Log.i(TAG, "onBeginBatchEdit"); - mBeforeBatchEditAutocompleteIndex = getText().getSpanStart(mAutocompleteSpan); - mBeforeBatchEditFullText = getText().toString(); - - super.onBeginBatchEdit(); - mInBatchEditMode = true; - mTextDeletedInBatchMode = false; - } - - @Override - public void onEndBatchEdit() { - if (DEBUG) Log.i(TAG, "onEndBatchEdit"); - super.onEndBatchEdit(); - mInBatchEditMode = false; + private void onPostEndBatchEdit() { if (mSelectionChangedInBatchMode) { validateSelection(getSelectionStart(), getSelectionEnd()); mSelectionChangedInBatchMode = false; @@ -187,7 +162,7 @@ @Override protected void onSelectionChanged(int selStart, int selEnd) { if (DEBUG) Log.i(TAG, "onSelectionChanged -- selStart: %d, selEnd: %d", selStart, selEnd); - if (!mInBatchEditMode) { + if (mBatchEditNestCount == 0) { int beforeTextLength = getText().length(); if (validateSelection(selStart, selEnd)) { boolean textDeleted = getText().length() < beforeTextLength; @@ -267,8 +242,8 @@ } /** - * Autocompletes the text on the url bar and selects the text that was not entered by the - * user. Using append() instead of setText() to preserve the soft-keyboard layout. + * Autocompletes the text and selects the text that was not entered by the user. Using append() + * instead of setText() to preserve the soft-keyboard layout. * @param userText user The text entered by the user. * @param inlineAutocompleteText The suggested autocompletion for the user's text. */ @@ -338,7 +313,7 @@ super.onTextChanged(text, start, lengthBefore, lengthAfter); boolean textDeleted = lengthAfter == 0; - if (!mInBatchEditMode) { + if (mBatchEditNestCount == 0) { notifyAutocompleteTextStateChanged(textDeleted, true); } else { mTextDeletedInBatchMode = textDeleted; @@ -351,11 +326,10 @@ mDisableTextScrollingFromAutocomplete = false; - // Avoid setting the same text to the URL bar as it will mess up the scroll/cursor - // position. + // Avoid setting the same text as it will mess up the scroll/cursor position. // Setting the text is also quite expensive, so only do it when the text has changed - // (since we apply spans when the URL is not focused, we only optimize this when the - // URL is being edited). + // (since we apply spans when the view is not focused, we only optimize this when the + // text is being edited). if (!TextUtils.equals(getEditableText(), text)) { // Certain OEM implementations of setText trigger disk reads. crbug.com/633298 StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); @@ -430,6 +404,33 @@ private final char[] mTempSelectionChar = new char[1]; @Override + public boolean beginBatchEdit() { + ++mBatchEditNestCount; + if (mBatchEditNestCount == 1) { + if (DEBUG) Log.i(TAG, "beginBatchEdit"); + mBeforeBatchEditAutocompleteIndex = getText().getSpanStart(mAutocompleteSpan); + mBeforeBatchEditFullText = getText().toString(); + + boolean retVal = super.beginBatchEdit(); + mTextDeletedInBatchMode = false; + return retVal; + } + return super.beginBatchEdit(); + } + + @Override + public boolean endBatchEdit() { + mBatchEditNestCount = Math.max(mBatchEditNestCount - 1, 0); + if (mBatchEditNestCount == 0) { + if (DEBUG) Log.i(TAG, "endBatchEdit"); + boolean retVal = super.endBatchEdit(); + onPostEndBatchEdit(); + return retVal; + } + return super.endBatchEdit(); + } + + @Override public boolean commitText(CharSequence text, int newCursorPosition) { if (DEBUG) Log.i(TAG, "commitText: [%s]", text); Editable currentText = getText(); @@ -465,7 +466,7 @@ setAutocompleteText(currentText.subSequence(0, selectionStart + 1), currentText.subSequence(selectionStart + 1, selectionEnd)); - if (!mInBatchEditMode) { + if (mBatchEditNestCount == 0) { notifyAutocompleteTextStateChanged(false, false); } return true;
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 2f0eb06..93dfb74 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
@@ -1097,12 +1097,18 @@ } private static boolean isVrCoreCompatible( - VrCoreVersionChecker versionChecker, Tab tabToShowInfobarIn) { - int vrCoreCompatibility = versionChecker.getVrCoreInfo().compatibility; + final VrCoreVersionChecker versionChecker, final Tab tabToShowInfobarIn) { + final int vrCoreCompatibility = versionChecker.getVrCoreInfo().compatibility; if (vrCoreCompatibility == VrCoreCompatibility.VR_NOT_AVAILABLE || vrCoreCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE) { - promptToUpdateVrServices(vrCoreCompatibility, tabToShowInfobarIn); + // This is somewhat slow, so do it async. + new Handler().post(new Runnable() { + @Override + public void run() { + promptToUpdateVrServices(vrCoreCompatibility, tabToShowInfobarIn); + } + }); } return vrCoreCompatibility == VrCoreCompatibility.VR_READY; @@ -1245,6 +1251,7 @@ @VisibleForTesting public void overrideVrCoreVersionCheckerForTesting(VrCoreVersionChecker versionChecker) { mVrCoreVersionChecker = versionChecker; + updateVrSupportLevel(); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java index ecba3522..c8b2e8d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
@@ -84,9 +84,10 @@ // The default shell Apk version of WebAPKs. static final int DEFAULT_SHELL_APK_VERSION = 1; - // Invalid constants for timestamps and URLs. '0' is used as the invalid timestamp as - // WebappRegistry and WebApkUpdateManager assume that timestamps are always valid. - static final long TIMESTAMP_INVALID = 0; + // Unset/invalid constants for last used times and URLs. 0 is used as the null last used time as + // WebappRegistry assumes that this is always a valid timestamp. + static final long LAST_USED_UNSET = 0; + static final long LAST_USED_INVALID = -1; static final String URL_INVALID = ""; static final int VERSION_INVALID = 0; @@ -138,8 +139,14 @@ * Opens an instance of WebappDataStorage for the web app specified. * @param webappId The ID of the web app. */ - static WebappDataStorage open(String webappId) { - return sFactory.create(webappId); + static WebappDataStorage open(final String webappId) { + final WebappDataStorage storage = sFactory.create(webappId); + if (storage.getLastUsedTime() == LAST_USED_INVALID) { + // If the last used time is invalid then ensure that there is no data in the + // WebappDataStorage which needs to be cleaned up. + assert storage.isEmpty(); + } + return storage; } /** @@ -314,7 +321,10 @@ void clearHistory() { SharedPreferences.Editor editor = mPreferences.edit(); - editor.remove(KEY_LAST_USED); + // The last used time is set to 0 to ensure that a valid value is always present. + // If the web app is not launched prior to the next cleanup, then its remaining data will be + // removed. Otherwise, the next launch from home screen will update the last used time. + editor.putLong(KEY_LAST_USED, LAST_USED_UNSET); editor.remove(KEY_URL); editor.remove(KEY_SCOPE); editor.remove(KEY_LAST_CHECK_WEB_MANIFEST_UPDATE_TIME); @@ -354,7 +364,7 @@ * Returns the last used time of this object, or -1 if it is not stored. */ public long getLastUsedTime() { - return mPreferences.getLong(KEY_LAST_USED, TIMESTAMP_INVALID); + return mPreferences.getLong(KEY_LAST_USED, LAST_USED_INVALID); } /** @@ -396,7 +406,7 @@ * updated. This time needs to be set when the WebAPK is registered. */ private long getLastCheckForWebManifestUpdateTime() { - return mPreferences.getLong(KEY_LAST_CHECK_WEB_MANIFEST_UPDATE_TIME, TIMESTAMP_INVALID); + return mPreferences.getLong(KEY_LAST_CHECK_WEB_MANIFEST_UPDATE_TIME, LAST_USED_INVALID); } /** @@ -413,7 +423,7 @@ * This time needs to be set when the WebAPK is registered. */ long getLastWebApkUpdateRequestCompletionTime() { - return mPreferences.getLong(KEY_LAST_UPDATE_REQUEST_COMPLETE_TIME, TIMESTAMP_INVALID); + return mPreferences.getLong(KEY_LAST_UPDATE_REQUEST_COMPLETE_TIME, LAST_USED_INVALID); } /** @@ -475,7 +485,7 @@ */ boolean didPreviousUpdateSucceed() { long lastUpdateCompletionTime = getLastWebApkUpdateRequestCompletionTime(); - if (lastUpdateCompletionTime == TIMESTAMP_INVALID) { + if (lastUpdateCompletionTime == WebappDataStorage.LAST_USED_INVALID) { return true; } return getDidLastWebApkUpdateRequestSucceed();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java index 2880e3f9..1997ce9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java
@@ -117,10 +117,8 @@ @Override protected final void onPostExecute(WebappDataStorage storage) { - // Update the last used time in order to prevent - // {@link WebappRegistry@unregisterOldWebapps()} from deleting the - // WebappDataStorage. Must be run on the main thread as - // SharedPreferences.Editor.apply() is called. + // Guarantee that last used time != WebappDataStorage.LAST_USED_INVALID. Must be + // run on the main thread as SharedPreferences.Editor.apply() is called. mStorages.put(webappId, storage); mPreferences.edit().putStringSet(KEY_WEBAPP_SET, mStorages.keySet()).apply(); storage.updateLastUsedTime();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java index 68eb1c3a..f5a0a2c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java
@@ -396,10 +396,10 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); urlBar.setText(textToBeEntered); urlBar.setSelection(textToBeEntered.length()); - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); autocompleteHelper.waitForCallback(0); @@ -477,7 +477,7 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); } }); // Ensure the autocomplete is not modified if in batch mode. @@ -488,7 +488,7 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); @@ -527,7 +527,7 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); } }); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @@ -539,7 +539,7 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); @@ -570,10 +570,10 @@ // TODO(crbug.com/635567): Fix this properly. @SuppressLint("SetTextI18n") public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); urlBar.setText("go"); urlBar.setSelection(2); - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); Assert.assertTrue(state.hasAutocomplete); @@ -587,10 +587,10 @@ // TODO(crbug.com/635567): Fix this properly. @SuppressLint("SetTextI18n") public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); urlBar.setText("go"); urlBar.setSelection(0); - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); Assert.assertFalse(state.hasAutocomplete); @@ -602,10 +602,10 @@ // TODO(crbug.com/635567): Fix this properly. @SuppressLint("SetTextI18n") public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); urlBar.setText("ga"); urlBar.setSelection(2); - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); Assert.assertFalse(state.hasAutocomplete); @@ -617,10 +617,10 @@ // TODO(crbug.com/635567): Fix this properly. @SuppressLint("SetTextI18n") public void run() { - urlBar.beginBatchEdit(); + urlBar.getInputConnection().beginBatchEdit(); urlBar.setText("googl"); urlBar.setSelection(5); - urlBar.endBatchEdit(); + urlBar.getInputConnection().endBatchEdit(); } }); Assert.assertFalse(state.hasAutocomplete);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrFeedbackInfoBarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrFeedbackInfoBarTest.java index b74bd8d..e09ab77 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrFeedbackInfoBarTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrFeedbackInfoBarTest.java
@@ -82,8 +82,8 @@ private void assertState(boolean isInVr, boolean isInfobarVisible) { Assert.assertEquals("Browser is in VR", isInVr, VrShellDelegate.isInVr()); - Assert.assertEquals("Infobar is visible", isInfobarVisible, - VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView())); + VrUtils.expectInfoBarPresent( + mVrTestRule.getActivity().getWindow().getDecorView(), isInfobarVisible); } private void enterThenExitVr() { @@ -100,7 +100,6 @@ @MediumTest public void testFeedbackFrequency() throws InterruptedException, TimeoutException { mVrTestRule.loadUrlAndAwaitInitialization(TEST_PAGE_2D_URL, PAGE_LOAD_TIMEOUT_S); - // Set frequency of infobar to every 2nd time. VrUtils.getVrShellDelegateInstance().setFeedbackFrequencyForTesting(2);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java index b93220a..2d2b76c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java
@@ -112,8 +112,7 @@ Assert.assertEquals("Browser is in fullscreen", fullscreenMode == FullscreenMode.FULLSCREENED, DOMUtils.isFullscreen(wc)); // Feedback infobar should never show up during navigations. - Assert.assertFalse( - VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView())); + VrUtils.expectInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView(), false); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java index c95d242..6cb8ad0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
@@ -13,6 +13,7 @@ import android.support.test.filters.LargeTest; import android.support.test.filters.MediumTest; import android.support.test.filters.SmallTest; +import android.view.View; import android.widget.TextView; import org.junit.Assert; @@ -21,6 +22,7 @@ import org.junit.Test; import org.junit.runner.RunWith; +import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.MinAndroidSdkLevel; @@ -183,19 +185,21 @@ * * @param checkerReturnCompatibility The compatibility to have the VrCoreVersionChecker return */ - private void infoBarTestHelper(int checkerReturnCompatibility) throws InterruptedException { - MockVrCoreVersionCheckerImpl mockChecker = new MockVrCoreVersionCheckerImpl(); - mockChecker.setMockReturnValue(new VrCoreInfo(null, checkerReturnCompatibility)); - VrUtils.getVrShellDelegateInstance().overrideVrCoreVersionCheckerForTesting(mockChecker); - mVrTestRule.loadUrlAndAwaitInitialization( - VrTestRule.getHtmlTestFile("generic_webvr_page"), PAGE_LOAD_TIMEOUT_S); - String displayFound = "VRDisplay Found"; - String barPresent = "InfoBar present"; + private void infoBarTestHelper(final int checkerReturnCompatibility) { + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + MockVrCoreVersionCheckerImpl mockChecker = new MockVrCoreVersionCheckerImpl(); + mockChecker.setMockReturnValue(new VrCoreInfo(null, checkerReturnCompatibility)); + VrShellDelegate.getInstanceForTesting().overrideVrCoreVersionCheckerForTesting( + mockChecker); + Assert.assertEquals( + checkerReturnCompatibility, mockChecker.getLastReturnValue().compatibility); + } + }); + View decorView = mVrTestRule.getActivity().getWindow().getDecorView(); if (checkerReturnCompatibility == VrCoreCompatibility.VR_READY) { - Assert.assertTrue( - displayFound, mVrTestRule.vrDisplayFound(mVrTestRule.getFirstTabWebContents())); - Assert.assertFalse(barPresent, - VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView())); + VrUtils.expectInfoBarPresent(decorView, false); } else if (checkerReturnCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE || checkerReturnCompatibility == VrCoreCompatibility.VR_NOT_AVAILABLE) { // Out of date and missing cases are the same, but with different text @@ -211,10 +215,7 @@ expectedButton = mVrTestRule.getActivity().getString( R.string.vr_services_check_infobar_install_button); } - Assert.assertFalse( - displayFound, mVrTestRule.vrDisplayFound(mVrTestRule.getFirstTabWebContents())); - Assert.assertTrue(barPresent, - VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView())); + VrUtils.expectInfoBarPresent(decorView, true); TextView tempView = (TextView) mVrTestRule.getActivity().getWindow().getDecorView().findViewById( R.id.infobar_message); @@ -223,16 +224,11 @@ R.id.button_primary); Assert.assertEquals(expectedButton, tempView.getText().toString()); } else if (checkerReturnCompatibility == VrCoreCompatibility.VR_NOT_SUPPORTED) { - Assert.assertFalse( - displayFound, mVrTestRule.vrDisplayFound(mVrTestRule.getFirstTabWebContents())); - Assert.assertFalse(barPresent, - VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView())); + VrUtils.expectInfoBarPresent(decorView, false); } else { Assert.fail("Invalid VrCoreVersionChecker compatibility: " + String.valueOf(checkerReturnCompatibility)); } - Assert.assertEquals( - checkerReturnCompatibility, mockChecker.getLastReturnValue().compatibility); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/VrUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/VrUtils.java index ce125cda6..5aa5159 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/VrUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/VrUtils.java
@@ -30,9 +30,8 @@ public static final int POLL_TIMEOUT_LONG_MS = 10000; /** - * Gets the VrShellDelegate instance on the UI thread, as otherwise the - * Choreographer obtained in VrShellDelegate's constructor is for the instrumentation - * thread instead of the UI thread. + * Gets the VrShellDelegate instance on the UI thread, as otherwise the Choreographer obtained + * in VrShellDelegate's constructor is for the instrumentation thread instead of the UI thread. * @return The browser's current VrShellDelegate instance */ public static VrShellDelegate getVrShellDelegateInstance() { @@ -104,9 +103,23 @@ /** * Determines is there is any InfoBar present in the given View hierarchy. * @param parentView The View to start the search in + * @param present Whether an InfoBar should be present. + */ + public static void expectInfoBarPresent(final View parentView, boolean present) { + CriteriaHelper.pollUiThread(Criteria.equals(present, new Callable<Boolean>() { + @Override + public Boolean call() { + return isInfoBarPresentInternal(parentView); + } + }), POLL_TIMEOUT_SHORT_MS, POLL_CHECK_INTERVAL_SHORT_MS); + } + + /** + * Determines is there is any InfoBar present in the given View hierarchy. + * @param parentView The View to start the search in * @return Whether the InfoBar is present */ - public static boolean isInfoBarPresent(View parentView) { + private static boolean isInfoBarPresentInternal(View parentView) { // TODO(ymalik): This will return true if any infobar is present. Is it // possible to determine the type of infobar present (e.g. Feedback)? // InfoBarContainer will be present regardless of whether an InfoBar @@ -117,7 +130,7 @@ } else if (parentView instanceof ViewGroup) { ViewGroup group = (ViewGroup) parentView; for (int i = 0; i < group.getChildCount(); i++) { - if (isInfoBarPresent(group.getChildAt(i))) return true; + if (isInfoBarPresentInternal(group.getChildAt(i))) return true; } } return false;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenManagerTest.java index d7a9d74..c4fe645 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenManagerTest.java
@@ -306,8 +306,9 @@ addShortcutToTab(mTab, ""); // Wait for the tab title to change. This will happen (due to the JavaScript that runs - // in the page) once the appinstalled event has been fired. - new TabTitleObserver(mTab, "Got appinstalled").waitForTitleUpdate(3); + // in the page) once the appinstalled event has been fired twice: once to test + // addEventListener('appinstalled'), once to test onappinstalled attribute. + new TabTitleObserver(mTab, "Got appinstalled: listener, attr").waitForTitleUpdate(3); } finally { mTestServer.stopAndDestroyServer(); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java index 693f4ebb..6b36fd8 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
@@ -71,7 +71,7 @@ /** {@link WebappDataStorage#Clock} subclass which enables time to be manually advanced. */ private static class MockClock extends WebappDataStorage.Clock { - // 0 has a special meaning: {@link WebappDataStorage#TIMESTAMP_INVALID}. + // 0 has a special meaning: {@link WebappDataStorage#LAST_USED_UNSET}. private long mTimeMillis = 1; public void advance(long millis) {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java index 89b2c24..757e15c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
@@ -18,6 +18,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; + import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLooper; @@ -193,10 +194,11 @@ storage.updateLastUsedTime(); assertTrue(storage.wasLaunchedRecently()); - long lastUsedTime = mSharedPreferences.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); + long lastUsedTime = mSharedPreferences.getLong(WebappDataStorage.KEY_LAST_USED, + WebappDataStorage.LAST_USED_INVALID); - assertTrue(lastUsedTime != WebappDataStorage.TIMESTAMP_INVALID); + assertTrue(lastUsedTime != WebappDataStorage.LAST_USED_UNSET); + assertTrue(lastUsedTime != WebappDataStorage.LAST_USED_INVALID); // Move the last used time one day in the past. mSharedPreferences.edit()
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java index f52d40af..1dc4165 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
@@ -17,6 +17,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; + import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLooper; @@ -126,8 +127,8 @@ long after = System.currentTimeMillis(); SharedPreferences webAppPrefs = ContextUtils.getApplicationContext().getSharedPreferences( WebappDataStorage.SHARED_PREFS_FILE_PREFIX + "test", Context.MODE_PRIVATE); - long actual = webAppPrefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); + long actual = webAppPrefs.getLong(WebappDataStorage.KEY_LAST_USED, + WebappDataStorage.LAST_USED_INVALID); assertTrue("Timestamp is out of range", actual <= after); } @@ -246,8 +247,8 @@ Set<String> actual = getRegisteredWebapps(); assertEquals(new HashSet<>(Arrays.asList("oldWebapp")), actual); - long actualLastUsed = webAppPrefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); + long actualLastUsed = webAppPrefs.getLong(WebappDataStorage.KEY_LAST_USED, + WebappDataStorage.LAST_USED_INVALID); assertEquals(Long.MIN_VALUE, actualLastUsed); // The last cleanup time was set to 0 in setUp() so check that this hasn't changed. @@ -279,8 +280,8 @@ Set<String> actual = getRegisteredWebapps(); assertEquals(new HashSet<>(Arrays.asList("recentWebapp")), actual); - long actualLastUsed = webAppPrefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); + long actualLastUsed = webAppPrefs.getLong(WebappDataStorage.KEY_LAST_USED, + WebappDataStorage.LAST_USED_INVALID); assertEquals(lastUsed, actualLastUsed); long lastCleanup = mSharedPreferences.getLong(WebappRegistry.KEY_LAST_CLEANUP, -1); @@ -310,9 +311,9 @@ Set<String> actual = getRegisteredWebapps(); assertTrue(actual.isEmpty()); - long actualLastUsed = webAppPrefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); - assertEquals(WebappDataStorage.TIMESTAMP_INVALID, actualLastUsed); + long actualLastUsed = webAppPrefs.getLong(WebappDataStorage.KEY_LAST_USED, + WebappDataStorage.LAST_USED_INVALID); + assertEquals(WebappDataStorage.LAST_USED_INVALID, actualLastUsed); long lastCleanup = mSharedPreferences.getLong(WebappRegistry.KEY_LAST_CLEANUP, -1); assertEquals(currentTime, lastCleanup); @@ -420,11 +421,11 @@ WebappDataStorage.SHARED_PREFS_FILE_PREFIX + "webapp2", Context.MODE_PRIVATE); long webapp1OriginalLastUsed = webapp2Prefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_UNSET); long webapp2OriginalLastUsed = webapp2Prefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); - assertTrue(webapp1OriginalLastUsed != WebappDataStorage.TIMESTAMP_INVALID); - assertTrue(webapp2OriginalLastUsed != WebappDataStorage.TIMESTAMP_INVALID); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_UNSET); + assertTrue(webapp1OriginalLastUsed != WebappDataStorage.LAST_USED_UNSET); + assertTrue(webapp2OriginalLastUsed != WebappDataStorage.LAST_USED_UNSET); // Clear data for |webapp1Url|. WebappRegistry.getInstance().clearWebappHistoryForUrlsImpl( @@ -436,12 +437,12 @@ assertTrue(actual.contains("webapp2")); // Verify that the last used time for the first web app is - // WebappDataStorage.TIMESTAMP_INVALID, while for the second one it's unchanged. + // WebappDataStorage.LAST_USED_UNSET, while for the second one it's unchanged. long actualLastUsed = webapp1Prefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); - assertEquals(WebappDataStorage.TIMESTAMP_INVALID, actualLastUsed); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_UNSET); + assertEquals(WebappDataStorage.LAST_USED_UNSET, actualLastUsed); actualLastUsed = webapp2Prefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_UNSET); assertEquals(webapp2OriginalLastUsed, actualLastUsed); // Verify that the URL and scope for the first web app is WebappDataStorage.URL_INVALID, @@ -462,13 +463,13 @@ // Clear data for all urls. WebappRegistry.getInstance().clearWebappHistoryForUrlsImpl(new UrlFilters.AllUrls()); - // Verify that the last used time for both web apps is WebappDataStorage.TIMESTAMP_INVALID. + // Verify that the last used time for both web apps is WebappDataStorage.LAST_USED_UNSET. actualLastUsed = webapp1Prefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); - assertEquals(WebappDataStorage.TIMESTAMP_INVALID, actualLastUsed); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_UNSET); + assertEquals(WebappDataStorage.LAST_USED_UNSET, actualLastUsed); actualLastUsed = webapp2Prefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); - assertEquals(WebappDataStorage.TIMESTAMP_INVALID, actualLastUsed); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_UNSET); + assertEquals(WebappDataStorage.LAST_USED_UNSET, actualLastUsed); // Verify that the URL and scope for both web apps is WebappDataStorage.URL_INVALID. actualScope = webapp1Prefs.getString( @@ -499,8 +500,9 @@ // Verify that the last used time is valid. long actualLastUsed = webappPrefs.getLong( - WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID); - assertTrue(WebappDataStorage.TIMESTAMP_INVALID != actualLastUsed); + WebappDataStorage.KEY_LAST_USED, WebappDataStorage.LAST_USED_INVALID); + assertTrue(WebappDataStorage.LAST_USED_INVALID != actualLastUsed); + assertTrue(WebappDataStorage.LAST_USED_UNSET != actualLastUsed); } @Test
diff --git a/chrome/app/bookmarks_strings.grdp b/chrome/app/bookmarks_strings.grdp index 528b254..cd5a8a1 100644 --- a/chrome/app/bookmarks_strings.grdp +++ b/chrome/app/bookmarks_strings.grdp
@@ -422,11 +422,9 @@ <message name="IDS_MD_BOOKMARK_MANAGER_TOAST_FOLDER_SORTED" desc="Label displayed in toast popup message when a folder's children are sorted."> Folder sorted </message> - <message name="IDS_MD_BOOKMARK_MANAGER_TOAST_ITEM_DELETED" desc="Label displayed in toast popup message when an item is deleted."> - '<ph name="DELETED_ITEM_NAME">$1</ph>' has been deleted - </message> <message name="IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_DELETED" desc="Label displayed in toast popup message when several items are deleted."> {COUNT, plural, + =1 {'<ph name="DELETED_ITEM_NAME">$1</ph>' has been deleted} other {# bookmarks deleted}} </message> <message name="IDS_MD_BOOKMARK_MANAGER_TOAST_URL_COPIED" desc="Label displayed in toast popup message when a URL is copied.">
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 6af0496a..fbe2be20 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -1991,9 +1991,16 @@ <message name="IDS_APPLICATION_INFO_VERSION_LABEL" desc="In Title Case: Text displayed before the app or extension's version in the details section of the dialog."> Version: </message> - <message name="IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT" desc="In Title Case: Text for the button that opens the dialog to create shortcuts for the app."> + <if expr="is_macosx"> + <message name="IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT" desc="In Title Case: Text for the button that creates a shortcut for the app."> + Create Shortcut + </message> + </if> + <if expr="not is_macosx"> + <message name="IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT" desc="In Title Case: Text for the button that opens the dialog to create shortcuts for the app."> Create Shortcuts... - </message> + </message> + </if> </if> <message name="IDS_APPLICATION_INFO_SIZE_LOADING_LABEL" desc="Text displayed instead of the app or extension's size on disk in the details section of the dialog while the size is being calculated."> Calculating... @@ -2024,28 +2031,28 @@ </message> <!-- "Create application shortcuts" dialog --> - <if expr="not use_titlecase"> - <message name="IDS_CREATE_SHORTCUTS_TITLE" desc="Title of the dialog to create application shortcuts for current page."> - Create application shortcuts + <if expr="not is_macosx"> + <if expr="not use_titlecase"> + <message name="IDS_CREATE_SHORTCUTS_TITLE" desc="Title of the dialog to create application shortcuts for current page."> + Create application shortcuts + </message> + </if> + <if expr="use_titlecase"> + <message name="IDS_CREATE_SHORTCUTS_TITLE" desc="In Title Case: title of the dialog to create application shortcuts for current page."> + Create Application Shortcuts + </message> + </if> + <message name="IDS_CREATE_SHORTCUTS_LABEL" desc="Contents of the main label in the create application shortcuts dialog explaining the dialog."> + Add shortcuts to the following places: </message> - </if> - <if expr="use_titlecase"> - <message name="IDS_CREATE_SHORTCUTS_TITLE" desc="In Title Case: title of the dialog to create application shortcuts for current page."> - Create Application Shortcuts + <message name="IDS_CREATE_SHORTCUTS_DESKTOP_CHKBOX" desc="Label of the checkbox to create an application shortcut on the desktop."> + Desktop </message> - </if> - <message name="IDS_CREATE_SHORTCUTS_LABEL" desc="Contents of the main label in the create application shortcuts dialog explaining the dialog."> - Add shortcuts to the following places: - </message> - <message name="IDS_CREATE_SHORTCUTS_DESKTOP_CHKBOX" desc="Label of the checkbox to create an application shortcut on the desktop."> - Desktop - </message> - <message name="IDS_CREATE_SHORTCUTS_MENU_CHKBOX" desc="Label of the checkbox to create an application shortcut in the system's applications menu."> - Applications menu - </message> - <if expr="is_macosx"> - <message name="IDS_CREATE_SHORTCUTS_APP_FOLDER_CHKBOX" desc="Label of the checkbox to create an application shortcut in the system's applications folder."> - Applications folder + <message name="IDS_CREATE_SHORTCUTS_MENU_CHKBOX" desc="Label of the checkbox to create an application shortcut in the system's applications menu."> + Applications menu + </message> + <message name="IDS_CREATE_SHORTCUTS_COMMIT" desc="Title of the button to actually create the shortcuts."> + Create </message> </if> <if expr="is_win"> @@ -2059,9 +2066,6 @@ Pin to Taskbar </message> </if> - <message name="IDS_CREATE_SHORTCUTS_COMMIT" desc="Title of the button to actually create the shortcuts."> - Create - </message> <!-- Web Share Target picker dialog --> <if expr="not use_titlecase"> @@ -8406,18 +8410,10 @@ desc="Text for the context menu item that takes the user to the app in Web Store. (In sentence case.)"> View in Web Store </message> - <if expr="is_macosx"> - <message name="IDS_NEW_TAB_APP_CREATE_SHORTCUT" - desc="Text for the context menu item that creates an app shortcut. (In sentence case.)"> - Create shortcut... - </message> - </if> - <if expr="not is_macosx"> - <message name="IDS_NEW_TAB_APP_CREATE_SHORTCUT" - desc="Text for the context menu item that creates an app shortcut. (In sentence case.)"> - Create shortcuts... - </message> - </if> + <message name="IDS_NEW_TAB_APP_CREATE_SHORTCUT" + desc="Text for the context menu item that creates an app shortcut. (In sentence case.)"> + Create shortcuts... + </message> <message name="IDS_APP_CONTEXT_MENU_SHOW_INFO" desc="Text for the context menu item that shows the application information. (In sentence case.)"> App info @@ -8466,7 +8462,7 @@ <if expr="is_macosx"> <message name="IDS_NEW_TAB_APP_CREATE_SHORTCUT" desc="Text for the context menu item that creates an app shortcut. (In title case.)"> - Create Shortcut... + Create Shortcut </message> </if> <if expr="not is_macosx">
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index f8fb33c..3dc58f03 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3355,16 +3355,16 @@ "feedback/show_feedback_page.cc", "feedback/system_logs/about_system_logs_fetcher.cc", "feedback/system_logs/about_system_logs_fetcher.h", + "feedback/system_logs/chrome_system_logs_fetcher.cc", + "feedback/system_logs/chrome_system_logs_fetcher.h", "feedback/system_logs/log_sources/chrome_internal_log_source.cc", "feedback/system_logs/log_sources/chrome_internal_log_source.h", "feedback/system_logs/log_sources/crash_ids_source.cc", "feedback/system_logs/log_sources/crash_ids_source.h", "feedback/system_logs/log_sources/memory_details_log_source.cc", "feedback/system_logs/log_sources/memory_details_log_source.h", - "feedback/system_logs/scrubbed_system_logs_fetcher.cc", - "feedback/system_logs/scrubbed_system_logs_fetcher.h", - "feedback/system_logs/system_logs_fetcher_base.cc", - "feedback/system_logs/system_logs_fetcher_base.h", + "feedback/system_logs/system_logs_fetcher.cc", + "feedback/system_logs/system_logs_fetcher.h", "first_run/first_run.cc", "first_run/first_run.h", "first_run/first_run_dialog.h",
diff --git a/chrome/browser/android/data_usage/data_use_matcher_unittest.cc b/chrome/browser/android/data_usage/data_use_matcher_unittest.cc index 74589ca..cb3b2d6 100644 --- a/chrome/browser/android/data_usage/data_use_matcher_unittest.cc +++ b/chrome/browser/android/data_usage/data_use_matcher_unittest.cc
@@ -64,7 +64,7 @@ public: TestExternalDataUseObserverBridge() {} void FetchMatchingRules() const override {} - void ShouldRegisterAsDataUseObserver(bool should_register) const override{}; + void ShouldRegisterAsDataUseObserver(bool should_register) const override {} }; } // namespace
diff --git a/chrome/browser/android/data_usage/data_use_tab_model_unittest.cc b/chrome/browser/android/data_usage/data_use_tab_model_unittest.cc index 1eaef7e..f90901b 100644 --- a/chrome/browser/android/data_usage/data_use_tab_model_unittest.cc +++ b/chrome/browser/android/data_usage/data_use_tab_model_unittest.cc
@@ -81,7 +81,7 @@ public: TestExternalDataUseObserverBridge() {} void FetchMatchingRules() const override {} - void ShouldRegisterAsDataUseObserver(bool should_register) const override{}; + void ShouldRegisterAsDataUseObserver(bool should_register) const override {} }; std::unique_ptr<content::NavigationEntry> CreateNavigationEntry(
diff --git a/chrome/browser/android/devtools_manager_delegate_android.cc b/chrome/browser/android/devtools_manager_delegate_android.cc index b82b932..84be0ee9 100644 --- a/chrome/browser/android/devtools_manager_delegate_android.cc +++ b/chrome/browser/android/devtools_manager_delegate_android.cc
@@ -188,9 +188,7 @@ } std::string DevToolsManagerDelegateAndroid::GetTargetType( - content::RenderFrameHost* host) { - content::WebContents* web_contents = - content::WebContents::FromRenderFrameHost(host); + content::WebContents* web_contents) { TabAndroid* tab = web_contents ? TabAndroid::FromWebContents(web_contents) : nullptr; return tab ? DevToolsAgentHost::kTypePage :
diff --git a/chrome/browser/android/devtools_manager_delegate_android.h b/chrome/browser/android/devtools_manager_delegate_android.h index 68aa109..fa8a1012 100644 --- a/chrome/browser/android/devtools_manager_delegate_android.h +++ b/chrome/browser/android/devtools_manager_delegate_android.h
@@ -26,7 +26,7 @@ base::DictionaryValue* HandleCommand( content::DevToolsAgentHost* agent_host, base::DictionaryValue* command_dict) override; - std::string GetTargetType(content::RenderFrameHost* host) override; + std::string GetTargetType(content::WebContents* web_contents) override; content::DevToolsAgentHost::List RemoteDebuggingTargets() override; scoped_refptr<content::DevToolsAgentHost> CreateNewTarget( const GURL& url) override;
diff --git a/chrome/browser/banners/app_banner_manager_browsertest.cc b/chrome/browser/banners/app_banner_manager_browsertest.cc index 3229e333..61565d6 100644 --- a/chrome/browser/banners/app_banner_manager_browsertest.cc +++ b/chrome/browser/banners/app_banner_manager_browsertest.cc
@@ -8,6 +8,8 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" +#include "base/strings/string16.h" +#include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/threading/thread_task_runner_handle.h" @@ -149,6 +151,18 @@ const std::vector<double>& engagement_scores, InstallableStatusCode expected_code_for_histogram, bool expected_to_show) { + RunBannerTest(browser, manager, url, engagement_scores, + expected_code_for_histogram, expected_to_show, + base::string16()); + } + + void RunBannerTest(Browser* browser, + AppBannerManagerTest* manager, + const std::string& url, + const std::vector<double>& engagement_scores, + InstallableStatusCode expected_code_for_histogram, + bool expected_to_show, + const base::string16 expected_tab_title) { base::HistogramTester histograms; GURL test_url = embedded_test_server()->GetURL(url); @@ -187,6 +201,14 @@ EXPECT_EQ(expected_to_show, manager->will_show()); EXPECT_FALSE(manager->is_active()); + // Check the tab title; this allows the test page to send data back out to + // be inspected by the test case. + if (!expected_tab_title.empty()) { + base::string16 title; + EXPECT_TRUE(ui_test_utils::GetCurrentTabTitle(browser, &title)); + EXPECT_EQ(expected_tab_title, title); + } + // If in incognito, ensure that nothing is recorded. // If showing the banner, ensure that the minutes histogram is recorded. if (browser->profile()->IsOffTheRecord()) { @@ -295,6 +317,20 @@ engagement_scores, MANIFEST_EMPTY, false); } +IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, BeforeInstallPrompt) { + std::unique_ptr<AppBannerManagerTest> manager( + CreateAppBannerManager(browser())); + std::vector<double> engagement_scores{0, 5, 10}; + + // Expect that the page sets the tab title to indicate that it got the event + // twice: once for addEventListener('beforeinstallprompt'), and once for the + // onbeforeinstallprompt attribute. + RunBannerTest(browser(), manager.get(), + "/banners/beforeinstallprompt_test_page.html", + engagement_scores, SHOWING_WEB_APP_BANNER, true, + base::ASCIIToUTF16("Got beforeinstallprompt: listener, attr")); +} + IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, CancelBannerDirect) { std::unique_ptr<AppBannerManagerTest> manager( CreateAppBannerManager(browser()));
diff --git a/chrome/browser/browsing_data/history_counter_browsertest.cc b/chrome/browser/browsing_data/history_counter_browsertest.cc index 9dc15988..7379b9b 100644 --- a/chrome/browser/browsing_data/history_counter_browsertest.cc +++ b/chrome/browser/browsing_data/history_counter_browsertest.cc
@@ -34,7 +34,7 @@ class HistoryCounterTest : public InProcessBrowserTest { public: HistoryCounterTest() {} - ~HistoryCounterTest() override {}; + ~HistoryCounterTest() override {} void SetUpOnMainThread() override { time_ = base::Time::Now();
diff --git a/chrome/browser/chrome_content_gpu_manifest_overlay.json b/chrome/browser/chrome_content_gpu_manifest_overlay.json index 123b122..7e275bf 100644 --- a/chrome/browser/chrome_content_gpu_manifest_overlay.json +++ b/chrome/browser/chrome_content_gpu_manifest_overlay.json
@@ -4,8 +4,8 @@ "service_manager:connector": { "provides": { "browser": [ - "arc::mojom::VideoAcceleratorService", - "arc::mojom::VideoAcceleratorServiceClient", + "arc::mojom::VideoDecodeAccelerator", + "arc::mojom::VideoDecodeClient", "chrome::mojom::ResourceUsageReporter" ] }
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc index 75fd783..986fb54a 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc
@@ -96,7 +96,7 @@ } private: - ~CrxLoader() override {}; + ~CrxLoader() override {} // extensions::SandboxedUnpackerClient void OnUnpackSuccess(const base::FilePath& temp_dir,
diff --git a/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc b/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc index 87abb97..1e6155d 100644 --- a/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc +++ b/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc
@@ -13,7 +13,7 @@ #include "base/message_loop/message_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "components/arc/arc_bridge_service.h" -#include "components/arc/common/video_accelerator.mojom.h" +#include "components/arc/common/video_decode_accelerator.mojom.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/gpu_service_registry.h" #include "mojo/edk/embedder/embedder.h" @@ -26,8 +26,8 @@ namespace { -void ConnectToVideoAcceleratorServiceOnIOThread( - mojom::VideoAcceleratorServiceRequest request) { +void ConnectToVideoDecodeAcceleratorOnIOThread( + mojom::VideoDecodeAcceleratorRequest request) { content::BindInterfaceInGpuProcess(std::move(request)); } @@ -37,10 +37,11 @@ public: VideoAcceleratorFactoryService() = default; - void Create(mojom::VideoAcceleratorServiceRequest request) override { + void CreateDecodeAccelerator( + mojom::VideoDecodeAcceleratorRequest request) override { content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::BindOnce(&ConnectToVideoAcceleratorServiceOnIOThread, + base::BindOnce(&ConnectToVideoDecodeAcceleratorOnIOThread, base::Passed(&request))); }
diff --git a/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h b/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h index 728164ad..7ea0afd 100644 --- a/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h +++ b/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h
@@ -15,12 +15,11 @@ class ArcBridgeService; -// This class takes requests for creating channels of video accelerators from -// arc::VideoInstance and forwards these requests to GpuArcVideoServce. It also -// returns the created channels back to the arc::VideoInstance. +// This class takes requests for accessing the VideoAcceleratorFactory, from +// which video decode (or encode) accelerators could be created. // -// This class is the proxy end of GpuArcVideoService and runs in the browser -// process. The corresponding end "GpuArcVideoService" runs in the GPU process. +// This class runs in the browser process, while the created instances of +// VideoDecodeAccelerator or VideoEncodeAccelerator run in the GPU process. // // Lives on the UI thread. class GpuArcVideoServiceHost
diff --git a/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc b/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc index 5c3cb6c..5655d61a 100644 --- a/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc +++ b/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc
@@ -63,46 +63,12 @@ } // namespace -// Store for mapping between ImageSkia ID and Android wallpaper ID. -// Skia image ID is used to keep track of the wallpaper on the Chrome side, and -// we need to map it to the Android's wallpaper ID in ARC++. Because setting -// wallpaper is async operation, the caller stores the pair of ImageSkia ID and -// wallpaper ID when it requests setting a wallpaper, then it obtains the -// corresponding Andorid ID when the completion of setting a wallpaper is -// notified. -class ArcWallpaperService::AndroidIdStore { - public: - AndroidIdStore() = default; - - // Remembers a pair of image and Android ID. - void Push(const gfx::ImageSkia& image, int32_t android_id) { - pairs_.push_back( - {wallpaper::WallpaperResizer::GetImageId(image), android_id}); - } - - // Gets Android ID for |image_id|. Returns -1 if it does not found Android ID - // corresponding to |image_id|. Sometimes the corresonpding |Pop| is not - // called after |Push| is invoked, thus |Pop| removes older pairs in addition - // to the pair of given |image_id| when the pair is found. - int32_t Pop(uint32_t image_id) { - for (size_t i = 0; i < pairs_.size(); ++i) { - if (pairs_[i].image_id == image_id) { - const int32_t result = pairs_[i].android_id; - pairs_.erase(pairs_.begin(), pairs_.begin() + i + 1); - return result; - } - } - return -1; - } - - private: - struct Pair { - uint32_t image_id; - int32_t android_id; - }; - std::deque<Pair> pairs_; - - DISALLOW_COPY_AND_ASSIGN(AndroidIdStore); +struct ArcWallpaperService::WallpaperIdPair { + // ID of wallpaper image which can be obtaind by + // WallpaperResizer::GetImageId(). + uint32_t image_id; + // ID of wallpaper generated in the container side. + int32_t android_id; }; class ArcWallpaperService::DecodeRequest : public ImageDecoder::ImageRequest { @@ -121,7 +87,12 @@ immutable_bitmap.setImmutable(); gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(immutable_bitmap); image.MakeThreadSafe(); - service_->android_id_store()->Push(image, android_id_); + + WallpaperIdPair pair; + pair.image_id = wallpaper::WallpaperResizer::GetImageId(image); + pair.android_id = android_id_; + DCHECK_NE(pair.image_id, 0u) + << "image_id should not be 0 as we succeeded to decode image here."; chromeos::WallpaperManager* const wallpaper_manager = chromeos::WallpaperManager::Get(); @@ -134,6 +105,13 @@ wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, user_manager::User::CUSTOMIZED, image, account.is_active /*update_wallpaper*/); + // When kiosk app is running, or wallpaper cannot be changed due to policy, + // or we are running child profile, WallpaperManager don't submit wallpaper + // change requests. + if (wallpaper_manager->IsPendingWallpaper(pair.image_id)) + service_->id_pairs_.push_back(pair); + else + service_->NotifyWallpaperChangedAndReset(android_id_); // TODO(crbug.com/618922): Register the wallpaper to Chrome OS wallpaper // picker. Currently the new wallpaper does not appear there. The best way @@ -144,12 +122,7 @@ void OnDecodeImageFailed() override { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DLOG(ERROR) << "Failed to decode wallpaper image."; - - // Android regards the new wallpaper was set to Chrome. Invoke - // OnWallpaperDataChanged to notify that the previous wallpaper is still - // used in chrome. Note that |wallpaper_id| is not passed back to ARC in - // this case. - service_->OnWallpaperDataChanged(); + service_->NotifyWallpaperChangedAndReset(android_id_); } private: @@ -161,9 +134,7 @@ }; ArcWallpaperService::ArcWallpaperService(ArcBridgeService* bridge_service) - : ArcService(bridge_service), - binding_(this), - android_id_store_(new AndroidIdStore()) { + : ArcService(bridge_service), binding_(this) { arc_bridge_service()->wallpaper()->AddObserver(this); } @@ -230,14 +201,55 @@ void ArcWallpaperService::OnWallpaperDataChanged() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - auto* const wallpaper_instance = ARC_GET_INSTANCE_FOR_METHOD( - arc_bridge_service()->wallpaper(), OnWallpaperChanged); - const ash::WallpaperController* const wc = GetWallpaperController(); - const int32_t android_id = - wc ? android_id_store_->Pop(wc->GetWallpaperOriginalImageId()) : -1; - if (!wallpaper_instance) + // OnWallpaperDataChanged is invoked from WallpaperController so + // we should be able to get the pointer. + ash::WallpaperController* const wallpaper_controller = + ash::Shell::Get()->wallpaper_controller(); + CHECK(wallpaper_controller); + const uint32_t current_image_id = + wallpaper_controller->GetWallpaperOriginalImageId(); + + chromeos::WallpaperManager* const wallpaper_manager = + chromeos::WallpaperManager::Get(); + bool current_wallppaer_notified = false; + for (auto it = id_pairs_.begin(); it != id_pairs_.end();) { + int32_t const android_id = it->android_id; + bool should_notify = false; + if (it->image_id == current_image_id) { + should_notify = true; + current_wallppaer_notified = true; + it = id_pairs_.erase(it); + } else if (!wallpaper_manager->IsPendingWallpaper(it->image_id)) { + should_notify = true; + it = id_pairs_.erase(it); + } else { + ++it; + } + + if (should_notify) + NotifyWallpaperChanged(android_id); + } + + if (!current_wallppaer_notified) + NotifyWallpaperChanged(-1); +} + +void ArcWallpaperService::NotifyWallpaperChanged(int android_id) { + mojom::WallpaperInstance* const wallpaper_instance = + ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->wallpaper(), + OnWallpaperChanged); + if (wallpaper_instance == nullptr) return; wallpaper_instance->OnWallpaperChanged(android_id); } +void ArcWallpaperService::NotifyWallpaperChangedAndReset(int32_t android_id) { + // Invoke NotifyWallpaperChanged so that setWallpaper completes in Android + // side. + NotifyWallpaperChanged(android_id); + // Invoke NotifyWallpaperChanged with -1 so that Android side regards the + // wallpaper of |android_id_| is no longer used at Chrome side. + NotifyWallpaperChanged(-1); +} + } // namespace arc
diff --git a/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.h b/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.h index e6015c2..b1eb04e 100644 --- a/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.h +++ b/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.h
@@ -46,13 +46,18 @@ // WallpaperControllerObserver implementation. void OnWallpaperDataChanged() override; - AndroidIdStore* android_id_store() { return android_id_store_.get(); } - private: class DecodeRequest; + struct WallpaperIdPair; + + // Notifies wallpaper change if we have wallpaper instance. + void NotifyWallpaperChanged(int android_id); + // Notifies wallpaper change of |android_id|, then notify wallpaper change of + // -1 to reset wallpaper cache at Android side. + void NotifyWallpaperChangedAndReset(int android_id); mojo::Binding<mojom::WallpaperHost> binding_; std::unique_ptr<DecodeRequest> decode_request_; - std::unique_ptr<AndroidIdStore> android_id_store_; + std::vector<WallpaperIdPair> id_pairs_; DISALLOW_COPY_AND_ASSIGN(ArcWallpaperService); };
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.h b/chrome/browser/chromeos/login/lock/screen_locker.h index 58965642..d4d95318 100644 --- a/chrome/browser/chromeos/login/lock/screen_locker.h +++ b/chrome/browser/chromeos/login/lock/screen_locker.h
@@ -206,10 +206,10 @@ const std::unordered_map<std::string, std::vector<std::string>>& matches) override; void OnSessionFailed() override; - void OnRestarted() override{}; + void OnRestarted() override {} void OnEnrollScanDone(uint32_t scan_result, bool enroll_session_complete, - int percent_complete) override{}; + int percent_complete) override {} void OnFingerprintAuthFailure(const user_manager::User& user);
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc index db81b6b..675f657 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -56,6 +56,7 @@ #include "components/user_manager/user_type.h" #include "components/wallpaper/wallpaper_files_id.h" #include "components/wallpaper/wallpaper_layout.h" +#include "components/wallpaper/wallpaper_resizer.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/common/content_switches.h" @@ -290,6 +291,10 @@ SetMode(gfx::ImageSkia(), WallpaperInfo(), base::FilePath(), true); } + uint32_t GetImageId() const { + return wallpaper::WallpaperResizer::GetImageId(user_wallpaper_); + } + private: friend class base::RefCountedThreadSafe<PendingWallpaper>; @@ -413,6 +418,15 @@ wallpaper_manager = nullptr; } +bool WallpaperManager::IsPendingWallpaper(uint32_t image_id) { + for (size_t i = 0; i < loading_.size(); ++i) { + if (loading_[i]->GetImageId() == image_id) { + return true; + } + } + return false; +} + WallpaperManager::WallpaperResolution WallpaperManager::GetAppropriateResolution() { DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h index aced728d..cefafb3 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
@@ -54,6 +54,10 @@ // WallpaperManager to remove any observers it has registered. static void Shutdown(); + // Returns if the image is in the pending list. |image_id| can be obtained + // from gfx::ImageSkia by using WallpaperResizer::GetImageId(). + bool IsPendingWallpaper(uint32_t image_id); + // wallpaper::WallpaperManagerBase: WallpaperResolution GetAppropriateResolution() override; void AddObservers() override;
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc index 26c0c7c7..4243722 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
@@ -32,6 +32,7 @@ #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h" #include "components/wallpaper/wallpaper_files_id.h" +#include "components/wallpaper/wallpaper_resizer.h" #include "content/public/test/test_utils.h" #include "ui/aura/env.h" #include "ui/display/manager/display_manager.h" @@ -834,4 +835,27 @@ wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); } +IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, IsPendingWallpaper) { + // Start loading the default wallpaper. + UpdateDisplay("640x480"); + CreateCmdlineWallpapers(); + SessionManager::Get()->CreateSession(user_manager::StubAccountId(), + "test_hash"); + + WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId()); + + gfx::ImageSkia image = wallpaper_manager_test_utils::CreateTestImage( + 640, 480, wallpaper_manager_test_utils::kCustomWallpaperColor); + EXPECT_FALSE(WallpaperManager::Get()->IsPendingWallpaper( + wallpaper::WallpaperResizer::GetImageId(image))); + WallpaperManager::Get()->SetCustomWallpaper( + user_manager::StubAccountId(), + wallpaper::WallpaperFilesId::FromString("test_hash"), "test-nofile.jpeg", + WALLPAPER_LAYOUT_STRETCH, user_manager::User::CUSTOMIZED, image, true); + EXPECT_TRUE(WallpaperManager::Get()->IsPendingWallpaper( + wallpaper::WallpaperResizer::GetImageId(image))); + wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); + EXPECT_FALSE(WallpaperManager::Get()->IsPendingWallpaper( + wallpaper::WallpaperResizer::GetImageId(image))); +} } // namespace chromeos
diff --git a/chrome/browser/chromeos/preferences_unittest.cc b/chrome/browser/chromeos/preferences_unittest.cc index 03168441..b70b57b 100644 --- a/chrome/browser/chromeos/preferences_unittest.cc +++ b/chrome/browser/chromeos/preferences_unittest.cc
@@ -110,7 +110,7 @@ } protected: - ~State() override{}; + ~State() override {} private: MyMockInputMethodManager* const manager_;
diff --git a/chrome/browser/chromeos/system_logs/command_line_log_source.h b/chrome/browser/chromeos/system_logs/command_line_log_source.h index a7b868b4..dcb8efb 100644 --- a/chrome/browser/chromeos/system_logs/command_line_log_source.h +++ b/chrome/browser/chromeos/system_logs/command_line_log_source.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_COMMAND_LINE_LOG_SOURCE_H_ #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/chromeos/system_logs/dbus_log_source.h b/chrome/browser/chromeos/system_logs/dbus_log_source.h index 1d17b6c..33d40c9 100644 --- a/chrome/browser/chromeos/system_logs/dbus_log_source.h +++ b/chrome/browser/chromeos/system_logs/dbus_log_source.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DBUS_LOG_SOURCE_H_ #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h index c9e298e..9829e9a 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h
@@ -12,7 +12,7 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/chromeos/system_logs/device_event_log_source.h b/chrome/browser/chromeos/system_logs/device_event_log_source.h index c5cf6a0..3d3bbf2 100644 --- a/chrome/browser/chromeos/system_logs/device_event_log_source.h +++ b/chrome/browser/chromeos/system_logs/device_event_log_source.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEVICE_EVENT_LOG_SOURCE_H_ #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/chromeos/system_logs/lsb_release_log_source.h b/chrome/browser/chromeos/system_logs/lsb_release_log_source.h index 39239c6f..9086ccc 100644 --- a/chrome/browser/chromeos/system_logs/lsb_release_log_source.h +++ b/chrome/browser/chromeos/system_logs/lsb_release_log_source.h
@@ -5,7 +5,7 @@ #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_ #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/chromeos/system_logs/single_log_source.h b/chrome/browser/chromeos/system_logs/single_log_source.h index 18b4cc5f..adca49c 100644 --- a/chrome/browser/chromeos/system_logs/single_log_source.h +++ b/chrome/browser/chromeos/system_logs/single_log_source.h
@@ -9,7 +9,7 @@ #include "base/files/file.h" #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" #include "components/feedback/anonymizer_tool.h" namespace system_logs {
diff --git a/chrome/browser/chromeos/system_logs/touch_log_source.h b/chrome/browser/chromeos/system_logs/touch_log_source.h index 89c4f95..b142544 100644 --- a/chrome/browser/chromeos/system_logs/touch_log_source.h +++ b/chrome/browser/chromeos/system_logs/touch_log_source.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_TOUCH_LOG_SOURCE_H_ #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/component_updater/chrome_component_updater_configurator_unittest.cc b/chrome/browser/component_updater/chrome_component_updater_configurator_unittest.cc index aae5764f..20b8e27e 100644 --- a/chrome/browser/component_updater/chrome_component_updater_configurator_unittest.cc +++ b/chrome/browser/component_updater/chrome_component_updater_configurator_unittest.cc
@@ -25,7 +25,7 @@ class ChromeComponentUpdaterConfiguratorTest : public testing::Test { public: ChromeComponentUpdaterConfiguratorTest() {} - ~ChromeComponentUpdaterConfiguratorTest() override{}; + ~ChromeComponentUpdaterConfiguratorTest() override {} // Overrides from testing::Test. void SetUp() override;
diff --git a/chrome/browser/devtools/chrome_devtools_manager_delegate.cc b/chrome/browser/devtools/chrome_devtools_manager_delegate.cc index 3fa7850..75b04a7b 100644 --- a/chrome/browser/devtools/chrome_devtools_manager_delegate.cc +++ b/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
@@ -37,7 +37,6 @@ char ChromeDevToolsManagerDelegate::kTypeApp[] = "app"; char ChromeDevToolsManagerDelegate::kTypeBackgroundPage[] = "background_page"; -char ChromeDevToolsManagerDelegate::kTypeWebView[] = "webview"; namespace { @@ -82,18 +81,14 @@ return bounds_object; } -bool GetExtensionInfo(content::RenderFrameHost* host, +bool GetExtensionInfo(content::WebContents* wc, std::string* name, std::string* type) { - content::WebContents* wc = content::WebContents::FromRenderFrameHost(host); - if (!wc) - return false; Profile* profile = Profile::FromBrowserContext(wc->GetBrowserContext()); if (!profile) return false; const extensions::Extension* extension = - extensions::ProcessManager::Get(profile)->GetExtensionForRenderFrameHost( - host); + extensions::ProcessManager::Get(profile)->GetExtensionForWebContents(wc); if (!extension) return false; extensions::ExtensionHost* extension_host = @@ -343,20 +338,7 @@ } std::string ChromeDevToolsManagerDelegate::GetTargetType( - content::RenderFrameHost* host) { - content::WebContents* web_contents = - content::WebContents::FromRenderFrameHost(host); - - guest_view::GuestViewBase* guest = - guest_view::GuestViewBase::FromWebContents(web_contents); - content::WebContents* guest_contents = - guest ? guest->embedder_web_contents() : nullptr; - if (guest_contents) - return kTypeWebView; - - if (host->GetParent()) - return DevToolsAgentHost::kTypeFrame; - + content::WebContents* web_contents) { for (TabContentsIterator it; !it.done(); it.Next()) { if (*it == web_contents) return DevToolsAgentHost::kTypePage; @@ -364,16 +346,16 @@ std::string extension_name; std::string extension_type; - if (!GetExtensionInfo(host, &extension_name, &extension_type)) + if (!GetExtensionInfo(web_contents, &extension_name, &extension_type)) return DevToolsAgentHost::kTypeOther; return extension_type; } std::string ChromeDevToolsManagerDelegate::GetTargetTitle( - content::RenderFrameHost* host) { + content::WebContents* web_contents) { std::string extension_name; std::string extension_type; - if (!GetExtensionInfo(host, &extension_name, &extension_type)) + if (!GetExtensionInfo(web_contents, &extension_name, &extension_type)) return std::string(); return extension_name; }
diff --git a/chrome/browser/devtools/chrome_devtools_manager_delegate.h b/chrome/browser/devtools/chrome_devtools_manager_delegate.h index e79984f..3042a22 100644 --- a/chrome/browser/devtools/chrome_devtools_manager_delegate.h +++ b/chrome/browser/devtools/chrome_devtools_manager_delegate.h
@@ -25,7 +25,6 @@ public: static char kTypeApp[]; static char kTypeBackgroundPage[]; - static char kTypeWebView[]; ChromeDevToolsManagerDelegate(); ~ChromeDevToolsManagerDelegate() override; @@ -40,8 +39,8 @@ base::DictionaryValue* HandleCommand( content::DevToolsAgentHost* agent_host, base::DictionaryValue* command_dict) override; - std::string GetTargetType(content::RenderFrameHost* host) override; - std::string GetTargetTitle(content::RenderFrameHost* host) override; + std::string GetTargetType(content::WebContents* web_contents) override; + std::string GetTargetTitle(content::WebContents* web_contents) override; scoped_refptr<content::DevToolsAgentHost> CreateNewTarget( const GURL& url) override; std::string GetDiscoveryPageHTML() override;
diff --git a/chrome/browser/devtools/devtools_file_helper.cc b/chrome/browser/devtools/devtools_file_helper.cc index 463cedea..28599b7b 100644 --- a/chrome/browser/devtools/devtools_file_helper.cc +++ b/chrome/browser/devtools/devtools_file_helper.cc
@@ -212,6 +212,12 @@ delegate_(delegate), weak_factory_(this) { pref_change_registrar_.Init(profile_->GetPrefs()); + pref_change_registrar_.Add(prefs::kDevToolsFileSystemPaths, + base::Bind(&DevToolsFileHelper::FileSystemPathsSettingChanged, + base::Unretained(this))); + file_watcher_.reset(new DevToolsFileWatcher( + base::Bind(&DevToolsFileHelper::FilePathsChanged, + weak_factory_.GetWeakPtr()))); } DevToolsFileHelper::~DevToolsFileHelper() { @@ -386,14 +392,6 @@ DevToolsFileHelper::GetFileSystems() { file_system_paths_ = GetAddedFileSystemPaths(profile_); std::vector<FileSystem> file_systems; - if (!file_watcher_) { - file_watcher_.reset(new DevToolsFileWatcher(base::Bind( - &DevToolsFileHelper::FilePathsChanged, weak_factory_.GetWeakPtr()))); - pref_change_registrar_.Add( - prefs::kDevToolsFileSystemPaths, - base::Bind(&DevToolsFileHelper::FileSystemPathsSettingChanged, - base::Unretained(this))); - } for (auto file_system_path : file_system_paths_) { base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path); std::string file_system_id = RegisterFileSystem(web_contents_, path); @@ -430,7 +428,6 @@ void DevToolsFileHelper::FileSystemPathsSettingChanged() { std::set<std::string> remaining; remaining.swap(file_system_paths_); - DCHECK(file_watcher_.get()); for (auto file_system_path : GetAddedFileSystemPaths(profile_)) { if (remaining.find(file_system_path) == remaining.end()) {
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index 55158c2..cbdff1523 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -1354,8 +1354,6 @@ void DevToolsUIBindings::Reload() { reloading_ = true; - if (agent_host_) - agent_host_->DetachClient(this); web_contents_->GetController().Reload(content::ReloadType::NORMAL, false); } @@ -1399,8 +1397,10 @@ if (!reloading_) return; reloading_ = false; - if (agent_host_.get()) + if (agent_host_.get()) { + agent_host_->DetachClient(this); agent_host_->AttachClient(this); + } } void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() {
diff --git a/chrome/browser/extensions/api/data_reduction_proxy/data_reduction_proxy_api.h b/chrome/browser/extensions/api/data_reduction_proxy/data_reduction_proxy_api.h index ebaf836..8af53d7 100644 --- a/chrome/browser/extensions/api/data_reduction_proxy/data_reduction_proxy_api.h +++ b/chrome/browser/extensions/api/data_reduction_proxy/data_reduction_proxy_api.h
@@ -18,7 +18,7 @@ class DataReductionProxyClearDataSavingsFunction : public UIThreadExtensionFunction { private: - ~DataReductionProxyClearDataSavingsFunction() override {}; + ~DataReductionProxyClearDataSavingsFunction() override {} DECLARE_EXTENSION_FUNCTION("dataReductionProxy.clearDataSavings", DATAREDUCTIONPROXY_CLEARDATASAVINGS) @@ -29,7 +29,7 @@ class DataReductionProxyGetDataUsageFunction : public UIThreadExtensionFunction { private: - ~DataReductionProxyGetDataUsageFunction() override{}; + ~DataReductionProxyGetDataUsageFunction() override {} DECLARE_EXTENSION_FUNCTION("dataReductionProxy.getDataUsage", DATAREDUCTIONPROXY_GETDATAUSAGE)
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_private_api.h b/chrome/browser/extensions/api/feedback_private/feedback_private_api.h index 3ff94b9..e3a3007 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_private_api.h +++ b/chrome/browser/extensions/api/feedback_private/feedback_private_api.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H_ #include "chrome/browser/extensions/chrome_extension_function.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" #include "chrome/common/extensions/api/feedback_private.h" #include "extensions/browser/browser_context_keyed_api_factory.h" #include "extensions/browser/extension_function.h"
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_service.cc b/chrome/browser/extensions/api/feedback_private/feedback_service.cc index 1b934920..869afd4 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_service.cc +++ b/chrome/browser/extensions/api/feedback_private/feedback_service.cc
@@ -10,6 +10,7 @@ #include "base/memory/weak_ptr.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_content_client.h" #include "content/public/browser/browser_thread.h" @@ -57,8 +58,9 @@ void FeedbackService::GetSystemInformation( const system_logs::SysLogsFetcherCallback& callback) { - system_logs::ScrubbedSystemLogsFetcher* fetcher = - new system_logs::ScrubbedSystemLogsFetcher(); + // Self-deleting object. + system_logs::SystemLogsFetcher* fetcher = + system_logs::BuildChromeSystemLogsFetcher(); fetcher->Fetch(callback); }
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_service.h b/chrome/browser/extensions/api/feedback_private/feedback_service.h index aa3e86b..dc706ac 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_service.h +++ b/chrome/browser/extensions/api/feedback_private/feedback_service.h
@@ -12,7 +12,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" #include "components/feedback/feedback_data.h" class Profile;
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc b/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc index c4829bd..5d74e69 100644 --- a/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc +++ b/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc
@@ -62,7 +62,7 @@ base::FilePath GetImagePath() { return image_path_; } private: - ~OperationForTest() override{}; + ~OperationForTest() override {} }; class ImageWriterOperationTest : public ImageWriterUnitTestBase {
diff --git a/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc b/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc index 2af5383..28ca08a3 100644 --- a/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc +++ b/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc
@@ -68,7 +68,7 @@ base::FilePath GetImagePath() { return image_path_; } private: - ~OperationForTest() override{}; + ~OperationForTest() override {} }; class ImageWriterWriteFromUrlOperationTest : public ImageWriterUnitTestBase {
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h index 5cc78e4..511b1fc 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.h +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -62,7 +62,7 @@ int cursor_pos, int anchor_pos, int offset_pos) override; - void OnRequestEngineSwitch() override {}; + void OnRequestEngineSwitch() override {} protected: // Helper function used to forward the given event to the |profile_|'s event
diff --git a/chrome/browser/extensions/api/log_private/log_private_api.h b/chrome/browser/extensions/api/log_private/log_private_api.h index 9529d5f..d413e46 100644 --- a/chrome/browser/extensions/api/log_private/log_private_api.h +++ b/chrome/browser/extensions/api/log_private/log_private_api.h
@@ -14,7 +14,7 @@ #include "chrome/browser/extensions/api/log_private/filter_handler.h" #include "chrome/browser/extensions/api/log_private/log_parser.h" #include "chrome/browser/extensions/chrome_extension_function.h" -#include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" #include "chrome/common/extensions/api/log_private.h" #include "extensions/browser/api/api_resource.h" #include "extensions/browser/api/api_resource_manager.h"
diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc index f8d5097..a9562480 100644 --- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc +++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
@@ -23,7 +23,8 @@ #include "chrome/browser/extensions/api/log_private/filter_handler.h" #include "chrome/browser/extensions/api/log_private/log_parser.h" #include "chrome/browser/extensions/api/log_private/syslog_parser.h" -#include "chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h" +#include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" +#include "chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.h" #include "chrome/browser/io_thread.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" @@ -426,11 +427,12 @@ EXTENSION_FUNCTION_VALIDATE(params.get()); filter_handler_.reset(new FilterHandler(params->filter)); - system_logs::SystemLogsFetcherBase* fetcher; + // Self-deleting object. + system_logs::SystemLogsFetcher* fetcher = nullptr; if ((params->filter).scrub) { - fetcher = new system_logs::ScrubbedSystemLogsFetcher(); + fetcher = system_logs::BuildChromeSystemLogsFetcher(); } else { - fetcher = new system_logs::AboutSystemLogsFetcher(); + fetcher = system_logs::BuildAboutSystemLogsFetcher(); } fetcher->Fetch( base::Bind(&LogPrivateGetHistoricalFunction::OnSystemLogsLoaded, this));
diff --git a/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc b/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc index 619dd3b5a..e709aab 100644 --- a/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc +++ b/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc
@@ -4,13 +4,10 @@ #include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" -#include "base/bind.h" -#include "base/bind_helpers.h" #include "base/memory/ptr_util.h" #include "build/build_config.h" #include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h" #include "chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h" -#include "content/public/browser/browser_thread.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/system_logs/command_line_log_source.h" @@ -21,31 +18,28 @@ #include "chrome/browser/chromeos/system_logs/touch_log_source.h" #endif -using content::BrowserThread; - namespace system_logs { -AboutSystemLogsFetcher::AboutSystemLogsFetcher() { - data_sources_.push_back(base::MakeUnique<ChromeInternalLogSource>()); - data_sources_.push_back(base::MakeUnique<MemoryDetailsLogSource>()); +SystemLogsFetcher* BuildAboutSystemLogsFetcher() { + const bool scrub_data = false; + SystemLogsFetcher* fetcher = new SystemLogsFetcher(scrub_data); + + fetcher->AddSource(base::MakeUnique<ChromeInternalLogSource>()); + fetcher->AddSource(base::MakeUnique<MemoryDetailsLogSource>()); #if defined(OS_CHROMEOS) - data_sources_.push_back(base::MakeUnique<CommandLineLogSource>()); - data_sources_.push_back(base::MakeUnique<DBusLogSource>()); - data_sources_.push_back(base::MakeUnique<DeviceEventLogSource>()); - data_sources_.push_back(base::MakeUnique<LsbReleaseLogSource>()); - data_sources_.push_back(base::MakeUnique<TouchLogSource>()); + fetcher->AddSource(base::MakeUnique<CommandLineLogSource>()); + fetcher->AddSource(base::MakeUnique<DBusLogSource>()); + fetcher->AddSource(base::MakeUnique<DeviceEventLogSource>()); + fetcher->AddSource(base::MakeUnique<LsbReleaseLogSource>()); + fetcher->AddSource(base::MakeUnique<TouchLogSource>()); // Debug Daemon data source - currently only this data source supports // the scrub_data parameter. - const bool scrub_data = false; - data_sources_.push_back(base::MakeUnique<DebugDaemonLogSource>(scrub_data)); + fetcher->AddSource(base::MakeUnique<DebugDaemonLogSource>(scrub_data)); #endif - num_pending_requests_ = data_sources_.size(); -} - -AboutSystemLogsFetcher::~AboutSystemLogsFetcher() { + return fetcher; } } // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/about_system_logs_fetcher.h b/chrome/browser/feedback/system_logs/about_system_logs_fetcher.h index 5938071..df63c847 100644 --- a/chrome/browser/feedback/system_logs/about_system_logs_fetcher.h +++ b/chrome/browser/feedback/system_logs/about_system_logs_fetcher.h
@@ -5,22 +5,13 @@ #ifndef CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_ABOUT_SYSTEM_LOGS_FETCHER_H_ #define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_ABOUT_SYSTEM_LOGS_FETCHER_H_ -#include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" - namespace system_logs { -// The AboutAboutSystemLogsFetcher aggregates the unscrubbed logs for display -// in the about:system page. -class AboutSystemLogsFetcher : public SystemLogsFetcherBase { - public: - AboutSystemLogsFetcher(); - ~AboutSystemLogsFetcher() override; +class SystemLogsFetcher; - private: - - DISALLOW_COPY_AND_ASSIGN(AboutSystemLogsFetcher); -}; +// Creates a SystemLogsFetcher to aggregate logs for chrome://system. +// The fetcher deletes itself once it finishes fetching data. +SystemLogsFetcher* BuildAboutSystemLogsFetcher(); } // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.cc b/chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.cc new file mode 100644 index 0000000..31df6ba1 --- /dev/null +++ b/chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.cc
@@ -0,0 +1,49 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.h" + +#include "base/memory/ptr_util.h" +#include "build/build_config.h" +#include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h" +#include "chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h" +#include "chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" + +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/system_logs/command_line_log_source.h" +#include "chrome/browser/chromeos/system_logs/dbus_log_source.h" +#include "chrome/browser/chromeos/system_logs/debug_daemon_log_source.h" +#include "chrome/browser/chromeos/system_logs/device_event_log_source.h" +#include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h" +#include "chrome/browser/chromeos/system_logs/touch_log_source.h" +#endif + +namespace system_logs { + +SystemLogsFetcher* BuildChromeSystemLogsFetcher() { + const bool scrub_data = true; + SystemLogsFetcher* fetcher = new SystemLogsFetcher(scrub_data); + + fetcher->AddSource(base::MakeUnique<ChromeInternalLogSource>()); + fetcher->AddSource(base::MakeUnique<CrashIdsSource>()); + fetcher->AddSource(base::MakeUnique<MemoryDetailsLogSource>()); + +#if defined(OS_CHROMEOS) + fetcher->AddSource(base::MakeUnique<CommandLineLogSource>()); + fetcher->AddSource(base::MakeUnique<DBusLogSource>()); + fetcher->AddSource(base::MakeUnique<DeviceEventLogSource>()); + fetcher->AddSource(base::MakeUnique<LsbReleaseLogSource>()); + fetcher->AddSource(base::MakeUnique<TouchLogSource>()); + + // Debug Daemon data source - currently only this data source supports + // the scrub_data parameter, but the others still get scrubbed by + // SystemLogsFetcher. + fetcher->AddSource(base::MakeUnique<DebugDaemonLogSource>(scrub_data)); +#endif + + return fetcher; +} + +} // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.h b/chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.h new file mode 100644 index 0000000..e9d5bc48 --- /dev/null +++ b/chrome/browser/feedback/system_logs/chrome_system_logs_fetcher.h
@@ -0,0 +1,18 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_CHROME_SYSTEM_LOGS_FETCHER_H_ +#define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_CHROME_SYSTEM_LOGS_FETCHER_H_ + +namespace system_logs { + +class SystemLogsFetcher; + +// Creates a SystemLogsFetcher to aggregate the scrubbed logs for sending with +// feedback reports. The fetcher deletes itself once it finishes fetching data. +SystemLogsFetcher* BuildChromeSystemLogsFetcher(); + +} // namespace system_logs + +#endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_CHROME_SYSTEM_LOGS_FETCHER_H_
diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h index ea97f05a..0eeaf0a 100644 --- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h +++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "build/build_config.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h index c648ce9..f46c042 100644 --- a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h +++ b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h
@@ -8,7 +8,7 @@ #include <vector> #include "base/callback_forward.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" #include "components/upload_list/crash_upload_list.h" #include "components/upload_list/upload_list.h"
diff --git a/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h b/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h index 2ceef0a3..aa25d08 100644 --- a/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h +++ b/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_MEMORY_DETAILS_LOG_SOURCE_H_ #include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" namespace system_logs {
diff --git a/chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.cc b/chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.cc deleted file mode 100644 index aaac91d..0000000 --- a/chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.cc +++ /dev/null
@@ -1,60 +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/feedback/system_logs/scrubbed_system_logs_fetcher.h" - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/memory/ptr_util.h" -#include "build/build_config.h" -#include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h" -#include "chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h" -#include "chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h" -#include "content/public/browser/browser_thread.h" - -#if defined(OS_CHROMEOS) -#include "chrome/browser/chromeos/system_logs/command_line_log_source.h" -#include "chrome/browser/chromeos/system_logs/dbus_log_source.h" -#include "chrome/browser/chromeos/system_logs/debug_daemon_log_source.h" -#include "chrome/browser/chromeos/system_logs/device_event_log_source.h" -#include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h" -#include "chrome/browser/chromeos/system_logs/touch_log_source.h" -#endif - -using content::BrowserThread; - -namespace system_logs { - -ScrubbedSystemLogsFetcher::ScrubbedSystemLogsFetcher() { - data_sources_.push_back(base::MakeUnique<ChromeInternalLogSource>()); - data_sources_.push_back(base::MakeUnique<CrashIdsSource>()); - data_sources_.push_back(base::MakeUnique<MemoryDetailsLogSource>()); - -#if defined(OS_CHROMEOS) - data_sources_.push_back(base::MakeUnique<CommandLineLogSource>()); - data_sources_.push_back(base::MakeUnique<DBusLogSource>()); - data_sources_.push_back(base::MakeUnique<DeviceEventLogSource>()); - data_sources_.push_back(base::MakeUnique<LsbReleaseLogSource>()); - data_sources_.push_back(base::MakeUnique<TouchLogSource>()); - - // Debug Daemon data source - currently only this data source supports - // the scrub_data parameter but all others get processed by Rewrite() - // as well. - const bool scrub_data = true; - data_sources_.push_back(base::MakeUnique<DebugDaemonLogSource>(scrub_data)); -#endif - - num_pending_requests_ = data_sources_.size(); -} - -ScrubbedSystemLogsFetcher::~ScrubbedSystemLogsFetcher() { -} - -void ScrubbedSystemLogsFetcher::Rewrite(const std::string& source_name, - SystemLogsResponse* response) { - for (auto& element : *response) - element.second = anonymizer_.Anonymize(element.second); -} - -} // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h b/chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h deleted file mode 100644 index fdf23be..0000000 --- a/chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h +++ /dev/null
@@ -1,36 +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_FEEDBACK_SYSTEM_LOGS_SCRUBBED_SYSTEM_LOGS_FETCHER_H_ -#define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SCRUBBED_SYSTEM_LOGS_FETCHER_H_ - -#include "base/macros.h" -#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" -#include "components/feedback/anonymizer_tool.h" - -namespace system_logs { - -// The ScrubbedSystemLogsFetcher aggregates the scrubbed logs for sending -// with feedback reports. -// TODO: This class needs to be expanded to provide better scrubbing of -// system logs. -class ScrubbedSystemLogsFetcher : public SystemLogsFetcherBase { - public: - ScrubbedSystemLogsFetcher(); - ~ScrubbedSystemLogsFetcher() override; - - protected: - void Rewrite(const std::string& source_name, - SystemLogsResponse* response) override; - - private: - feedback::AnonymizerTool anonymizer_; - - DISALLOW_COPY_AND_ASSIGN(ScrubbedSystemLogsFetcher); -}; - -} // namespace system_logs - -#endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SCRUBBED_SYSTEM_LOGS_FETCHER_H_ -
diff --git a/chrome/browser/feedback/system_logs/system_logs_fetcher.cc b/chrome/browser/feedback/system_logs/system_logs_fetcher.cc new file mode 100644 index 0000000..97dc689 --- /dev/null +++ b/chrome/browser/feedback/system_logs/system_logs_fetcher.cc
@@ -0,0 +1,81 @@ +// 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/feedback/system_logs/system_logs_fetcher.h" + +#include <utility> + +#include "base/bind.h" +#include "base/bind_helpers.h" +#include "base/memory/ptr_util.h" +#include "content/public/browser/browser_thread.h" + +using content::BrowserThread; + +namespace system_logs { + +SystemLogsSource::SystemLogsSource(const std::string& source_name) + : source_name_(source_name) {} + +SystemLogsSource::~SystemLogsSource() {} + +SystemLogsFetcher::SystemLogsFetcher(bool scrub_data) + : response_(base::MakeUnique<SystemLogsResponse>()), + num_pending_requests_(0), + weak_ptr_factory_(this) { + if (scrub_data) + anonymizer_ = base::MakeUnique<feedback::AnonymizerTool>(); +} + +SystemLogsFetcher::~SystemLogsFetcher() {} + +void SystemLogsFetcher::AddSource(std::unique_ptr<SystemLogsSource> source) { + data_sources_.emplace_back(std::move(source)); + num_pending_requests_++; +} + +void SystemLogsFetcher::Fetch(const SysLogsFetcherCallback& callback) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK(callback_.is_null()); + DCHECK(!callback.is_null()); + + callback_ = callback; + for (size_t i = 0; i < data_sources_.size(); ++i) { + VLOG(1) << "Fetching SystemLogSource: " << data_sources_[i]->source_name(); + data_sources_[i]->Fetch(base::Bind(&SystemLogsFetcher::OnFetched, + weak_ptr_factory_.GetWeakPtr(), + data_sources_[i]->source_name())); + } +} + +void SystemLogsFetcher::OnFetched(const std::string& source_name, + SystemLogsResponse* response) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + VLOG(1) << "Received SystemLogSource: " << source_name; + + if (anonymizer_) { + for (auto& element : *response) + element.second = anonymizer_->Anonymize(element.second); + } + AddResponse(source_name, response); +} + +void SystemLogsFetcher::AddResponse(const std::string& source_name, + SystemLogsResponse* response) { + for (const auto& it : *response) { + // An element with a duplicate key would not be successfully inserted. + bool ok = response_->emplace(it).second; + DCHECK(ok) << "Duplicate key found: " << it.first; + } + + --num_pending_requests_; + if (num_pending_requests_ > 0) + return; + + callback_.Run(std::move(response_)); + BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); +} + +} // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/system_logs_fetcher.h b/chrome/browser/feedback/system_logs/system_logs_fetcher.h new file mode 100644 index 0000000..8fe6af7 --- /dev/null +++ b/chrome/browser/feedback/system_logs/system_logs_fetcher.h
@@ -0,0 +1,107 @@ +// 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_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_FETCHER_H_ +#define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_FETCHER_H_ + +#include <stddef.h> + +#include <map> +#include <memory> +#include <string> +#include <vector> + +#include "base/callback.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "components/feedback/anonymizer_tool.h" +#include "components/feedback/feedback_common.h" + +namespace system_logs { + +using SystemLogsResponse = FeedbackCommon::SystemLogsMap; + +// Callback that the data sources use to return data. +using SysLogsSourceCallback = base::Callback<void(SystemLogsResponse*)>; + +// Callback that the SystemLogsFetcher uses to return data. +using SysLogsFetcherCallback = + base::Callback<void(std::unique_ptr<SystemLogsResponse>)>; + +// The SystemLogsSource provides an interface for the data sources that +// the SystemLogsFetcher class uses to fetch logs and other information. +class SystemLogsSource { + public: + // |source_name| provides a descriptive identifier for debugging. + explicit SystemLogsSource(const std::string& source_name); + virtual ~SystemLogsSource(); + + // Fetches data and passes it by pointer to the callback + virtual void Fetch(const SysLogsSourceCallback& callback) = 0; + + const std::string& source_name() const { return source_name_; } + + private: + std::string source_name_; +}; + +// The SystemLogsFetcher fetches key-value data from a list of log sources. +// +// EXAMPLE: +// class Example { +// public: +// void ProcessLogs(SystemLogsResponse* response) { +// // do something with the logs +// } +// void GetLogs() { +// SystemLogsFetcher* fetcher = new SystemLogsFetcher(/*scrub_data=*/ true); +// fetcher->AddSource(base::MakeUnique<LogSourceOne>()); +// fetcher->AddSource(base::MakeUnique<LogSourceTwo>()); +// fetcher->Fetch(base::Bind(&Example::ProcessLogs, this)); +// } +// }; +class SystemLogsFetcher { + public: + // If scrub_data is true, logs will be anonymized. + // TODO(battre): This class needs to be expanded to provide better scrubbing + // of system logs. + explicit SystemLogsFetcher(bool scrub_data); + ~SystemLogsFetcher(); + + // Adds a source to use when fetching. + void AddSource(std::unique_ptr<SystemLogsSource> source); + + // Starts the fetch process. + void Fetch(const SysLogsFetcherCallback& callback); + + private: + // Callback passed to all the data sources. May call Scrub(), then calls + // AddResponse(). + void OnFetched(const std::string& source_name, SystemLogsResponse* response); + + // Anonymizes the response data. + void Scrub(SystemLogsResponse* response); + + // Merges the |response| it receives into response_. When all the data sources + // have responded, it deletes their objects and returns the response to the + // callback_. After this it deletes this instance of the object. + void AddResponse(const std::string& source_name, + SystemLogsResponse* response); + + std::vector<std::unique_ptr<SystemLogsSource>> data_sources_; + SysLogsFetcherCallback callback_; + + std::unique_ptr<SystemLogsResponse> response_; // The actual response data. + size_t num_pending_requests_; // The number of callbacks it should get. + + std::unique_ptr<feedback::AnonymizerTool> anonymizer_; + + base::WeakPtrFactory<SystemLogsFetcher> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(SystemLogsFetcher); +}; + +} // namespace system_logs + +#endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_FETCHER_H_
diff --git a/chrome/browser/feedback/system_logs/system_logs_fetcher_base.cc b/chrome/browser/feedback/system_logs/system_logs_fetcher_base.cc deleted file mode 100644 index 7f90985b..0000000 --- a/chrome/browser/feedback/system_logs/system_logs_fetcher_base.cc +++ /dev/null
@@ -1,78 +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/feedback/system_logs/system_logs_fetcher_base.h" - -#include <utility> - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "content/public/browser/browser_thread.h" - -using content::BrowserThread; - -namespace system_logs { - -SystemLogsSource::SystemLogsSource(const std::string& source_name) - : source_name_(source_name) { -} - -SystemLogsSource::~SystemLogsSource() { -} - -SystemLogsFetcherBase::SystemLogsFetcherBase() - : response_(new SystemLogsResponse), - num_pending_requests_(0) { -} - -SystemLogsFetcherBase::~SystemLogsFetcherBase() {} - -void SystemLogsFetcherBase::Fetch(const SysLogsFetcherCallback& callback) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(callback_.is_null()); - DCHECK(!callback.is_null()); - - callback_ = callback; - for (size_t i = 0; i < data_sources_.size(); ++i) { - VLOG(1) << "Fetching SystemLogSource: " << data_sources_[i]->source_name(); - data_sources_[i]->Fetch(base::Bind(&SystemLogsFetcherBase::OnFetched, - AsWeakPtr(), - data_sources_[i]->source_name())); - } -} - -void SystemLogsFetcherBase::OnFetched(const std::string& source_name, - SystemLogsResponse* response) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - VLOG(1) << "Received SystemLogSource: " << source_name; - - Rewrite(source_name, response); - AddResponse(source_name, response); -} - -void SystemLogsFetcherBase::Rewrite(const std::string& /* source_name */, - SystemLogsResponse* /* response */) { - // This implementation in the base class is intentionally empty. -} - -void SystemLogsFetcherBase::AddResponse(const std::string& source_name, - SystemLogsResponse* response) { - for (SystemLogsResponse::const_iterator it = response->begin(); - it != response->end(); - ++it) { - // It is an error to insert an element with a pre-existing key. - bool ok = response_->insert(*it).second; - DCHECK(ok) << "Duplicate key found: " << it->first; - } - - --num_pending_requests_; - if (num_pending_requests_ > 0) - return; - - callback_.Run(std::move(response_)); - BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); -} - -} // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h b/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h deleted file mode 100644 index 34bc19b..0000000 --- a/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h +++ /dev/null
@@ -1,99 +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_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_FETCHER_BASE_H_ -#define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_FETCHER_BASE_H_ - -#include <stddef.h> - -#include <map> -#include <memory> -#include <string> -#include <vector> - -#include "base/callback.h" -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "components/feedback/feedback_common.h" - -namespace system_logs { - -using SystemLogsResponse = FeedbackCommon::SystemLogsMap; - -// Callback that the data sources use to return data. -using SysLogsSourceCallback = base::Callback<void(SystemLogsResponse*)>; - -// Callback that the SystemLogsFetcherBase uses to return data. -using SysLogsFetcherCallback = - base::Callback<void(std::unique_ptr<SystemLogsResponse>)>; - -// The SystemLogsSource provides a interface for the data sources that -// the SystemLogsFetcherBase class uses to fetch logs and other -// information. -class SystemLogsSource { - public: - // |source_name| provides a descriptive identifier for debugging. - explicit SystemLogsSource(const std::string& source_name); - virtual ~SystemLogsSource(); - - // Fetches data and passes it by to the callback - virtual void Fetch(const SysLogsSourceCallback& callback) = 0; - - const std::string& source_name() const { return source_name_; } - - private: - std::string source_name_; -}; - -// The SystemLogsFetcherBaseBase specifies an interface for LogFetcher classes. -// Derived LogFetcher classes aggregate the logs from a list of SystemLogSource -// classes. -// -// EXAMPLE: -// class Example { -// public: -// void ProcessLogs(SystemLogsResponse* response) { -// //do something with the logs -// } -// void GetLogs() { -// SystemLogsFetcherBase* fetcher = new SystemLogsFetcherBase(); -// fetcher->Fetch(base::Bind(&Example::ProcessLogs, this)); -// } -class SystemLogsFetcherBase - : public base::SupportsWeakPtr<SystemLogsFetcherBase> { - public: - SystemLogsFetcherBase(); - virtual ~SystemLogsFetcherBase(); - - void Fetch(const SysLogsFetcherCallback& callback); - - protected: - // Callback passed to all the data sources. Calls Rewrite() and AddResponse(). - void OnFetched(const std::string& source_name, SystemLogsResponse* response); - - // Virtual function that allows derived classes to modify the response before - // it gets added to the output. - virtual void Rewrite(const std::string& source_name, - SystemLogsResponse* response); - - // Merges the |data| it receives into response_. When all the data sources - // have responded, it deletes their objects and returns the response to the - // callback_. After this it deletes this instance of the object. - void AddResponse(const std::string& source_name, - SystemLogsResponse* response); - - std::vector<std::unique_ptr<SystemLogsSource>> data_sources_; - SysLogsFetcherCallback callback_; - - std::unique_ptr<SystemLogsResponse> response_; // The actual response data. - size_t num_pending_requests_; // The number of callbacks it should get. - - private: - - DISALLOW_COPY_AND_ASSIGN(SystemLogsFetcherBase); -}; - -} // namespace system_logs - -#endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_FETCHER_BASE_H_
diff --git a/chrome/browser/notifications/message_center_settings_controller_unittest.cc b/chrome/browser/notifications/message_center_settings_controller_unittest.cc index d7c7133..b9f5f1a 100644 --- a/chrome/browser/notifications/message_center_settings_controller_unittest.cc +++ b/chrome/browser/notifications/message_center_settings_controller_unittest.cc
@@ -37,7 +37,7 @@ MessageCenterSettingsControllerBaseTest() : testing_profile_manager_(TestingBrowserProcess::GetGlobal()) {} - ~MessageCenterSettingsControllerBaseTest() override{}; + ~MessageCenterSettingsControllerBaseTest() override {} base::FilePath GetProfilePath(const std::string& base_name) { return testing_profile_manager_.profile_manager()->user_data_dir()
diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc index 08ce2ed..b8d92325 100644 --- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
@@ -188,6 +188,10 @@ const char kHistogramForegroundToFirstPaint[] = "PageLoad.PaintTiming.ForegroundToFirstPaint"; +const char kHistogramForegroundToFirstContentfulPaint[] = + "PageLoad.PaintTiming.ForegroundToFirstContentfulPaint"; +const char kHistogramForegroundToFirstMeaningfulPaint[] = + "PageLoad.Experimental.PaintTiming.ForegroundToFirstMeaningfulPaint"; const char kHistogramCacheRequestPercentParseStop[] = "PageLoad.Experimental.Cache.RequestPercent.ParseStop"; @@ -338,16 +342,8 @@ timing.paint_timing->first_paint.value()); } - // Record the time to first paint for pages which were: - // - Opened in the background. - // - Moved to the foreground prior to the first paint. - // - Not moved back to the background prior to the first paint. - if (!info.started_in_foreground && info.first_foreground_time && - info.first_foreground_time.value() <= - timing.paint_timing->first_paint.value() && - (!info.first_background_time || - timing.paint_timing->first_paint.value() <= - info.first_background_time.value())) { + if (WasStartedInBackgroundOptionalEventInForeground( + timing.paint_timing->first_paint, info)) { PAGE_LOAD_HISTOGRAM(internal::kHistogramForegroundToFirstPaint, timing.paint_timing->first_paint.value() - info.first_foreground_time.value()); @@ -470,6 +466,13 @@ timing.paint_timing->first_contentful_paint.value() - timing.parse_timing->parse_start.value()); } + + if (WasStartedInBackgroundOptionalEventInForeground( + timing.paint_timing->first_contentful_paint, info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramForegroundToFirstContentfulPaint, + timing.paint_timing->first_contentful_paint.value() - + info.first_foreground_time.value()); + } } void CorePageLoadMetricsObserver::OnFirstMeaningfulPaintInMainFrameDocument( @@ -495,6 +498,13 @@ RecordFirstMeaningfulPaintStatus( internal::FIRST_MEANINGFUL_PAINT_BACKGROUNDED); } + + if (WasStartedInBackgroundOptionalEventInForeground( + timing.paint_timing->first_meaningful_paint, info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramForegroundToFirstMeaningfulPaint, + timing.paint_timing->first_meaningful_paint.value() - + info.first_foreground_time.value()); + } } else { RecordFirstMeaningfulPaintStatus( internal::FIRST_MEANINGFUL_PAINT_USER_INTERACTION_BEFORE_FMP);
diff --git a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc index 07d663c..b96e1c97 100644 --- a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc
@@ -74,6 +74,25 @@ "PageLoad.Clients.ServiceWorker.DocumentTiming.NavigationToLoadEventFired." "search"; +const char kHistogramNoServiceWorkerFirstContentfulPaintSearch[] = + "PageLoad.Clients.NoServiceWorker.PaintTiming." + "NavigationToFirstContentfulPaint.search"; +const char kHistogramNoServiceWorkerParseStartToFirstContentfulPaintSearch[] = + "PageLoad.Clients.NoServiceWorker.PaintTiming." + "ParseStartToFirstContentfulPaint.search"; +const char kHistogramNoServiceWorkerFirstMeaningfulPaintSearch[] = + "PageLoad.Clients.NoServiceWorker.Experimental.PaintTiming." + "NavigationToFirstMeaningfulPaint.search"; +const char kHistogramNoServiceWorkerParseStartToFirstMeaningfulPaintSearch[] = + "PageLoad.Clients.NoServiceWorker.Experimental.PaintTiming." + "ParseStartToFirstMeaningfulPaint.search"; +const char kHistogramNoServiceWorkerDomContentLoadedSearch[] = + "PageLoad.Clients.NoServiceWorker.DocumentTiming." + "NavigationToDOMContentLoadedEventFired.search"; +const char kHistogramNoServiceWorkerLoadSearch[] = + "PageLoad.Clients.NoServiceWorker.DocumentTiming." + "NavigationToLoadEventFired.search"; + } // namespace internal namespace { @@ -96,8 +115,22 @@ void ServiceWorkerPageLoadMetricsObserver::OnFirstContentfulPaintInPage( const page_load_metrics::mojom::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& info) { - if (!IsServiceWorkerControlled(info)) + if (!IsServiceWorkerControlled(info)) { + if (!WasStartedInForegroundOptionalEventInForeground( + timing.paint_timing->first_contentful_paint, info) || + !FromGWSPageLoadMetricsLogger::IsGoogleSearchResultUrl(info.url)) { + return; + } + PAGE_LOAD_HISTOGRAM( + internal::kHistogramNoServiceWorkerFirstContentfulPaintSearch, + timing.paint_timing->first_contentful_paint.value()); + PAGE_LOAD_HISTOGRAM( + internal:: + kHistogramNoServiceWorkerParseStartToFirstContentfulPaintSearch, + timing.paint_timing->first_contentful_paint.value() - + timing.parse_timing->parse_start.value()); return; + } if (!WasStartedInForegroundOptionalEventInForeground( timing.paint_timing->first_contentful_paint, info)) { PAGE_LOAD_HISTOGRAM( @@ -135,12 +168,23 @@ OnFirstMeaningfulPaintInMainFrameDocument( const page_load_metrics::mojom::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& info) { - if (!IsServiceWorkerControlled(info)) - return; if (!WasStartedInForegroundOptionalEventInForeground( timing.paint_timing->first_meaningful_paint, info)) { return; } + if (!IsServiceWorkerControlled(info)) { + if (!FromGWSPageLoadMetricsLogger::IsGoogleSearchResultUrl(info.url)) + return; + PAGE_LOAD_HISTOGRAM( + internal::kHistogramNoServiceWorkerFirstMeaningfulPaintSearch, + timing.paint_timing->first_meaningful_paint.value()); + PAGE_LOAD_HISTOGRAM( + internal:: + kHistogramNoServiceWorkerParseStartToFirstMeaningfulPaintSearch, + timing.paint_timing->first_meaningful_paint.value() - + timing.parse_timing->parse_start.value()); + return; + } PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerFirstMeaningfulPaint, timing.paint_timing->first_meaningful_paint.value()); PAGE_LOAD_HISTOGRAM( @@ -170,12 +214,18 @@ void ServiceWorkerPageLoadMetricsObserver::OnDomContentLoadedEventStart( const page_load_metrics::mojom::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& info) { - if (!IsServiceWorkerControlled(info)) - return; if (!WasStartedInForegroundOptionalEventInForeground( timing.document_timing->dom_content_loaded_event_start, info)) { return; } + if (!IsServiceWorkerControlled(info)) { + if (!FromGWSPageLoadMetricsLogger::IsGoogleSearchResultUrl(info.url)) + return; + PAGE_LOAD_HISTOGRAM( + internal::kHistogramNoServiceWorkerDomContentLoadedSearch, + timing.document_timing->dom_content_loaded_event_start.value()); + return; + } PAGE_LOAD_HISTOGRAM( internal::kHistogramServiceWorkerDomContentLoaded, timing.document_timing->dom_content_loaded_event_start.value()); @@ -193,11 +243,16 @@ void ServiceWorkerPageLoadMetricsObserver::OnLoadEventStart( const page_load_metrics::mojom::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& info) { - if (!IsServiceWorkerControlled(info)) - return; if (!WasStartedInForegroundOptionalEventInForeground( timing.document_timing->load_event_start, info)) return; + if (!IsServiceWorkerControlled(info)) { + if (!FromGWSPageLoadMetricsLogger::IsGoogleSearchResultUrl(info.url)) + return; + PAGE_LOAD_HISTOGRAM(internal::kHistogramNoServiceWorkerLoadSearch, + timing.document_timing->load_event_start.value()); + return; + } PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoad, timing.document_timing->load_event_start.value()); if (IsInboxSite(info.url)) {
diff --git a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.h index b6b974d3..4b3fda6 100644 --- a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.h +++ b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.h
@@ -39,6 +39,15 @@ extern const char kHistogramServiceWorkerDomContentLoadedSearch[]; extern const char kHistogramServiceWorkerLoadSearch[]; +extern const char kHistogramNoServiceWorkerFirstContentfulPaintSearch[]; +extern const char kHistogramNoServiceWorkerFirstMeaningfulPaintSearch[]; +extern const char + kHistogramNoServiceWorkerParseStartToFirstMeaningfulPaintSearch[]; +extern const char + kHistogramNoServiceWorkerParseStartToFirstContentfulPaintSearch[]; +extern const char kHistogramNoServiceWorkerDomContentLoadedSearch[]; +extern const char kHistogramNoServiceWorkerLoadSearch[]; + } // namespace internal class ServiceWorkerPageLoadMetricsObserver
diff --git a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer_unittest.cc index 3074e0c..e5d11a2 100644 --- a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer_unittest.cc
@@ -85,6 +85,25 @@ internal::kHistogramServiceWorkerLoadSearch, 0); } + void AssertNoSearchNoSWHistogramsLogged() { + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerFirstContentfulPaintSearch, 0); + histogram_tester().ExpectTotalCount( + internal:: + kHistogramNoServiceWorkerParseStartToFirstContentfulPaintSearch, + 0); + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerFirstMeaningfulPaintSearch, 0); + histogram_tester().ExpectTotalCount( + internal:: + kHistogramNoServiceWorkerParseStartToFirstMeaningfulPaintSearch, + 0); + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerDomContentLoadedSearch, 0); + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerLoadSearch, 0); + } + void InitializeTestPageLoadTiming( page_load_metrics::mojom::PageLoadTiming* timing) { page_load_metrics::InitPageLoadTimingForTest(timing); @@ -106,6 +125,7 @@ AssertNoServiceWorkerHistogramsLogged(); AssertNoInboxHistogramsLogged(); AssertNoSearchHistogramsLogged(); + AssertNoSearchNoSWHistogramsLogged(); } TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoServiceWorker) { @@ -118,6 +138,7 @@ AssertNoServiceWorkerHistogramsLogged(); AssertNoInboxHistogramsLogged(); AssertNoSearchHistogramsLogged(); + AssertNoSearchNoSWHistogramsLogged(); } TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorker) { @@ -166,6 +187,7 @@ AssertNoInboxHistogramsLogged(); AssertNoSearchHistogramsLogged(); + AssertNoSearchNoSWHistogramsLogged(); } TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorkerBackground) { @@ -210,6 +232,7 @@ AssertNoInboxHistogramsLogged(); AssertNoSearchHistogramsLogged(); + AssertNoSearchNoSWHistogramsLogged(); } TEST_F(ServiceWorkerPageLoadMetricsObserverTest, InboxSite) { @@ -311,6 +334,7 @@ internal::kHistogramServiceWorkerParseStart, 1); AssertNoSearchHistogramsLogged(); + AssertNoSearchNoSWHistogramsLogged(); } TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchSite) { @@ -412,4 +436,64 @@ internal::kHistogramServiceWorkerParseStart, 1); AssertNoInboxHistogramsLogged(); + AssertNoSearchNoSWHistogramsLogged(); +} + +TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchNoSWSite) { + page_load_metrics::mojom::PageLoadTiming timing; + InitializeTestPageLoadTiming(&timing); + + NavigateAndCommit(GURL(kSearchTestUrl)); + page_load_metrics::mojom::PageLoadMetadata metadata; + SimulateTimingAndMetadataUpdate(timing, metadata); + + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerFirstContentfulPaintSearch, 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramNoServiceWorkerFirstContentfulPaintSearch, + timing.paint_timing->first_contentful_paint.value().InMilliseconds(), 1); + + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerParseStartToFirstContentfulPaintSearch, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramNoServiceWorkerParseStartToFirstContentfulPaintSearch, + (timing.paint_timing->first_contentful_paint.value() - + timing.parse_timing->parse_start.value()) + .InMilliseconds(), + 1); + + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerFirstMeaningfulPaintSearch, 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramNoServiceWorkerFirstMeaningfulPaintSearch, + timing.paint_timing->first_meaningful_paint.value().InMilliseconds(), 1); + + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerParseStartToFirstMeaningfulPaintSearch, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramNoServiceWorkerParseStartToFirstMeaningfulPaintSearch, + (timing.paint_timing->first_meaningful_paint.value() - + timing.parse_timing->parse_start.value()) + .InMilliseconds(), + 1); + + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerDomContentLoadedSearch, 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramNoServiceWorkerDomContentLoadedSearch, + timing.document_timing->dom_content_loaded_event_start.value() + .InMilliseconds(), + 1); + + histogram_tester().ExpectTotalCount( + internal::kHistogramNoServiceWorkerLoadSearch, 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramNoServiceWorkerLoadSearch, + timing.document_timing->load_event_start.value().InMilliseconds(), 1); + + AssertNoServiceWorkerHistogramsLogged(); + AssertNoInboxHistogramsLogged(); + AssertNoSearchHistogramsLogged(); }
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.cc b/chrome/browser/page_load_metrics/page_load_metrics_util.cc index ab1acc1..e5f54f3c 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc +++ b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
@@ -51,6 +51,15 @@ event.value() <= info.first_background_time.value()); } +bool WasStartedInBackgroundOptionalEventInForeground( + const base::Optional<base::TimeDelta>& event, + const PageLoadExtraInfo& info) { + return !info.started_in_foreground && event && info.first_foreground_time && + info.first_foreground_time.value() <= event.value() && + (!info.first_background_time || + event.value() <= info.first_background_time.value()); +} + PageAbortInfo GetPageAbortInfo(const PageLoadExtraInfo& info) { if (IsBackgroundAbort(info)) { // Though most cases where a tab is backgrounded are user initiated, we
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.h b/chrome/browser/page_load_metrics/page_load_metrics_util.h index a81c0432..d181d62 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_util.h +++ b/chrome/browser/page_load_metrics/page_load_metrics_util.h
@@ -105,6 +105,15 @@ const base::Optional<base::TimeDelta>& event, const PageLoadExtraInfo& info); +// Returns true if: +// - We have timing information for the event. +// - The page load started in the background. +// - Moved to the foreground prior to the event. +// - Not moved back to the background prior to the event. +bool WasStartedInBackgroundOptionalEventInForeground( + const base::Optional<base::TimeDelta>& event, + const PageLoadExtraInfo& info); + PageAbortInfo GetPageAbortInfo(const PageLoadExtraInfo& info); // Get the duration of time that the page spent in the foreground, from
diff --git a/chrome/browser/password_manager/save_password_infobar_delegate_android_unittest.cc b/chrome/browser/password_manager/save_password_infobar_delegate_android_unittest.cc index 0ffd7a9..a664ede5 100644 --- a/chrome/browser/password_manager/save_password_infobar_delegate_android_unittest.cc +++ b/chrome/browser/password_manager/save_password_infobar_delegate_android_unittest.cc
@@ -68,7 +68,7 @@ class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness { public: SavePasswordInfoBarDelegateTest(); - ~SavePasswordInfoBarDelegateTest() override{}; + ~SavePasswordInfoBarDelegateTest() override {} void SetUp() override; void TearDown() override;
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc index 979ccd73..5f20517 100644 --- a/chrome/browser/permissions/permission_manager.cc +++ b/chrome/browser/permissions/permission_manager.cc
@@ -34,9 +34,9 @@ #include "device/vr/features/features.h" #include "ppapi/features/features.h" -#if BUILDFLAG(ENABLE_VR) +#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) #include "chrome/browser/android/vr_shell/vr_tab_helper.h" -#endif // BUILDFLAG(ENABLE_VR) +#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) #if BUILDFLAG(ENABLE_PLUGINS) #include "chrome/browser/plugins/flash_permission_context.h" @@ -288,13 +288,13 @@ content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(render_frame_host); -#if BUILDFLAG(ENABLE_VR) +#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) if (vr_shell::VrTabHelper::IsInVr(web_contents)) { callback.Run( std::vector<ContentSetting>(permissions.size(), CONTENT_SETTING_BLOCK)); return kNoPendingOperation; } -#endif // BUILDFLAG(ENABLE_VR) +#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin();
diff --git a/chrome/browser/permissions/permission_manager_unittest.cc b/chrome/browser/permissions/permission_manager_unittest.cc index 9e8d3858..a24af58 100644 --- a/chrome/browser/permissions/permission_manager_unittest.cc +++ b/chrome/browser/permissions/permission_manager_unittest.cc
@@ -17,18 +17,18 @@ #include "device/vr/features/features.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(ENABLE_VR) +#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) #include "chrome/browser/android/vr_shell/vr_tab_helper.h" -#endif // BUILDFLAG(ENABLE_VR) +#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) using blink::mojom::PermissionStatus; using content::PermissionType; namespace { -#if BUILDFLAG(ENABLE_VR) +#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) int kNoPendingOperation = -1; -#endif // BUILDFLAG(ENABLE_VR) +#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) class PermissionManagerTestingProfile final : public TestingProfile { public: @@ -400,7 +400,7 @@ GetPermissionManager()->UnsubscribePermissionStatusChange(subscription_id); } -#if BUILDFLAG(ENABLE_VR) +#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID) TEST_F(PermissionManagerTest, SuppressPermissionRequests) { content::WebContents* contents = web_contents(); vr_shell::VrTabHelper::CreateForWebContents(contents); @@ -434,4 +434,4 @@ EXPECT_TRUE(callback_called()); EXPECT_EQ(PermissionStatus::GRANTED, callback_result()); } -#endif // BUILDFLAG(ENABLE_VR) +#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 26b93449..231f8e0 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -487,6 +487,8 @@ io_thread_globals->system_request_context->http_auth_handler_factory()); main_context->set_proxy_service(proxy_service()); + main_context->set_network_quality_estimator( + io_thread_globals->network_quality_estimator.get()); // Create a single task runner to use with the CookieStore and ChannelIDStore. scoped_refptr<base::SequencedTaskRunner> cookie_background_task_runner =
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index f0c1f86..41baac05 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc
@@ -1313,7 +1313,7 @@ net::HttpNetworkSession::Context session_context; net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( context, &session_context); - if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { + if (!IsOffTheRecord()) { session_context.socket_performance_watcher_factory = io_thread->globals() ->network_quality_estimator->GetSocketPerformanceWatcherFactory();
diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc index c2b5150..af8a1774 100644 --- a/chrome/browser/resource_coordinator/tab_manager.cc +++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -723,6 +723,12 @@ // Copy over the discard count. WebContentsData::CopyState(old_contents, null_contents); + // First try to fast-kill the process, if it's just running a single tab. + bool fast_shutdown_success = + old_contents->GetRenderProcessHost()->FastShutdownForPageCount(1u); + UMA_HISTOGRAM_BOOLEAN("TabManager.Discarding.DiscardedTabCouldFastShutdown", + fast_shutdown_success); + // Replace the discarded tab with the null version. model->ReplaceWebContentsAt(index, null_contents); // Mark the tab so it will reload when clicked on.
diff --git a/chrome/browser/resource_coordinator/tab_manager.h b/chrome/browser/resource_coordinator/tab_manager.h index 72fa655..4b9af62 100644 --- a/chrome/browser/resource_coordinator/tab_manager.h +++ b/chrome/browser/resource_coordinator/tab_manager.h
@@ -173,6 +173,7 @@ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectVideoTabs); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ReloadDiscardedTabContextMenu); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, TabManagerBasics); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, FastShutdownSingleTabProcess); // The time of the first purging after a renderer is backgrounded. // The initial value was chosen because most of users activate backgrounded
diff --git a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc b/chrome/browser/resource_coordinator/tab_manager_browsertest.cc index 331e240..7a047ea 100644 --- a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
@@ -5,6 +5,7 @@ #include "base/base_switches.h" #include "base/command_line.h" #include "base/memory/memory_pressure_listener.h" +#include "base/test/histogram_tester.h" #include "base/test/simple_test_tick_clock.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" @@ -581,6 +582,50 @@ tsm->CloseAllTabs(); } +IN_PROC_BROWSER_TEST_F(TabManagerTest, FastShutdownSingleTabProcess) { + TabManager* tab_manager = g_browser_process->GetTabManager(); + + // Disable the protection of recent tabs. + tab_manager->set_minimum_protection_time_for_tests( + base::TimeDelta::FromMinutes(0)); + + // Open two tabs. Wait for both of them to load. + content::WindowedNotificationObserver load1( + content::NOTIFICATION_NAV_ENTRY_COMMITTED, + content::NotificationService::AllSources()); + OpenURLParams open1(GURL(chrome::kChromeUIAboutURL), content::Referrer(), + WindowOpenDisposition::CURRENT_TAB, + ui::PAGE_TRANSITION_TYPED, false); + browser()->OpenURL(open1); + load1.Wait(); + + content::WindowedNotificationObserver load2( + content::NOTIFICATION_NAV_ENTRY_COMMITTED, + content::NotificationService::AllSources()); + OpenURLParams open2(GURL(chrome::kChromeUICreditsURL), content::Referrer(), + WindowOpenDisposition::NEW_BACKGROUND_TAB, + ui::PAGE_TRANSITION_TYPED, false); + browser()->OpenURL(open2); + load2.Wait(); + + ASSERT_EQ(2, browser()->tab_strip_model()->count()); + + // The Tab Manager should be able to fast-kill a process for the discarded + // tab, as each tab will be running in separate processes by themselves. + content::WindowedNotificationObserver observer( + content::NOTIFICATION_RENDERER_PROCESS_CLOSED, + content::NotificationService::AllSources()); + + base::HistogramTester tester; + + EXPECT_TRUE(tab_manager->DiscardTabImpl()); + + tester.ExpectUniqueSample( + "TabManager.Discarding.DiscardedTabCouldFastShutdown", true, 1); + + observer.Wait(); +} + } // namespace resource_coordinator #endif // OS_WIN || OS_MAXOSX || OS_LINUX
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js index e3c8e7f4..b3e9555 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
@@ -75,6 +75,27 @@ * is pointed to and covers the case where the accessible text is empty. */ cursors.Cursor = function(node, index) { + // Compensate for specific issues in Blink. + // TODO(dtseng): Pass through affinity; if upstream, skip below. + if (node.role == RoleType.STATIC_TEXT && node.name.length == index) { + // Re-interpret this case as the beginning of the next node. + var nextNode = AutomationUtil.findNextNode( + node, Dir.FORWARD, AutomationPredicate.leafOrStaticText); + + // The exception is when a user types at the end of a line. In that case, + // staying on the current node is appropriate. + if (node && node.nextOnLine && nextNode) { + node = nextNode; + index = 0; + } + } else if (node.role == RoleType.GENERIC_CONTAINER && + node.state.richlyEditable && + (node.firstChild && (node.firstChild.role == RoleType.LINE_BREAK || + node.firstChild.role == RoleType.STATIC_TEXT))) { + // Re-interpret this case as pointing to the text under the div. + node = node.find({ role: RoleType.INLINE_TEXT_BOX }) || node; + } + /** @type {number} @private */ this.index_ = index; /** @type {Array<AutomationNode>} @private */
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js index 4d40067..80c1815 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -227,9 +227,8 @@ if (!root || !root.anchorObject || !root.focusObject) return; - this.range = new cursors.Range( - new cursors.Cursor(root.anchorObject, root.anchorOffset || 0), - new cursors.Cursor(root.focusObject, root.focusOffset || 0)); + this.line_ = new editing.EditableLine( + root.anchorObject, root.anchorOffset, root.focusObject, root.focusOffset); } AutomationRichEditableText.prototype = { @@ -241,64 +240,130 @@ if (!root.anchorObject || !root.focusObject) return; - var cur = new cursors.Range( - new cursors.Cursor(root.anchorObject, root.anchorOffset || 0), - new cursors.Cursor(root.focusObject, root.focusOffset || 0)); - var prev = this.range; + var cur = new editing.EditableLine( + root.anchorObject, root.anchorOffset || 0, + root.focusObject, root.focusOffset || 0); + var prev = this.line_; + this.line_ = cur; - this.range = cur; - - if (prev.start.node == cur.start.node && - prev.end.node == cur.end.node && - cur.start.node == cur.end.node) { - // Plain text: diff the two positions. + if (prev.equals(cur)) { + // Collapsed cursor. this.changed(new cvox.TextChangeEvent( - root.anchorObject.name || '', - root.anchorOffset || 0, - root.focusOffset || 0, + cur.text || '', + cur.startOffset || 0, + cur.endOffset || 0, true)); - var lineIndex = this.getLineIndex(this.start); - var brailleLineStart = this.getLineStart(lineIndex); - var brailleLineEnd = this.getLineEnd(lineIndex); - var buff = new Spannable(this.value); - buff.setSpan(new cvox.ValueSpan(0), brailleLineStart, brailleLineEnd); + var value = cur.value_; + value.setSpan(new cvox.ValueSpan(0), 0, cur.value_.length); + value.setSpan( + new cvox.ValueSelectionSpan(), cur.startOffset, cur.endOffset); + cvox.ChromeVox.braille.write(new cvox.NavBraille({text: value, + startIndex: cur.startOffset, + endIndex: cur.endOffset})); - var selStart = this.start - brailleLineStart; - var selEnd = this.end - brailleLineStart; - buff.setSpan(new cvox.ValueSelectionSpan(), selStart, selEnd); - cvox.ChromeVox.braille.write(new cvox.NavBraille({text: buff, - startIndex: selStart, - endIndex: selEnd})); + // Finally, queue up any text markers/styles at bounds. + var container = cur.lineContainer_; + if (!container) + return; + + if (container.markerTypes) { + // Only consider markers that start or end at the selection bounds. + var markerStartIndex = -1, markerEndIndex = -1; + var localStartOffset = cur.localStartOffset; + for (var i = 0; i < container.markerStarts.length; i++) { + if (container.markerStarts[i] == localStartOffset) { + markerStartIndex = i; + break; + } + } + + var localEndOffset = cur.localEndOffset; + for (var i = 0; i < container.markerEnds.length; i++) { + if (container.markerEnds[i] == localEndOffset) { + markerEndIndex = i; + break; + } + } + + if (markerStartIndex > -1) + this.speakTextMarker_(container.markerTypes[markerStartIndex]); + + if (markerEndIndex > -1) + this.speakTextMarker_(container.markerTypes[markerEndIndex], true); + } + + // Start of the container. + if (cur.containerStartOffset == cur.startOffset) + this.speakTextStyle_(container); + else if (cur.containerEndOffset == cur.endOffset) + this.speakTextStyle_(container, true); + return; - } else { - // Rich text: - // If the position is collapsed, expand to the current line. - var start = cur.start; - var end = cur.end; - if (start.equals(end)) { - start = start.move(Unit.LINE, Movement.BOUND, Dir.BACKWARD); - end = end.move(Unit.LINE, Movement.BOUND, Dir.FORWARD); - } - var range = new cursors.Range(start, end); - var output = new Output().withRichSpeechAndBraille( - range, prev, Output.EventType.NAVIGATE); - - // This position is not describable. - if (!output.hasSpeech) { - cvox.ChromeVox.tts.speak('blank', cvox.QueueMode.CATEGORY_FLUSH); - cvox.ChromeVox.braille.write( - new cvox.NavBraille({text: '', startIndex: 0, endIndex: 0})); - } else { - output.go(); - } } - // Keep the other members in sync for any future editable text base state - // machine changes. - this.value = cur.start.node.name || ''; - this.start = cur.start.index; - this.end = cur.start.index; + // Just output the current line. + if (!cur.lineStart_ || !cur.lineEnd_) + return; + var prevRange = null; + if (prev.lineStart_ && prev.lineEnd_) { + prevRange = new Range( + Cursor.fromNode(prev.lineStart_), Cursor.fromNode(prev.lineEnd_)); + } + + new Output().withRichSpeechAndBraille(new Range( + Cursor.fromNode(cur.lineStart_), Cursor.fromNode(cur.lineEnd_)), + prevRange, + Output.EventType.NAVIGATE).go(); + }, + + /** + * @param {number} markerType + * @param {boolean=} opt_end + * @private + */ + speakTextMarker_: function(markerType, opt_end) { + // TODO(dtseng): Plumb through constants to automation. + var msgs = []; + if (markerType & 1) + msgs.push(opt_end ? 'misspelling_end' : 'misspelling_start'); + if (markerType & 2) + msgs.push(opt_end ? 'grammar_end' : 'grammar_start'); + if (markerType & 4) + msgs.push(opt_end ? 'text_match_end' : 'text_match_start'); + + if (msgs.length) { + msgs.forEach(function(msg) { + cvox.ChromeVox.tts.speak(Msgs.getMsg(msg), + cvox.QueueMode.QUEUE, + cvox.AbstractTts.PERSONALITY_ANNOTATION); + }); + } + }, + + /** + * @param {!AutomationNode} style + * @param {boolean=} opt_end + * @private + */ + speakTextStyle_: function(style, opt_end) { + var msgs = []; + if (style.bold) + msgs.push(opt_end ? 'bold_end' : 'bold_start'); + if (style.italic) + msgs.push(opt_end ? 'italic_end' : 'italic_start'); + if (style.underline) + msgs.push(opt_end ? 'underline_end' : 'underline_start'); + if (style.lineThrough) + msgs.push(opt_end ? 'line_through_end' : 'line_through_start'); + + if (msgs.length) { + msgs.forEach(function(msg) { + cvox.ChromeVox.tts.speak(Msgs.getMsg(msg), + cvox.QueueMode.QUEUE, + cvox.AbstractTts.PERSONALITY_ANNOTATION); + }); + } }, /** @override */ @@ -313,34 +378,22 @@ /** @override */ getLineIndex: function(charIndex) { - var breaks = this.getLineBreaks_(); - var index = 0; - while (index < breaks.length && breaks[index] <= charIndex) - ++index; - return index; + return 0; }, /** @override */ getLineStart: function(lineIndex) { - if (lineIndex == 0) - return 0; - var breaks = this.getLineBreaks_(); - return breaks[lineIndex - 1] || - this.node_.root.focusObject.value.length; + return 0; }, /** @override */ getLineEnd: function(lineIndex) { - var breaks = this.getLineBreaks_(); - var value = this.node_.root.focusObject.name; - if (lineIndex >= breaks.length) - return value.length; - return breaks[lineIndex]; + return this.value.length; }, /** @override */ getLineBreaks_: function() { - return this.node_.root.focusObject.lineStartOffsets || []; + return []; } }; @@ -396,4 +449,149 @@ */ editing.observer_ = new editing.EditingChromeVoxStateObserver(); +/** + * An EditableLine encapsulates all data concerning a line in the automation + * tree necessary to provide output. + * @constructor + */ +editing.EditableLine = function(startNode, startIndex, endNode, endIndex) { + /** @private {!Cursor} */ + this.start_ = new Cursor(startNode, startIndex); + this.start_ = this.start_.deepEquivalent || this.start_; + + /** @private {!Cursor} */ + this.end_ = new Cursor(endNode, endIndex); + this.end_ = this.end_.deepEquivalent || this.end_; + /** @private {number} */ + this.localContainerStartOffset_ = startIndex; + + // Computed members. + /** @private {Spannable} */ + this.value_; + /** @private {AutomationNode} */ + this.lineStart_; + /** @private {AutomationNode} */ + this.lineEnd_; + /** @private {AutomationNode|undefined} */ + this.lineContainer_; + + this.computeLineData_(); +}; + +editing.EditableLine.prototype = { + /** @private */ + computeLineData_: function() { + this.value_ = new Spannable(this.start_.node.name, this.start_); + if (this.start_.node == this.end_.node) + this.value_.setSpan(this.end_, 0, this.start_.node.name.length); + + this.lineStart_ = this.start_.node; + this.lineEnd_ = this.lineStart_; + this.lineContainer_ = this.lineStart_.parent; + + // Annotate each chunk with its associated node. + this.value_.setSpan(this.lineStart_, 0, this.lineStart_.name.length); + + while (this.lineStart_.previousOnLine) { + this.lineStart_ = this.lineStart_.previousOnLine; + var prepend = new Spannable(this.lineStart_.name, this.lineStart_); + prepend.append(this.value_); + this.value_ = prepend; + } + + while (this.lineEnd_.nextOnLine) { + this.lineEnd_ = this.lineEnd_.nextOnLine; + + var annotation = this.lineEnd_; + if (this.lineEnd_ == this.end_.node) + annotation = this.end_; + + this.value_.append(new Spannable(this.lineEnd_.name, annotation)); + } + }, + + /** + * Gets the selection offset based on the text content of this line. + * @return {number} + */ + get startOffset() { + return this.value_.getSpanStart(this.start_) + this.start_.index; + }, + + /** + * Gets the selection offset based on the text content of this line. + * @return {number} + */ + get endOffset() { + return this.value_.getSpanStart(this.end_) + this.end_.index; + }, + + /** + * Gets the selection offset based on the parent's text. + * @return {number} + */ + get localStartOffset() { + return this.startOffset - this.containerStartOffset; + }, + + /** + * Gets the selection offset based on the parent's text. + * @return {number} + */ + get localEndOffset() { + return this.endOffset - this.containerStartOffset; + }, + + /** + * Gets the start offset of the line, relative to the container's text. + * @return {number} + */ + get containerLineStartOffset() { + // When the container start offset is larger, the start offset is usually + // part of a line wrap, so the two offsets differ. + // When the container start offset is smaller, there is usually more line + // content before the container accounted for in start offset. + // Taking the difference either way will give us the offset at which the + // line begins. + return Math.abs(this.localContainerStartOffset_ - this.startOffset); + }, + + /** + * Gets the start offset of the container, relative to the line text content. + * @return {number} + */ + get containerStartOffset() { + return this.value_.getSpanStart(this.lineContainer_.firstChild); + }, + + /** + * Gets the end offset of the container, relative to the line text content. + * @return {number} + */ + get containerEndOffset() { + return this.value_.getSpanEnd(this.lineContainer_.lastChild) - 1; + }, + + /** + * @return {string} The text of this line. + */ + get text() { + return this.value_.toString(); + }, + + /** + * Returns true if |otherLine| surrounds the same line as |this|. Note that + * the contents of the line might be different. + * @return {boolean} + */ + equals: function(otherLine) { + // Equality is intentionally loose here as any of the state nodes can be + // invalidated at any time. + return (otherLine.lineStart_ == this.lineStart_ && + otherLine.lineEnd_ == this.lineEnd_) || + (otherLine.lineContainer_ == this.lineContainer_ && + otherLine.containerLineStartOffset == this.containerLineStartOffset); + } +}; + });
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs index 44188d002..1268152 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
@@ -212,8 +212,7 @@ ]); }); -// Fails flakily, see https://crbug.com/724847. -TEST_F('EditingTest', 'DISABLED_RichTextMoveByLine', function() { +TEST_F('EditingTest', 'RichTextMoveByLine', function() { editing.useRichText = true; var mockFeedback = this.createMockFeedback(); this.runWithLoadedTree(function() {/*! @@ -243,18 +242,132 @@ var input = root.find({role: RoleType.TEXT_FIELD}); var moveByLine = input.doDefault.bind(input); mockFeedback.call(input.focus.bind(input)) + .expectSpeech('Text area') .call(moveByLine) - .expectSpeech('blank') - .expectBraille('') + .expectSpeech('\n') + .expectBraille('\n') .call(moveByLine) .expectSpeech('This is a ', 'test', 'Link', ' of rich text') .expectBraille('This is a test lnk of rich text') .call(moveByLine) - .expectSpeech('blank') - .expectBraille('') + .expectSpeech('\n') + .expectBraille('\n') .call(moveByLine) .expectSpeech('hello', 'Heading 2') .expectBraille('hello h2') .replay(); }); }); + +TEST_F('EditingTest', 'RichTextMoveByCharacter', function() { + editing.useRichText = true; + var mockFeedback = this.createMockFeedback(); + this.runWithLoadedTree(function() {/*! + <div id="go" role="textbox" contenteditable>This <b>is</b> a test.</div> + + <script> + var dir = 'forward'; + var char = 0; + document.getElementById('go').addEventListener('click', function() { + var sel = getSelection(); + sel.modify('move', dir, 'character'); + if (dir == 'forward') + char++; + else + char--; + + if (char == 0) + dir = 'forward'; + if (line == 16) + dir = 'backward'; + }, true); + </script> + */}, function(root) { + var input = root.find({role: RoleType.TEXT_FIELD}); + var moveByChar = input.doDefault.bind(input) + var lineText = 'This is a test.'; + + mockFeedback.call(input.focus.bind(input)) + .expectSpeech(lineText) + .expectSpeech('Text area') + .call(moveByChar) + .expectSpeech('h') + .expectBraille(lineText, { startIndex: 1, endIndex: 1 }) + .call(moveByChar) + .expectSpeech('i') + .expectBraille(lineText, { startIndex: 2, endIndex: 2 }) + .call(moveByChar) + .expectSpeech('s') + .expectBraille(lineText, { startIndex: 3, endIndex: 3 }) + .call(moveByChar) + .expectSpeech(' ') + .expectBraille(lineText, { startIndex: 4, endIndex: 4 }) + + .call(moveByChar) + .expectSpeech('i') + .expectSpeech('Bold start') + .expectBraille(lineText, { startIndex: 5, endIndex: 5 }) + + .call(moveByChar) + .expectSpeech('s') + .expectSpeech('Bold end') + .expectBraille(lineText, { startIndex: 6, endIndex: 6 }) + + .call(moveByChar) + .expectSpeech(' ') + .expectBraille(lineText, { startIndex: 7, endIndex: 7 }) + + .call(moveByChar) + .expectSpeech('a') + .expectBraille(lineText, { startIndex: 8, endIndex: 8 }) + + .call(moveByChar) + .expectSpeech(' ') + .expectBraille(lineText, { startIndex: 9, endIndex: 9 }) + + .replay(); + }); +}); + +// Tests specifically for cursor workarounds. +TEST_F('EditingTest', 'RichTextMoveByCharacterNodeWorkaround', function() { + editing.useRichText = true; + var mockFeedback = this.createMockFeedback(); + this.runWithLoadedTree(function() {/*! + <div id="go" role="textbox" contenteditable>hello <b>world</b></div> + + <script> + document.getElementById('go').addEventListener('click', function() { + var sel = getSelection(); + sel.modify('move', 'forward', 'character'); + }, true); + </script> + */}, function(root) { + var input = root.find({role: RoleType.TEXT_FIELD}); + var moveByChar = input.doDefault.bind(input) + var lineText = 'hello world'; + + mockFeedback.call(input.focus.bind(input)) + .expectSpeech(lineText) + .expectSpeech('Text area') + .call(moveByChar) + .expectSpeech('e') + .expectBraille(lineText, { startIndex: 1, endIndex: 1 }) + .call(moveByChar) + .expectSpeech('l') + .expectBraille(lineText, { startIndex: 2, endIndex: 2 }) + .call(moveByChar) + .expectSpeech('l') + .expectBraille(lineText, { startIndex: 3, endIndex: 3 }) + .call(moveByChar) + .expectSpeech('o') + .expectBraille(lineText, { startIndex: 4, endIndex: 4 }) + .call(moveByChar) + .expectSpeech(' ') + .expectBraille(lineText, { startIndex: 5, endIndex: 5 }) + .call(moveByChar) + .expectSpeech('w') + .expectBraille(lineText, { startIndex: 6, endIndex: 6 }) + .replay(); + }); +});
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js index da10040..6e7ff8d 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -769,7 +769,7 @@ */ get hasSpeech() { for (var i = 0; i < this.speechBuffer_.length; i++) { - if (this.speechBuffer_[i].trim().length) + if (this.speechBuffer_[i].length) return true; } return false;
diff --git a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd index 7ed86e8..6e4b026 100644 --- a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd +++ b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd
@@ -2730,6 +2730,48 @@ <message desc="Description of a command that toggles between 6 and 8 dot braille." name="IDS_CHROMEVOX_TOGGLE_BRAILLE_TABLE"> Toggle between 6 and 8 dot braille </message> + <message desc="Spoken when a user navigates to the beginning of a misspelled word." name="IDS_CHROMEVOX_MISSPELLING_START"> + Misspelling start + </message> + <message desc="Spoken when a user navigates to the end of a misspelled word." name="IDS_CHROMEVOX_MISSPELLING_END"> + Misspelling end + </message> + <message desc="Spoken when a user navigates to the beginning of a grammar error." name="IDS_CHROMEVOX_GRAMMAR_START"> + Grammar error start + </message> + <message desc="Spoken when a user navigates to the end of a grammar error." name="IDS_CHROMEVOX_GRAMMAR_END"> + Grammar error end + </message> + <message desc="Spoken when a user navigates to the beginning of a text match from a find in page." name="IDS_CHROMEVOX_TEXT_MATCH_START"> + Text match start + </message> + <message desc="Spoken when a user navigates to the end of a text match from a find in page." name="IDS_CHROMEVOX_TEXT_MATCH_END"> + Text match end + </message> + <message desc="Spoken when a user navigates to the beginning of bolded text." name="IDS_CHROMEVOX_BOLD_START"> + Bold start + </message> + <message desc="Spoken when a user navigates to the end of bolded text." name="IDS_CHROMEVOX_BOLD_END"> + Bold end + </message> + <message desc="Spoken when a user navigates to the beginning of italic text." name="IDS_CHROMEVOX_ITALIC_START"> + Italic start + </message> + <message desc="Spoken when a user navigates to the end of italic text." name="IDS_CHROMEVOX_ITALIC_END"> + Italic end + </message> + <message desc="Spoken when a user navigates to the beginning of underline text." name="IDS_CHROMEVOX_UNDERLINE_START"> + Underline start + </message> + <message desc="Spoken when a user navigates to the end of underline text." name="IDS_CHROMEVOX_UNDERLINE_END"> + Underline end + </message> + <message desc="Spoken when a user navigates to the beginning of strike through text." name="IDS_CHROMEVOX_LINE_THROUGH_START"> + Strike through start + </message> + <message desc="Spoken when a user navigates to the end of strike through text." name="IDS_CHROMEVOX_LINE_THROUGH_END"> + Strike through end + </message> </messages> </release> </grit>
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js index 2cf83ca..ec90c10 100644 --- a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js +++ b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js
@@ -337,7 +337,6 @@ * @private */ addUtterance_: function(textString, queueMode, properties) { - console.log('speak!'+textString); var callback; if (properties && (properties.startCallback || properties.endCallback)) { var startCallback = properties.startCallback;
diff --git a/chrome/browser/resources/md_bookmarks/command_manager.js b/chrome/browser/resources/md_bookmarks/command_manager.js index 8960d0a..f21578a 100644 --- a/chrome/browser/resources/md_bookmarks/command_manager.js +++ b/chrome/browser/resources/md_bookmarks/command_manager.js
@@ -192,20 +192,20 @@ break; case Command.DELETE: var idList = Array.from(this.minimizeDeletionSet_(itemIds)); - var labelPromise; - if (idList.length == 1) { - // TODO(calamity): fold this separate label into - // 'toastItemsDeleted'. - labelPromise = Promise.resolve(loadTimeData.getStringF( - 'toastItemDeleted', this.getState().nodes[idList[0]].title)); - } else { - labelPromise = cr.sendWithPromise( - 'getPluralString', 'toastItemsDeleted', idList.length); - } + var title = this.getState().nodes[idList[0]].title; + var labelPromise = cr.sendWithPromise( + 'getPluralString', 'toastItemsDeleted', idList.length); chrome.bookmarkManagerPrivate.removeTrees(idList, function() { labelPromise.then(function(label) { - bookmarks.ToastManager.getInstance().show(label, true); - }); + var pieces = loadTimeData.getSubstitutedStringPieces(label, title) + .map(function(p) { + // Make the bookmark name collapsible. + p.collapsible = !!p.arg; + return p; + }); + bookmarks.ToastManager.getInstance().showForStringPieces( + pieces, true); + }.bind(this)); }.bind(this)); break; case Command.UNDO:
diff --git a/chrome/browser/resources/md_bookmarks/toast_manager.html b/chrome/browser/resources/md_bookmarks/toast_manager.html index bc3a643..9a0d3e6 100644 --- a/chrome/browser/resources/md_bookmarks/toast_manager.html +++ b/chrome/browser/resources/md_bookmarks/toast_manager.html
@@ -7,6 +7,7 @@ <template> <style include="shared-style"> #content { + display: flex; flex: 1; margin-right: 32px; overflow: hidden; @@ -23,6 +24,16 @@ padding: 8px; } + .collapsible { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + } + + span { + white-space: pre; + } + #toast { align-items: center; background-color: #323232;
diff --git a/chrome/browser/resources/md_bookmarks/toast_manager.js b/chrome/browser/resources/md_bookmarks/toast_manager.js index dabd5885..c0e72fc 100644 --- a/chrome/browser/resources/md_bookmarks/toast_manager.js +++ b/chrome/browser/resources/md_bookmarks/toast_manager.js
@@ -51,9 +51,39 @@ * @param {boolean} showUndo Whether the undo button should be shown. */ show: function(label, showUndo) { - this.open_ = true; - // TODO(calamity): Support collapsing of long bookmark names in label. this.$.content.textContent = label; + this.showInternal_(showUndo); + }, + + /** + * Shows the toast, making certain text fragments collapsible. + * @param {!Array<!{value: string, collapsible: boolean}>} pieces + * @param {boolean} showUndo Whether the undo button should be shown. + */ + showForStringPieces: function(pieces, showUndo) { + var content = this.$.content; + content.textContent = ''; + pieces.forEach(function(p) { + if (p.value.length == 0) + return; + + var span = document.createElement('span'); + span.textContent = p.value; + if (p.collapsible) + span.classList.add('collapsible'); + + content.appendChild(span); + }); + + this.showInternal_(showUndo); + }, + + /** + * @param {boolean} showUndo Whether the undo button should be shown. + * @private + */ + showInternal_: function(showUndo) { + this.open_ = true; this.showUndo_ = showUndo; if (!this.duration)
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js index f7c8325..155bc820 100644 --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -642,7 +642,8 @@ return forcedMode; var allCastModes = this.allSinks.reduce(function(castModesSoFar, sink) { - return castModesSoFar | sink.castModes; + // Ignore pseudo sinks in the cast mode computation. + return castModesSoFar | (sink.isPseudoSink ? 0 : sink.castModes); }, 0); // This checks whether |castModes| does not consist of exactly 1 cast mode.
diff --git a/chrome/browser/resources/net_internals/quic_view.html b/chrome/browser/resources/net_internals/quic_view.html index f116c2b..887adb9 100644 --- a/chrome/browser/resources/net_internals/quic_view.html +++ b/chrome/browser/resources/net_internals/quic_view.html
@@ -95,6 +95,9 @@ </tr><tr> <td>Origins To Force QUIC On</td> <td><span jscontent="$this.origins_to_force_quic_on || ''"></span></td> + </tr><tr> + <td>Server Push Cancellation</td> + <td><span jscontent="!!$this.server_push_cancellation"></span></td> </tr> </tbody> </table>
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js index ccb3d65d..7aa5974e 100644 --- a/chrome/browser/resources/print_preview/data/destination_store.js +++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -663,6 +663,7 @@ * destination. * @param {string} extensionName Extension name associated with this * destination. + * @return {boolean} Whether capabilities fetch was successfully started. * @private */ fetchPreselectedDestination_: function( @@ -702,11 +703,15 @@ name, false /*isRecent*/, print_preview.DestinationConnectionStatus.ONLINE); - this.selectedDestination_.capabilities = capabilities; - cr.dispatchSimpleEvent( - this, - DestinationStore.EventType.CACHED_SELECTED_DESTINATION_INFO_READY); + if (capabilities) { + this.selectedDestination_.capabilities = capabilities; + + cr.dispatchSimpleEvent( + this, + DestinationStore.EventType + .CACHED_SELECTED_DESTINATION_INFO_READY); + } return true; }
diff --git a/chrome/browser/safe_browsing/ui_manager_unittest.cc b/chrome/browser/safe_browsing/ui_manager_unittest.cc index c200eb4..df62feb9 100644 --- a/chrome/browser/safe_browsing/ui_manager_unittest.cc +++ b/chrome/browser/safe_browsing/ui_manager_unittest.cc
@@ -70,7 +70,7 @@ public: SafeBrowsingUIManagerTest() : ui_manager_(new SafeBrowsingUIManager(NULL)) {} - ~SafeBrowsingUIManagerTest() override{}; + ~SafeBrowsingUIManagerTest() override {} void SetUp() override { SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
diff --git a/chrome/browser/search/suggestions/image_fetcher_impl_browsertest.cc b/chrome/browser/search/suggestions/image_fetcher_impl_browsertest.cc index 5ac7e08..1d830578 100644 --- a/chrome/browser/search/suggestions/image_fetcher_impl_browsertest.cc +++ b/chrome/browser/search/suggestions/image_fetcher_impl_browsertest.cc
@@ -42,7 +42,7 @@ TestImageFetcherDelegate() : num_delegate_valid_called_(0), num_delegate_null_called_(0) {} - ~TestImageFetcherDelegate() override{}; + ~TestImageFetcherDelegate() override {} // Perform additional tasks when an image has been fetched. void OnImageFetched(const std::string& id, const gfx::Image& image) override {
diff --git a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc index 8af6de1c..07981b7 100644 --- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc +++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -921,7 +921,7 @@ class SecurityStateLoadingTest : public SecurityStateTabHelperTest { public: SecurityStateLoadingTest() : SecurityStateTabHelperTest() {} - ~SecurityStateLoadingTest() override{}; + ~SecurityStateLoadingTest() override {} protected: void SetUpOnMainThread() override {
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 0c512601..8892be7c 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1735,8 +1735,6 @@ "views/conflicting_module_view_win.cc", "views/conflicting_module_view_win.h", "views/constrained_web_dialog_delegate_views.cc", - "views/create_application_shortcut_view.cc", - "views/create_application_shortcut_view.h", "views/download/download_feedback_dialog_view.cc", "views/download/download_feedback_dialog_view.h", "views/download/download_in_progress_dialog_view.cc", @@ -1946,10 +1944,13 @@ ] } - # TODO(ellyjones): Mus is not supported on Mac (there is no ui::Window - # apart from aura::Window, which is also not supported). if (!is_mac) { sources += [ + "views/create_application_shortcut_view.cc", + "views/create_application_shortcut_view.h", + + # TODO(ellyjones): Mus is not supported on Mac (there is no ui::Window + # apart from aura::Window, which is also not supported). "views/ime_driver/ime_driver_mus.cc", "views/ime_driver/ime_driver_mus.h", "views/ime_driver/input_method_bridge_chromeos.cc", @@ -2678,7 +2679,6 @@ "cocoa/content_settings/cookie_tree_node.mm", "cocoa/content_settings/cookies_tree_controller_bridge.h", "cocoa/content_settings/cookies_tree_controller_bridge.mm", - "cocoa/create_application_shortcut_cocoa.mm", "cocoa/create_native_web_modal_manager_cocoa.mm", "cocoa/custom_frame_view.h", "cocoa/custom_frame_view.mm",
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_util_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_util_chromeos_unittest.cc index ac60dd9..ca44d76 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_util_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_util_chromeos_unittest.cc
@@ -53,7 +53,7 @@ class MultiUserUtilTest : public AshTestBase { public: MultiUserUtilTest() {} - ~MultiUserUtilTest() override{}; + ~MultiUserUtilTest() override {} void SetUp() override { AshTestBase::SetUp();
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index 73cbbbd..f48b1f1 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
@@ -1294,7 +1294,7 @@ class TestWindowObserver : public aura::WindowObserver { public: TestWindowObserver(): resize_calls_(0) {} - ~TestWindowObserver() override{}; + ~TestWindowObserver() override {} void OnWindowBoundsChanged(aura::Window* window, const gfx::Rect& old_bounds,
diff --git a/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc index 8c53f24f..4242fc2 100644 --- a/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc
@@ -35,7 +35,7 @@ container_view_(web_contents->GetNativeView()) {} void Hide() override {} - void ViewDestroyed() override{}; + void ViewDestroyed() override {} void SetSelectionAtPoint(const gfx::Point& point) override {} bool AcceptSelectedLine() override { return true; } void SelectionCleared() override {}
diff --git a/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc b/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc index 34c55bf1..fdc9a99 100644 --- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc +++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc
@@ -120,7 +120,7 @@ private: class TestSaveCardBubbleView : public SaveCardBubbleView { - void Hide() override{}; + void Hide() override {} }; class SaveCardBubbleTestBrowserWindow : public TestBrowserWindow {
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm index f4bf025e..69eef30 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
@@ -56,7 +56,7 @@ class TestBookmarkBubbleObserver : public BookmarkBubbleObserver { public: TestBookmarkBubbleObserver() {} - ~TestBookmarkBubbleObserver() override{}; + ~TestBookmarkBubbleObserver() override {} // bookmarks::BookmarkBubbleObserver. void OnBookmarkBubbleShown(const BookmarkNode* node) override {
diff --git a/chrome/browser/ui/cocoa/create_application_shortcut_cocoa.mm b/chrome/browser/ui/cocoa/create_application_shortcut_cocoa.mm deleted file mode 100644 index a46a263a..0000000 --- a/chrome/browser/ui/cocoa/create_application_shortcut_cocoa.mm +++ /dev/null
@@ -1,135 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import <Cocoa/Cocoa.h> - -#import "base/mac/scoped_nsobject.h" -#import "chrome/browser/web_applications/web_app_mac.h" -#import "ui/base/l10n/l10n_util_mac.h" -#include "base/bind.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/cocoa/key_equivalent_constants.h" -#include "chrome/grit/generated_resources.h" -#include "components/strings/grit/components_strings.h" -#include "ui/gfx/image/image.h" - -@interface CrCreateAppShortcutCheckboxObserver : NSObject { - @private - NSButton* checkbox_; - NSButton* continueButton_; -} - -- (id)initWithCheckbox:(NSButton*)checkbox - continueButton:(NSButton*)continueButton; -- (void)startObserving; -- (void)stopObserving; -@end - -@implementation CrCreateAppShortcutCheckboxObserver - -- (id)initWithCheckbox:(NSButton*)checkbox - continueButton:(NSButton*)continueButton { - if ((self = [super init])) { - checkbox_ = checkbox; - continueButton_ = continueButton; - } - return self; -} - -- (void)startObserving { - [checkbox_ addObserver:self forKeyPath:@"cell.state" options:0 context:nil]; -} - -- (void)stopObserving { - [checkbox_ removeObserver:self forKeyPath:@"cell.state"]; -} - -- (void)observeValueForKeyPath:(NSString*)keyPath - ofObject:(id)object - change:(NSDictionary*)change - context:(void*)context { - [continueButton_ setEnabled:([checkbox_ state] == NSOnState)]; -} - -@end - -namespace { - -// Called when the app's ShortcutInfo (with icon) is loaded when creating app -// shortcuts. -void CreateAppShortcutInfoLoaded( - Profile* profile, - const extensions::Extension* app, - const base::Callback<void(bool)>& close_callback, - std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { - base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); - - NSButton* continue_button = [alert - addButtonWithTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_COMMIT)]; - [continue_button setKeyEquivalent:kKeyEquivalentReturn]; - - NSButton* cancel_button = - [alert addButtonWithTitle:l10n_util::GetNSString(IDS_CANCEL)]; - [cancel_button setKeyEquivalent:kKeyEquivalentEscape]; - - [alert setMessageText:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_LABEL)]; - [alert setAlertStyle:NSInformationalAlertStyle]; - - base::scoped_nsobject<NSButton> application_folder_checkbox( - [[NSButton alloc] initWithFrame:NSZeroRect]); - [application_folder_checkbox setButtonType:NSSwitchButton]; - [application_folder_checkbox - setTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_APP_FOLDER_CHKBOX)]; - [application_folder_checkbox setState:NSOnState]; - [application_folder_checkbox sizeToFit]; - - base::scoped_nsobject<CrCreateAppShortcutCheckboxObserver> checkbox_observer( - [[CrCreateAppShortcutCheckboxObserver alloc] - initWithCheckbox:application_folder_checkbox - continueButton:continue_button]); - [checkbox_observer startObserving]; - - [alert setAccessoryView:application_folder_checkbox]; - - const int kIconPreviewSizePixels = 128; - const int kIconPreviewTargetSize = 64; - const gfx::Image* icon = shortcut_info->favicon.GetBest( - kIconPreviewSizePixels, kIconPreviewSizePixels); - - if (icon && !icon->IsEmpty()) { - NSImage* icon_image = icon->ToNSImage(); - [icon_image - setSize:NSMakeSize(kIconPreviewTargetSize, kIconPreviewTargetSize)]; - [alert setIcon:icon_image]; - } - - bool dialog_accepted = false; - if ([alert runModal] == NSAlertFirstButtonReturn && - [application_folder_checkbox state] == NSOnState) { - dialog_accepted = true; - CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, - web_app::ShortcutLocations(), profile, app); - } - - [checkbox_observer stopObserving]; - - if (!close_callback.is_null()) - close_callback.Run(dialog_accepted); -} - -} // namespace - -namespace chrome { - -void ShowCreateChromeAppShortcutsDialog( - gfx::NativeWindow /*parent_window*/, - Profile* profile, - const extensions::Extension* app, - const base::Callback<void(bool)>& close_callback) { - web_app::GetShortcutInfoForApp( - app, profile, - base::Bind(&CreateAppShortcutInfoLoaded, profile, app, close_callback)); -} - -} // namespace chrome
diff --git a/chrome/browser/ui/views/tabs/tab_unittest.cc b/chrome/browser/ui/views/tabs/tab_unittest.cc index c1ef06e8..c751379 100644 --- a/chrome/browser/ui/views/tabs/tab_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -78,7 +78,7 @@ return IDR_THEME_TAB_BACKGROUND; } void UpdateTabAccessibilityState(const Tab* tab, - ui::AXNodeData* node_data) override{}; + ui::AXNodeData* node_data) override {} base::string16 GetAccessibleTabName(const Tab* tab) const override { return base::string16(); }
diff --git a/chrome/browser/ui/webui/OWNERS b/chrome/browser/ui/webui/OWNERS index 38e940d..731bdc43 100644 --- a/chrome/browser/ui/webui/OWNERS +++ b/chrome/browser/ui/webui/OWNERS
@@ -5,13 +5,6 @@ per-file inspect_ui*=dgozman@chromium.org per-file inspect_ui*=pfeldman@chromium.org -# chrome://history is going through a lot of changes right now; make sure to -# talk to one of the listed OWNERS before changing the pre-Material Design UI. -per-file *history*=set noparent -per-file *history*=calamity@chromium.org -per-file *history*=dbeam@chromium.org -per-file *history*=tsergeant@chromium.org - per-file md_history_ui*=calamity@chromium.org per-file md_history_ui*=tsergeant@chromium.org
diff --git a/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc index 43281140..e7fc1ac 100644 --- a/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc +++ b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
@@ -89,8 +89,6 @@ AddLocalizedString(source, "title", IDS_MD_BOOKMARK_MANAGER_TITLE); AddLocalizedString(source, "toastFolderSorted", IDS_MD_BOOKMARK_MANAGER_TOAST_FOLDER_SORTED); - AddLocalizedString(source, "toastItemDeleted", - IDS_MD_BOOKMARK_MANAGER_TOAST_ITEM_DELETED); AddLocalizedString(source, "toastUrlCopied", IDS_MD_BOOKMARK_MANAGER_TOAST_URL_COPIED); AddLocalizedString(source, "undo", IDS_BOOKMARK_BAR_UNDO);
diff --git a/chrome/browser/ui/webui/system_info_ui.cc b/chrome/browser/ui/webui/system_info_ui.cc index ebf7121c..ac2190e 100644 --- a/chrome/browser/ui/webui/system_info_ui.cc +++ b/chrome/browser/ui/webui/system_info_ui.cc
@@ -23,6 +23,7 @@ #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" +#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/url_constants.h" @@ -42,7 +43,6 @@ using content::WebContents; using content::WebUIMessageHandler; using system_logs::SystemLogsResponse; -using system_logs::AboutSystemLogsFetcher; class SystemInfoUIHTMLSource : public content::URLDataSource{ public: @@ -116,7 +116,8 @@ path_ = path; callback_ = callback; - AboutSystemLogsFetcher* fetcher = new AboutSystemLogsFetcher(); + system_logs::SystemLogsFetcher* fetcher = + system_logs::BuildAboutSystemLogsFetcher(); fetcher->Fetch(base::Bind(&SystemInfoUIHTMLSource::SysInfoComplete, weak_ptr_factory_.GetWeakPtr())); }
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 178a16b90..b51db20 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -1113,3 +1113,20 @@ } // namespace internals } // namespace web_app + +namespace chrome { + +void ShowCreateChromeAppShortcutsDialog( + gfx::NativeWindow /*parent_window*/, + Profile* profile, + const extensions::Extension* app, + const base::Callback<void(bool)>& close_callback) { + // On Mac, the Applications folder is the only option, so don't bother asking + // the user anything. Just create shortcuts. + CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, + web_app::ShortcutLocations(), profile, app); + if (!close_callback.is_null()) + close_callback.Run(true); +} + +} // namespace chrome
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index e5446be..e696257 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -269,7 +269,7 @@ // Enables the pref service. See https://crbug.com/654988. const base::Feature kPrefService{"PrefService", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; #if defined(OS_CHROMEOS) // The lock screen will be preloaded so it is instantly available when the user
diff --git a/chrome/common/extensions/api/automation.idl b/chrome/common/extensions/api/automation.idl index 56b61ba..4b8b0e7 100644 --- a/chrome/common/extensions/api/automation.idl +++ b/chrome/common/extensions/api/automation.idl
@@ -668,6 +668,18 @@ // The RGBA color of an input element whose value is a color. long? colorValue; + // Indicates node text is bold. + boolean bold; + + // Indicates node text is italic. + boolean italic; + + // Indicates node text is underline. + boolean underline; + + // Indicates node text is line through. + boolean lineThrough; + // // Walking the tree. //
diff --git a/chrome/gpu/BUILD.gn b/chrome/gpu/BUILD.gn index 35059ac..ee90a75 100644 --- a/chrome/gpu/BUILD.gn +++ b/chrome/gpu/BUILD.gn
@@ -20,11 +20,11 @@ if (is_chromeos) { deps += [ "//components/arc:arc_bindings" ] sources += [ - "arc_gpu_video_decode_accelerator.cc", - "arc_gpu_video_decode_accelerator.h", - "arc_video_accelerator.h", - "gpu_arc_video_service.cc", - "gpu_arc_video_service.h", + "arc_video_decode_accelerator.h", + "chrome_arc_video_decode_accelerator.cc", + "chrome_arc_video_decode_accelerator.h", + "gpu_arc_video_decode_accelerator.cc", + "gpu_arc_video_decode_accelerator.h", ] } }
diff --git a/chrome/gpu/arc_video_accelerator.h b/chrome/gpu/arc_video_decode_accelerator.h similarity index 87% rename from chrome/gpu/arc_video_accelerator.h rename to chrome/gpu/arc_video_decode_accelerator.h index 46b3420d..b8275aac 100644 --- a/chrome/gpu/arc_video_accelerator.h +++ b/chrome/gpu/arc_video_decode_accelerator.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ -#define CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ +#ifndef CHROME_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ +#define CHROME_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ #include <vector> @@ -20,7 +20,7 @@ HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, // The following formats are not defined in Android, but used in - // ArcVideoAccelerator to identify the input format. + // ArcVideoDecodeAccelerator to identify the input format. HAL_PIXEL_FORMAT_H264 = 0x34363248, HAL_PIXEL_FORMAT_VP8 = 0x00385056, HAL_PIXEL_FORMAT_VP9 = 0x00395056, @@ -51,10 +51,10 @@ uint32_t crop_height = 0; }; -// The IPC interface between Android and Chromium for video decoding and -// encoding. Input buffers are sent from Android side and get processed in -// Chromium and the output buffers are returned back to Android side. -class ArcVideoAccelerator { +// The IPC interface between Android and Chromium for video decoding. Input +// buffers are sent from Android side and get processed in Chromium and the +// output buffers are returned back to Android side. +class ArcVideoDecodeAccelerator { public: enum Result { // Note: this enum is used for UMA reporting. The existing values should not @@ -70,20 +70,14 @@ }; struct Config { - enum DeviceType { - DEVICE_ENCODER = 0, - DEVICE_DECODER = 1, - }; - - DeviceType device_type = DEVICE_DECODER; size_t num_input_buffers = 0; uint32_t input_pixel_format = 0; // TODO(owenlin): Add output_pixel_format. For now only the native pixel // format of each VDA on Chromium is supported. }; - // The callbacks of the ArcVideoAccelerator. The user of this class should - // implement this interface. + // The callbacks of the ArcVideoDecodeAccelerator. The user of this class + // should implement this interface. class Client { public: virtual ~Client() {} @@ -112,7 +106,7 @@ virtual void OnFlushDone() = 0; }; - // Initializes the ArcVideoAccelerator with specific configuration. This + // Initializes the ArcVideoDecodeAccelerator with specific configuration. This // must be called before any other methods. This call is synchronous and // returns SUCCESS iff initialization is successful. virtual Result Initialize(const Config& config, Client* client) = 0; @@ -159,10 +153,10 @@ // called. virtual void Flush() = 0; - virtual ~ArcVideoAccelerator() {} + virtual ~ArcVideoDecodeAccelerator() {} }; } // namespace arc } // namespace chromeos -#endif // CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ +#endif // CHROME_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_
diff --git a/chrome/gpu/arc_gpu_video_decode_accelerator.cc b/chrome/gpu/chrome_arc_video_decode_accelerator.cc similarity index 78% rename from chrome/gpu/arc_gpu_video_decode_accelerator.cc rename to chrome/gpu/chrome_arc_video_decode_accelerator.cc index 9abb435..6099ba77 100644 --- a/chrome/gpu/arc_gpu_video_decode_accelerator.cc +++ b/chrome/gpu/chrome_arc_video_decode_accelerator.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/gpu/arc_gpu_video_decode_accelerator.h" +#include "chrome/gpu/chrome_arc_video_decode_accelerator.h" #include "base/callback_helpers.h" #include "base/logging.h" @@ -29,9 +29,9 @@ } // anonymous namespace -int ArcGpuVideoDecodeAccelerator::client_count_ = 0; +int ChromeArcVideoDecodeAccelerator::client_count_ = 0; -ArcGpuVideoDecodeAccelerator::InputRecord::InputRecord( +ChromeArcVideoDecodeAccelerator::InputRecord::InputRecord( int32_t bitstream_buffer_id, uint32_t buffer_index, int64_t timestamp) @@ -39,21 +39,22 @@ buffer_index(buffer_index), timestamp(timestamp) {} -ArcGpuVideoDecodeAccelerator::InputBufferInfo::InputBufferInfo() = default; +ChromeArcVideoDecodeAccelerator::InputBufferInfo::InputBufferInfo() = default; -ArcGpuVideoDecodeAccelerator::InputBufferInfo::InputBufferInfo( +ChromeArcVideoDecodeAccelerator::InputBufferInfo::InputBufferInfo( InputBufferInfo&& other) = default; -ArcGpuVideoDecodeAccelerator::InputBufferInfo::~InputBufferInfo() = default; +ChromeArcVideoDecodeAccelerator::InputBufferInfo::~InputBufferInfo() = default; -ArcGpuVideoDecodeAccelerator::OutputBufferInfo::OutputBufferInfo() = default; +ChromeArcVideoDecodeAccelerator::OutputBufferInfo::OutputBufferInfo() = default; -ArcGpuVideoDecodeAccelerator::OutputBufferInfo::OutputBufferInfo( +ChromeArcVideoDecodeAccelerator::OutputBufferInfo::OutputBufferInfo( OutputBufferInfo&& other) = default; -ArcGpuVideoDecodeAccelerator::OutputBufferInfo::~OutputBufferInfo() = default; +ChromeArcVideoDecodeAccelerator::OutputBufferInfo::~OutputBufferInfo() = + default; -ArcGpuVideoDecodeAccelerator::ArcGpuVideoDecodeAccelerator( +ChromeArcVideoDecodeAccelerator::ChromeArcVideoDecodeAccelerator( const gpu::GpuPreferences& gpu_preferences) : arc_client_(nullptr), next_bitstream_buffer_id_(0), @@ -62,33 +63,31 @@ requested_num_of_output_buffers_(0), gpu_preferences_(gpu_preferences) {} -ArcGpuVideoDecodeAccelerator::~ArcGpuVideoDecodeAccelerator() { - DCHECK(thread_checker_.CalledOnValidThread()); +ChromeArcVideoDecodeAccelerator::~ChromeArcVideoDecodeAccelerator() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (vda_) { client_count_--; } } -ArcVideoAccelerator::Result ArcGpuVideoDecodeAccelerator::Initialize( +ArcVideoDecodeAccelerator::Result ChromeArcVideoDecodeAccelerator::Initialize( const Config& config, - ArcVideoAccelerator::Client* client) { + ArcVideoDecodeAccelerator::Client* client) { auto result = InitializeTask(config, client); // Report initialization status to UMA. UMA_HISTOGRAM_ENUMERATION( - "Media.ArcGpuVideoDecodeAccelerator.InitializeResult", result, + "Media.ChromeArcVideoDecodeAccelerator.InitializeResult", result, RESULT_MAX); return result; } -ArcVideoAccelerator::Result ArcGpuVideoDecodeAccelerator::InitializeTask( +ArcVideoDecodeAccelerator::Result +ChromeArcVideoDecodeAccelerator::InitializeTask( const Config& config, - ArcVideoAccelerator::Client* client) { - DVLOG(5) << "Initialize(device=" << config.device_type - << ", input_pixel_format=" << config.input_pixel_format + ArcVideoDecodeAccelerator::Client* client) { + DVLOG(5) << "Initialize(input_pixel_format=" << config.input_pixel_format << ", num_input_buffers=" << config.num_input_buffers << ")"; - DCHECK(thread_checker_.CalledOnValidThread()); - if (config.device_type != Config::DEVICE_DECODER) - return INVALID_ARGUMENT; + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(client); if (arc_client_) { @@ -137,15 +136,15 @@ } client_count_++; - DVLOG(5) << "Number of concurrent ArcVideoAccelerator clients: " + DVLOG(5) << "Number of concurrent ArcVideoDecodeAccelerator clients: " << client_count_; return SUCCESS; } -void ArcGpuVideoDecodeAccelerator::SetNumberOfOutputBuffers(size_t number) { +void ChromeArcVideoDecodeAccelerator::SetNumberOfOutputBuffers(size_t number) { DVLOG(5) << "SetNumberOfOutputBuffers(" << number << ")"; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!vda_) { DLOG(ERROR) << "VDA not initialized"; return; @@ -169,14 +168,14 @@ buffers_pending_import_.resize(number); } -void ArcGpuVideoDecodeAccelerator::BindSharedMemory(PortType port, - uint32_t index, - base::ScopedFD ashmem_fd, - off_t offset, - size_t length) { +void ChromeArcVideoDecodeAccelerator::BindSharedMemory(PortType port, + uint32_t index, + base::ScopedFD ashmem_fd, + off_t offset, + size_t length) { DVLOG(5) << "ArcGVDA::BindSharedMemory, offset: " << offset << ", length: " << length; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!vda_) { DLOG(ERROR) << "VDA not initialized"; return; @@ -197,7 +196,7 @@ input_info->length = length; } -bool ArcGpuVideoDecodeAccelerator::VerifyDmabuf( +bool ChromeArcVideoDecodeAccelerator::VerifyDmabuf( const base::ScopedFD& dmabuf_fd, const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>& dmabuf_planes) const { @@ -236,12 +235,12 @@ return true; } -void ArcGpuVideoDecodeAccelerator::BindDmabuf( +void ChromeArcVideoDecodeAccelerator::BindDmabuf( PortType port, uint32_t index, base::ScopedFD dmabuf_fd, const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>& dmabuf_planes) { - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!vda_) { DLOG(ERROR) << "VDA not initialized"; @@ -267,13 +266,14 @@ info.planes = dmabuf_planes; } -void ArcGpuVideoDecodeAccelerator::UseBuffer(PortType port, - uint32_t index, - const BufferMetadata& metadata) { +void ChromeArcVideoDecodeAccelerator::UseBuffer( + PortType port, + uint32_t index, + const BufferMetadata& metadata) { DVLOG(5) << "UseBuffer(port=" << port << ", index=" << index << ", metadata=(bytes_used=" << metadata.bytes_used << ", timestamp=" << metadata.timestamp << ")"; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!vda_) { DLOG(ERROR) << "VDA not initialized"; return; @@ -334,8 +334,8 @@ } } -void ArcGpuVideoDecodeAccelerator::Reset() { - DCHECK(thread_checker_.CalledOnValidThread()); +void ChromeArcVideoDecodeAccelerator::Reset() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!vda_) { DLOG(ERROR) << "VDA not initialized"; return; @@ -343,8 +343,8 @@ vda_->Reset(); } -void ArcGpuVideoDecodeAccelerator::Flush() { - DCHECK(thread_checker_.CalledOnValidThread()); +void ChromeArcVideoDecodeAccelerator::Flush() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!vda_) { DLOG(ERROR) << "VDA not initialized"; return; @@ -352,7 +352,7 @@ vda_->Flush(); } -void ArcGpuVideoDecodeAccelerator::ProvidePictureBuffers( +void ChromeArcVideoDecodeAccelerator::ProvidePictureBuffers( uint32_t requested_num_of_buffers, media::VideoPixelFormat output_pixel_format, uint32_t textures_per_buffer, @@ -361,7 +361,7 @@ DVLOG(5) << "ProvidePictureBuffers(" << "requested_num_of_buffers=" << requested_num_of_buffers << ", dimensions=" << dimensions.ToString() << ")"; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); coded_size_ = dimensions; // By default, use an empty rect to indicate the visible rectangle is not @@ -380,7 +380,7 @@ NotifyOutputFormatChanged(); } -void ArcGpuVideoDecodeAccelerator::NotifyOutputFormatChanged() { +void ChromeArcVideoDecodeAccelerator::NotifyOutputFormatChanged() { VideoFormat video_format; switch (output_pixel_format_) { case media::PIXEL_FORMAT_I420: @@ -411,15 +411,16 @@ arc_client_->OnOutputFormatChanged(video_format); } -void ArcGpuVideoDecodeAccelerator::DismissPictureBuffer( +void ChromeArcVideoDecodeAccelerator::DismissPictureBuffer( int32_t picture_buffer) { // no-op } -void ArcGpuVideoDecodeAccelerator::PictureReady(const media::Picture& picture) { +void ChromeArcVideoDecodeAccelerator::PictureReady( + const media::Picture& picture) { DVLOG(5) << "PictureReady(picture_buffer_id=" << picture.picture_buffer_id() << ", bitstream_buffer_id=" << picture.bitstream_buffer_id(); - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); // Handle visible size change. if (visible_rect_ != picture.visible_rect()) { @@ -442,10 +443,10 @@ arc_client_->OnBufferDone(PORT_OUTPUT, picture.picture_buffer_id(), metadata); } -void ArcGpuVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer( +void ChromeArcVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer( int32_t bitstream_buffer_id) { DVLOG(5) << "NotifyEndOfBitstreamBuffer(" << bitstream_buffer_id << ")"; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); InputRecord* input_record = FindInputRecord(bitstream_buffer_id); if (input_record == nullptr) { arc_client_->OnError(PLATFORM_FAILURE); @@ -455,41 +456,41 @@ BufferMetadata()); } -void ArcGpuVideoDecodeAccelerator::NotifyFlushDone() { - DCHECK(thread_checker_.CalledOnValidThread()); +void ChromeArcVideoDecodeAccelerator::NotifyFlushDone() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); arc_client_->OnFlushDone(); } -void ArcGpuVideoDecodeAccelerator::NotifyResetDone() { - DCHECK(thread_checker_.CalledOnValidThread()); +void ChromeArcVideoDecodeAccelerator::NotifyResetDone() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); arc_client_->OnResetDone(); } -static ArcVideoAccelerator::Result ConvertErrorCode( +static ArcVideoDecodeAccelerator::Result ConvertErrorCode( media::VideoDecodeAccelerator::Error error) { switch (error) { case media::VideoDecodeAccelerator::ILLEGAL_STATE: - return ArcVideoAccelerator::ILLEGAL_STATE; + return ArcVideoDecodeAccelerator::ILLEGAL_STATE; case media::VideoDecodeAccelerator::INVALID_ARGUMENT: - return ArcVideoAccelerator::INVALID_ARGUMENT; + return ArcVideoDecodeAccelerator::INVALID_ARGUMENT; case media::VideoDecodeAccelerator::UNREADABLE_INPUT: - return ArcVideoAccelerator::UNREADABLE_INPUT; + return ArcVideoDecodeAccelerator::UNREADABLE_INPUT; case media::VideoDecodeAccelerator::PLATFORM_FAILURE: - return ArcVideoAccelerator::PLATFORM_FAILURE; + return ArcVideoDecodeAccelerator::PLATFORM_FAILURE; default: DLOG(ERROR) << "Unknown error: " << error; - return ArcVideoAccelerator::PLATFORM_FAILURE; + return ArcVideoDecodeAccelerator::PLATFORM_FAILURE; } } -void ArcGpuVideoDecodeAccelerator::NotifyError( +void ChromeArcVideoDecodeAccelerator::NotifyError( media::VideoDecodeAccelerator::Error error) { - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DLOG(ERROR) << "Error notified: " << error; arc_client_->OnError(ConvertErrorCode(error)); } -void ArcGpuVideoDecodeAccelerator::CreateInputRecord( +void ChromeArcVideoDecodeAccelerator::CreateInputRecord( int32_t bitstream_buffer_id, uint32_t buffer_index, int64_t timestamp) { @@ -506,8 +507,8 @@ input_records_.pop_back(); } -ArcGpuVideoDecodeAccelerator::InputRecord* -ArcGpuVideoDecodeAccelerator::FindInputRecord(int32_t bitstream_buffer_id) { +ChromeArcVideoDecodeAccelerator::InputRecord* +ChromeArcVideoDecodeAccelerator::FindInputRecord(int32_t bitstream_buffer_id) { for (auto& record : input_records_) { if (record.bitstream_buffer_id == bitstream_buffer_id) return &record; @@ -515,8 +516,9 @@ return nullptr; } -bool ArcGpuVideoDecodeAccelerator::ValidatePortAndIndex(PortType port, - uint32_t index) const { +bool ChromeArcVideoDecodeAccelerator::ValidatePortAndIndex( + PortType port, + uint32_t index) const { switch (port) { case PORT_INPUT: if (index >= input_buffer_info_.size()) {
diff --git a/chrome/gpu/arc_gpu_video_decode_accelerator.h b/chrome/gpu/chrome_arc_video_decode_accelerator.h similarity index 86% rename from chrome/gpu/arc_gpu_video_decode_accelerator.h rename to chrome/gpu/chrome_arc_video_decode_accelerator.h index 917be53..6b7377b2 100644 --- a/chrome/gpu/arc_gpu_video_decode_accelerator.h +++ b/chrome/gpu/chrome_arc_video_decode_accelerator.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ -#define CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ +#ifndef CHROME_GPU_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_H_ +#define CHROME_GPU_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_H_ #include <list> #include <memory> @@ -12,7 +12,7 @@ #include "base/callback.h" #include "base/threading/thread_checker.h" -#include "chrome/gpu/arc_video_accelerator.h" +#include "chrome/gpu/arc_video_decode_accelerator.h" #include "gpu/command_buffer/service/gpu_preferences.h" #include "media/video/video_decode_accelerator.h" @@ -23,19 +23,19 @@ // ARC via IPC channels and translates and sends those requests to an // implementation of media::VideoDecodeAccelerator. It also returns the decoded // frames back to the ARC side. -class ArcGpuVideoDecodeAccelerator - : public ArcVideoAccelerator, +class ChromeArcVideoDecodeAccelerator + : public ArcVideoDecodeAccelerator, public media::VideoDecodeAccelerator::Client, - public base::SupportsWeakPtr<ArcGpuVideoDecodeAccelerator> { + public base::SupportsWeakPtr<ChromeArcVideoDecodeAccelerator> { public: - explicit ArcGpuVideoDecodeAccelerator( + explicit ChromeArcVideoDecodeAccelerator( const gpu::GpuPreferences& gpu_preferences); - ~ArcGpuVideoDecodeAccelerator() override; + ~ChromeArcVideoDecodeAccelerator() override; - // Implementation of the ArcVideoAccelerator interface. - ArcVideoAccelerator::Result Initialize( + // Implementation of the ArcVideoDecodeAccelerator interface. + ArcVideoDecodeAccelerator::Result Initialize( const Config& config, - ArcVideoAccelerator::Client* client) override; + ArcVideoDecodeAccelerator::Client* client) override; void SetNumberOfOutputBuffers(size_t number) override; void BindSharedMemory(PortType port, uint32_t index, @@ -107,9 +107,9 @@ }; // The helper method to simplify reporting of the status returned to UMA. - ArcVideoAccelerator::Result InitializeTask( + ArcVideoDecodeAccelerator::Result InitializeTask( const Config& config, - ArcVideoAccelerator::Client* client); + ArcVideoDecodeAccelerator::Client* client); // Helper function to validate |port| and |index|. bool ValidatePortAndIndex(PortType port, uint32_t index) const; @@ -142,8 +142,8 @@ std::unique_ptr<media::VideoDecodeAccelerator> vda_; // It's safe to use the pointer here, the life cycle of the |arc_client_| - // is longer than this ArcGpuVideoDecodeAccelerator. - ArcVideoAccelerator::Client* arc_client_; + // is longer than this ChromeArcVideoDecodeAccelerator. + ArcVideoDecodeAccelerator::Client* arc_client_; // The next ID for the bitstream buffer, started from 0. int32_t next_bitstream_buffer_id_; @@ -164,7 +164,7 @@ // when those buffers are used for the first time. std::vector<OutputBufferInfo> buffers_pending_import_; - base::ThreadChecker thread_checker_; + THREAD_CHECKER(thread_checker_); size_t output_buffer_size_; // The minimal number of requested output buffers. @@ -172,10 +172,10 @@ gpu::GpuPreferences gpu_preferences_; - DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); + DISALLOW_COPY_AND_ASSIGN(ChromeArcVideoDecodeAccelerator); }; } // namespace arc } // namespace chromeos -#endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ +#endif // CHROME_GPU_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_H_
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc index 9a32f37..05cfc43f 100644 --- a/chrome/gpu/chrome_content_gpu_client.cc +++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -20,7 +20,7 @@ #include "services/service_manager/public/cpp/connector.h" #if defined(OS_CHROMEOS) -#include "chrome/gpu/gpu_arc_video_service.h" +#include "chrome/gpu/gpu_arc_video_decode_accelerator.h" #include "content/public/common/service_manager_connection.h" #include "services/service_manager/public/cpp/binder_registry.h" #endif @@ -65,7 +65,7 @@ #if defined(OS_CHROMEOS) registry->AddInterface( - base::Bind(&ChromeContentGpuClient::CreateArcVideoAcceleratorService, + base::Bind(&ChromeContentGpuClient::CreateArcVideoDecodeAccelerator, base::Unretained(this)), base::ThreadTaskRunnerHandle::Get()); #endif @@ -86,11 +86,12 @@ #if defined(OS_CHROMEOS) -void ChromeContentGpuClient::CreateArcVideoAcceleratorService( +void ChromeContentGpuClient::CreateArcVideoDecodeAccelerator( const service_manager::BindSourceInfo& source_info, - ::arc::mojom::VideoAcceleratorServiceRequest request) { + ::arc::mojom::VideoDecodeAcceleratorRequest request) { mojo::MakeStrongBinding( - base::MakeUnique<chromeos::arc::GpuArcVideoService>(gpu_preferences_), + base::MakeUnique<chromeos::arc::GpuArcVideoDecodeAccelerator>( + gpu_preferences_), std::move(request)); }
diff --git a/chrome/gpu/chrome_content_gpu_client.h b/chrome/gpu/chrome_content_gpu_client.h index f0c5075..768f3a7 100644 --- a/chrome/gpu/chrome_content_gpu_client.h +++ b/chrome/gpu/chrome_content_gpu_client.h
@@ -13,7 +13,7 @@ #include "content/public/gpu/content_gpu_client.h" #if defined(OS_CHROMEOS) -#include "chrome/gpu/gpu_arc_video_service.h" +#include "chrome/gpu/gpu_arc_video_decode_accelerator.h" namespace service_manager { struct BindSourceInfo; @@ -34,9 +34,9 @@ private: #if defined(OS_CHROMEOS) - void CreateArcVideoAcceleratorService( + void CreateArcVideoDecodeAccelerator( const service_manager::BindSourceInfo& source_info, - ::arc::mojom::VideoAcceleratorServiceRequest request); + ::arc::mojom::VideoDecodeAcceleratorRequest request); #endif std::unique_ptr<variations::ChildProcessFieldTrialSyncer> field_trial_syncer_;
diff --git a/chrome/gpu/gpu_arc_video_decode_accelerator.cc b/chrome/gpu/gpu_arc_video_decode_accelerator.cc new file mode 100644 index 0000000..23b1413 --- /dev/null +++ b/chrome/gpu/gpu_arc_video_decode_accelerator.cc
@@ -0,0 +1,256 @@ +// 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/gpu/gpu_arc_video_decode_accelerator.h" + +#include <utility> + +#include "base/bind.h" +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "base/threading/thread_task_runner_handle.h" +#include "chrome/gpu/chrome_arc_video_decode_accelerator.h" +#include "mojo/public/cpp/bindings/strong_binding.h" +#include "mojo/public/cpp/bindings/type_converter.h" +#include "mojo/public/cpp/system/platform_handle.h" + +// Make sure arc::mojom::VideoDecodeAccelerator::Result and +// chromeos::arc::ArcVideoDecodeAccelerator::Result match. +static_assert( + static_cast<int>(arc::mojom::VideoDecodeAccelerator::Result::SUCCESS) == + chromeos::arc::ArcVideoDecodeAccelerator::SUCCESS, + "enum mismatch"); +static_assert(static_cast<int>( + arc::mojom::VideoDecodeAccelerator::Result::ILLEGAL_STATE) == + chromeos::arc::ArcVideoDecodeAccelerator::ILLEGAL_STATE, + "enum mismatch"); +static_assert( + static_cast<int>( + arc::mojom::VideoDecodeAccelerator::Result::INVALID_ARGUMENT) == + chromeos::arc::ArcVideoDecodeAccelerator::INVALID_ARGUMENT, + "enum mismatch"); +static_assert( + static_cast<int>( + arc::mojom::VideoDecodeAccelerator::Result::UNREADABLE_INPUT) == + chromeos::arc::ArcVideoDecodeAccelerator::UNREADABLE_INPUT, + "enum mismatch"); +static_assert( + static_cast<int>( + arc::mojom::VideoDecodeAccelerator::Result::PLATFORM_FAILURE) == + chromeos::arc::ArcVideoDecodeAccelerator::PLATFORM_FAILURE, + "enum mismatch"); +static_assert( + static_cast<int>( + arc::mojom::VideoDecodeAccelerator::Result::INSUFFICIENT_RESOURCES) == + chromeos::arc::ArcVideoDecodeAccelerator::INSUFFICIENT_RESOURCES, + "enum mismatch"); + +namespace mojo { + +template <> +struct TypeConverter<arc::mojom::BufferMetadataPtr, + chromeos::arc::BufferMetadata> { + static arc::mojom::BufferMetadataPtr Convert( + const chromeos::arc::BufferMetadata& input) { + arc::mojom::BufferMetadataPtr result = arc::mojom::BufferMetadata::New(); + result->timestamp = input.timestamp; + result->bytes_used = input.bytes_used; + return result; + } +}; + +template <> +struct TypeConverter<chromeos::arc::BufferMetadata, + arc::mojom::BufferMetadataPtr> { + static chromeos::arc::BufferMetadata Convert( + const arc::mojom::BufferMetadataPtr& input) { + chromeos::arc::BufferMetadata result; + result.timestamp = input->timestamp; + result.bytes_used = input->bytes_used; + return result; + } +}; + +template <> +struct TypeConverter<arc::mojom::VideoFormatPtr, chromeos::arc::VideoFormat> { + static arc::mojom::VideoFormatPtr Convert( + const chromeos::arc::VideoFormat& input) { + arc::mojom::VideoFormatPtr result = arc::mojom::VideoFormat::New(); + result->pixel_format = input.pixel_format; + result->buffer_size = input.buffer_size; + result->min_num_buffers = input.min_num_buffers; + result->coded_width = input.coded_width; + result->coded_height = input.coded_height; + result->crop_left = input.crop_left; + result->crop_width = input.crop_width; + result->crop_top = input.crop_top; + result->crop_height = input.crop_height; + return result; + } +}; + +template <> +struct TypeConverter<chromeos::arc::ArcVideoDecodeAccelerator::Config, + arc::mojom::VideoDecodeAcceleratorConfigPtr> { + static chromeos::arc::ArcVideoDecodeAccelerator::Config Convert( + const arc::mojom::VideoDecodeAcceleratorConfigPtr& input) { + chromeos::arc::ArcVideoDecodeAccelerator::Config result; + result.num_input_buffers = input->num_input_buffers; + result.input_pixel_format = input->input_pixel_format; + return result; + } +}; + +} // namespace mojo + +namespace chromeos { +namespace arc { + +GpuArcVideoDecodeAccelerator::GpuArcVideoDecodeAccelerator( + const gpu::GpuPreferences& gpu_preferences) + : gpu_preferences_(gpu_preferences), + accelerator_(new ChromeArcVideoDecodeAccelerator(gpu_preferences_)) {} + +GpuArcVideoDecodeAccelerator::~GpuArcVideoDecodeAccelerator() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +} + +void GpuArcVideoDecodeAccelerator::OnError( + ArcVideoDecodeAccelerator::Result error) { + DVLOG(2) << "OnError " << error; + DCHECK_NE(error, ArcVideoDecodeAccelerator::SUCCESS); + DCHECK(client_); + client_->OnError( + static_cast<::arc::mojom::VideoDecodeAccelerator::Result>(error)); +} + +void GpuArcVideoDecodeAccelerator::OnBufferDone( + PortType port, + uint32_t index, + const BufferMetadata& metadata) { + DVLOG(2) << "OnBufferDone " << port << "," << index; + DCHECK(client_); + client_->OnBufferDone(static_cast<::arc::mojom::PortType>(port), index, + ::arc::mojom::BufferMetadata::From(metadata)); +} + +void GpuArcVideoDecodeAccelerator::OnFlushDone() { + DVLOG(2) << "OnFlushDone"; + DCHECK(client_); + client_->OnFlushDone(); +} + +void GpuArcVideoDecodeAccelerator::OnResetDone() { + DVLOG(2) << "OnResetDone"; + DCHECK(client_); + client_->OnResetDone(); +} + +void GpuArcVideoDecodeAccelerator::OnOutputFormatChanged( + const VideoFormat& format) { + DVLOG(2) << "OnOutputFormatChanged"; + DCHECK(client_); + client_->OnOutputFormatChanged(::arc::mojom::VideoFormat::From(format)); +} + +void GpuArcVideoDecodeAccelerator::Initialize( + ::arc::mojom::VideoDecodeAcceleratorConfigPtr config, + ::arc::mojom::VideoDecodeClientPtr client, + const InitializeCallback& callback) { + DVLOG(2) << "Initialize"; + DCHECK(!client_); + if (config->device_type_deprecated != + ::arc::mojom::VideoDecodeAcceleratorConfig::DeviceTypeDeprecated:: + DEVICE_DECODER) { + LOG(ERROR) << "only decoder is supported"; + callback.Run( + ::arc::mojom::VideoDecodeAccelerator::Result::INVALID_ARGUMENT); + } + client_ = std::move(client); + ArcVideoDecodeAccelerator::Result result = accelerator_->Initialize( + config.To<ArcVideoDecodeAccelerator::Config>(), this); + callback.Run( + static_cast<::arc::mojom::VideoDecodeAccelerator::Result>(result)); +} + +base::ScopedFD GpuArcVideoDecodeAccelerator::UnwrapFdFromMojoHandle( + mojo::ScopedHandle handle) { + DCHECK(client_); + if (!handle.is_valid()) { + LOG(ERROR) << "handle is invalid"; + client_->OnError( + ::arc::mojom::VideoDecodeAccelerator::Result::INVALID_ARGUMENT); + return base::ScopedFD(); + } + + base::PlatformFile platform_file; + MojoResult mojo_result = + mojo::UnwrapPlatformFile(std::move(handle), &platform_file); + if (mojo_result != MOJO_RESULT_OK) { + LOG(ERROR) << "UnwrapPlatformFile failed: " << mojo_result; + client_->OnError( + ::arc::mojom::VideoDecodeAccelerator::Result::PLATFORM_FAILURE); + return base::ScopedFD(); + } + + return base::ScopedFD(platform_file); +} + +void GpuArcVideoDecodeAccelerator::BindSharedMemory( + ::arc::mojom::PortType port, + uint32_t index, + mojo::ScopedHandle ashmem_handle, + uint32_t offset, + uint32_t length) { + DVLOG(2) << "BindSharedMemoryCallback port=" << port << ", index=" << index + << ", offset=" << offset << ", length=" << length; + + base::ScopedFD fd = UnwrapFdFromMojoHandle(std::move(ashmem_handle)); + if (!fd.is_valid()) + return; + accelerator_->BindSharedMemory(static_cast<PortType>(port), index, + std::move(fd), offset, length); +} + +void GpuArcVideoDecodeAccelerator::BindDmabuf( + ::arc::mojom::PortType port, + uint32_t index, + mojo::ScopedHandle dmabuf_handle, + std::vector<::arc::ArcVideoAcceleratorDmabufPlane> dmabuf_planes) { + DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index; + + base::ScopedFD fd = UnwrapFdFromMojoHandle(std::move(dmabuf_handle)); + if (!fd.is_valid()) + return; + + accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd), + std::move(dmabuf_planes)); +} + +void GpuArcVideoDecodeAccelerator::UseBuffer( + ::arc::mojom::PortType port, + uint32_t index, + ::arc::mojom::BufferMetadataPtr metadata) { + DVLOG(2) << "UseBuffer port=" << port << ", index=" << index; + accelerator_->UseBuffer(static_cast<PortType>(port), index, + metadata.To<BufferMetadata>()); +} + +void GpuArcVideoDecodeAccelerator::SetNumberOfOutputBuffers(uint32_t number) { + DVLOG(2) << "SetNumberOfOutputBuffers number=" << number; + accelerator_->SetNumberOfOutputBuffers(number); +} + +void GpuArcVideoDecodeAccelerator::Reset() { + DVLOG(2) << "Reset"; + accelerator_->Reset(); +} + +void GpuArcVideoDecodeAccelerator::Flush() { + DVLOG(2) << "Flush"; + accelerator_->Flush(); +} + +} // namespace arc +} // namespace chromeos
diff --git a/chrome/gpu/gpu_arc_video_decode_accelerator.h b/chrome/gpu/gpu_arc_video_decode_accelerator.h new file mode 100644 index 0000000..96d281b --- /dev/null +++ b/chrome/gpu/gpu_arc_video_decode_accelerator.h
@@ -0,0 +1,79 @@ +// 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_GPU_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ +#define CHROME_GPU_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ + +#include <memory> +#include <vector> + +#include "base/files/scoped_file.h" +#include "base/macros.h" +#include "chrome/gpu/arc_video_decode_accelerator.h" +#include "components/arc/common/video_decode_accelerator.mojom.h" +#include "components/arc/video_accelerator/video_accelerator.h" +#include "gpu/command_buffer/service/gpu_preferences.h" + +namespace chromeos { +namespace arc { + +// GpuArcVideoDecodeAccelerator manages life-cycle and IPC message translation +// for ArcVideoDecodeAccelerator. +// +// For each creation request from GpuArcVideoDecodeAcceleratorHost, +// GpuArcVideoDecodeAccelerator will create a new IPC channel. +class GpuArcVideoDecodeAccelerator + : public ::arc::mojom::VideoDecodeAccelerator, + public ArcVideoDecodeAccelerator::Client { + public: + explicit GpuArcVideoDecodeAccelerator( + const gpu::GpuPreferences& gpu_preferences); + ~GpuArcVideoDecodeAccelerator() override; + + private: + // ArcVideoDecodeAccelerator::Client implementation. + void OnError(ArcVideoDecodeAccelerator::Result error) override; + void OnBufferDone(PortType port, + uint32_t index, + const BufferMetadata& metadata) override; + void OnFlushDone() override; + void OnResetDone() override; + void OnOutputFormatChanged(const VideoFormat& format) override; + + // ::arc::mojom::VideoDecodeAccelerator implementation. + void Initialize(::arc::mojom::VideoDecodeAcceleratorConfigPtr config, + ::arc::mojom::VideoDecodeClientPtr client, + const InitializeCallback& callback) override; + void BindSharedMemory(::arc::mojom::PortType port, + uint32_t index, + mojo::ScopedHandle ashmem_handle, + uint32_t offset, + uint32_t length) override; + void BindDmabuf(::arc::mojom::PortType port, + uint32_t index, + mojo::ScopedHandle dmabuf_handle, + std::vector<::arc::ArcVideoAcceleratorDmabufPlane> + dmabuf_planes) override; + void UseBuffer(::arc::mojom::PortType port, + uint32_t index, + ::arc::mojom::BufferMetadataPtr metadata) override; + void SetNumberOfOutputBuffers(uint32_t number) override; + void Flush() override; + void Reset() override; + + base::ScopedFD UnwrapFdFromMojoHandle(mojo::ScopedHandle handle); + + THREAD_CHECKER(thread_checker_); + + gpu::GpuPreferences gpu_preferences_; + std::unique_ptr<ArcVideoDecodeAccelerator> accelerator_; + ::arc::mojom::VideoDecodeClientPtr client_; + + DISALLOW_COPY_AND_ASSIGN(GpuArcVideoDecodeAccelerator); +}; + +} // namespace arc +} // namespace chromeos + +#endif // CHROME_GPU_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_
diff --git a/chrome/gpu/gpu_arc_video_service.cc b/chrome/gpu/gpu_arc_video_service.cc deleted file mode 100644 index d704fbce..0000000 --- a/chrome/gpu/gpu_arc_video_service.cc +++ /dev/null
@@ -1,247 +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 "chrome/gpu/gpu_arc_video_service.h" - -#include <utility> - -#include "base/bind.h" -#include "base/logging.h" -#include "base/memory/ptr_util.h" -#include "base/threading/thread_task_runner_handle.h" -#include "chrome/gpu/arc_gpu_video_decode_accelerator.h" -#include "mojo/public/cpp/bindings/strong_binding.h" -#include "mojo/public/cpp/bindings/type_converter.h" -#include "mojo/public/cpp/system/platform_handle.h" - -// Make sure arc::mojom::VideoAcceleratorService::Result and -// chromeos::arc::ArcVideoAccelerator::Result match. -static_assert( - static_cast<int>(arc::mojom::VideoAcceleratorService::Result::SUCCESS) == - chromeos::arc::ArcVideoAccelerator::SUCCESS, - "enum mismatch"); -static_assert(static_cast<int>( - arc::mojom::VideoAcceleratorService::Result::ILLEGAL_STATE) == - chromeos::arc::ArcVideoAccelerator::ILLEGAL_STATE, - "enum mismatch"); -static_assert( - static_cast<int>( - arc::mojom::VideoAcceleratorService::Result::INVALID_ARGUMENT) == - chromeos::arc::ArcVideoAccelerator::INVALID_ARGUMENT, - "enum mismatch"); -static_assert( - static_cast<int>( - arc::mojom::VideoAcceleratorService::Result::UNREADABLE_INPUT) == - chromeos::arc::ArcVideoAccelerator::UNREADABLE_INPUT, - "enum mismatch"); -static_assert( - static_cast<int>( - arc::mojom::VideoAcceleratorService::Result::PLATFORM_FAILURE) == - chromeos::arc::ArcVideoAccelerator::PLATFORM_FAILURE, - "enum mismatch"); -static_assert( - static_cast<int>( - arc::mojom::VideoAcceleratorService::Result::INSUFFICIENT_RESOURCES) == - chromeos::arc::ArcVideoAccelerator::INSUFFICIENT_RESOURCES, - "enum mismatch"); - -namespace mojo { - -template <> -struct TypeConverter<arc::mojom::BufferMetadataPtr, - chromeos::arc::BufferMetadata> { - static arc::mojom::BufferMetadataPtr Convert( - const chromeos::arc::BufferMetadata& input) { - arc::mojom::BufferMetadataPtr result = arc::mojom::BufferMetadata::New(); - result->timestamp = input.timestamp; - result->bytes_used = input.bytes_used; - return result; - } -}; - -template <> -struct TypeConverter<chromeos::arc::BufferMetadata, - arc::mojom::BufferMetadataPtr> { - static chromeos::arc::BufferMetadata Convert( - const arc::mojom::BufferMetadataPtr& input) { - chromeos::arc::BufferMetadata result; - result.timestamp = input->timestamp; - result.bytes_used = input->bytes_used; - return result; - } -}; - -template <> -struct TypeConverter<arc::mojom::VideoFormatPtr, chromeos::arc::VideoFormat> { - static arc::mojom::VideoFormatPtr Convert( - const chromeos::arc::VideoFormat& input) { - arc::mojom::VideoFormatPtr result = arc::mojom::VideoFormat::New(); - result->pixel_format = input.pixel_format; - result->buffer_size = input.buffer_size; - result->min_num_buffers = input.min_num_buffers; - result->coded_width = input.coded_width; - result->coded_height = input.coded_height; - result->crop_left = input.crop_left; - result->crop_width = input.crop_width; - result->crop_top = input.crop_top; - result->crop_height = input.crop_height; - return result; - } -}; - -template <> -struct TypeConverter<chromeos::arc::ArcVideoAccelerator::Config, - arc::mojom::ArcVideoAcceleratorConfigPtr> { - static chromeos::arc::ArcVideoAccelerator::Config Convert( - const arc::mojom::ArcVideoAcceleratorConfigPtr& input) { - chromeos::arc::ArcVideoAccelerator::Config result; - result.device_type = - static_cast<chromeos::arc::ArcVideoAccelerator::Config::DeviceType>( - input->device_type); - result.num_input_buffers = input->num_input_buffers; - result.input_pixel_format = input->input_pixel_format; - return result; - } -}; - -} // namespace mojo - -namespace chromeos { -namespace arc { - -GpuArcVideoService::GpuArcVideoService( - const gpu::GpuPreferences& gpu_preferences) - : gpu_preferences_(gpu_preferences), - accelerator_(new ArcGpuVideoDecodeAccelerator(gpu_preferences_)) {} - -GpuArcVideoService::~GpuArcVideoService() { - DCHECK(thread_checker_.CalledOnValidThread()); -} - -void GpuArcVideoService::OnError(ArcVideoAccelerator::Result error) { - DVLOG(2) << "OnError " << error; - DCHECK_NE(error, ArcVideoAccelerator::SUCCESS); - DCHECK(client_); - client_->OnError( - static_cast<::arc::mojom::VideoAcceleratorService::Result>(error)); -} - -void GpuArcVideoService::OnBufferDone(PortType port, - uint32_t index, - const BufferMetadata& metadata) { - DVLOG(2) << "OnBufferDone " << port << "," << index; - DCHECK(client_); - client_->OnBufferDone(static_cast<::arc::mojom::PortType>(port), index, - ::arc::mojom::BufferMetadata::From(metadata)); -} - -void GpuArcVideoService::OnFlushDone() { - DVLOG(2) << "OnFlushDone"; - DCHECK(client_); - client_->OnFlushDone(); -} - -void GpuArcVideoService::OnResetDone() { - DVLOG(2) << "OnResetDone"; - DCHECK(client_); - client_->OnResetDone(); -} - -void GpuArcVideoService::OnOutputFormatChanged(const VideoFormat& format) { - DVLOG(2) << "OnOutputFormatChanged"; - DCHECK(client_); - client_->OnOutputFormatChanged(::arc::mojom::VideoFormat::From(format)); -} - -void GpuArcVideoService::Initialize( - ::arc::mojom::ArcVideoAcceleratorConfigPtr config, - ::arc::mojom::VideoAcceleratorServiceClientPtr client, - const InitializeCallback& callback) { - DVLOG(2) << "Initialize"; - DCHECK(!client_); - client_ = std::move(client); - ArcVideoAccelerator::Result result = - accelerator_->Initialize(config.To<ArcVideoAccelerator::Config>(), this); - callback.Run( - static_cast<::arc::mojom::VideoAcceleratorService::Result>(result)); -} - -base::ScopedFD GpuArcVideoService::UnwrapFdFromMojoHandle( - mojo::ScopedHandle handle) { - DCHECK(client_); - if (!handle.is_valid()) { - LOG(ERROR) << "handle is invalid"; - client_->OnError( - ::arc::mojom::VideoAcceleratorService::Result::INVALID_ARGUMENT); - return base::ScopedFD(); - } - - base::PlatformFile platform_file; - MojoResult mojo_result = - mojo::UnwrapPlatformFile(std::move(handle), &platform_file); - if (mojo_result != MOJO_RESULT_OK) { - LOG(ERROR) << "UnwrapPlatformFile failed: " << mojo_result; - client_->OnError( - ::arc::mojom::VideoAcceleratorService::Result::PLATFORM_FAILURE); - return base::ScopedFD(); - } - - return base::ScopedFD(platform_file); -} - -void GpuArcVideoService::BindSharedMemory(::arc::mojom::PortType port, - uint32_t index, - mojo::ScopedHandle ashmem_handle, - uint32_t offset, - uint32_t length) { - DVLOG(2) << "BindSharedMemoryCallback port=" << port << ", index=" << index - << ", offset=" << offset << ", length=" << length; - - base::ScopedFD fd = UnwrapFdFromMojoHandle(std::move(ashmem_handle)); - if (!fd.is_valid()) - return; - accelerator_->BindSharedMemory(static_cast<PortType>(port), index, - std::move(fd), offset, length); -} - -void GpuArcVideoService::BindDmabuf( - ::arc::mojom::PortType port, - uint32_t index, - mojo::ScopedHandle dmabuf_handle, - std::vector<::arc::ArcVideoAcceleratorDmabufPlane> dmabuf_planes) { - DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index; - - base::ScopedFD fd = UnwrapFdFromMojoHandle(std::move(dmabuf_handle)); - if (!fd.is_valid()) - return; - - accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd), - std::move(dmabuf_planes)); -} - -void GpuArcVideoService::UseBuffer(::arc::mojom::PortType port, - uint32_t index, - ::arc::mojom::BufferMetadataPtr metadata) { - DVLOG(2) << "UseBuffer port=" << port << ", index=" << index; - accelerator_->UseBuffer(static_cast<PortType>(port), index, - metadata.To<BufferMetadata>()); -} - -void GpuArcVideoService::SetNumberOfOutputBuffers(uint32_t number) { - DVLOG(2) << "SetNumberOfOutputBuffers number=" << number; - accelerator_->SetNumberOfOutputBuffers(number); -} - -void GpuArcVideoService::Reset() { - DVLOG(2) << "Reset"; - accelerator_->Reset(); -} - -void GpuArcVideoService::Flush() { - DVLOG(2) << "Flush"; - accelerator_->Flush(); -} - -} // namespace arc -} // namespace chromeos
diff --git a/chrome/gpu/gpu_arc_video_service.h b/chrome/gpu/gpu_arc_video_service.h deleted file mode 100644 index 0847906..0000000 --- a/chrome/gpu/gpu_arc_video_service.h +++ /dev/null
@@ -1,77 +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 CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_ -#define CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_ - -#include <memory> -#include <vector> - -#include "base/files/scoped_file.h" -#include "base/macros.h" -#include "chrome/gpu/arc_video_accelerator.h" -#include "components/arc/common/video_accelerator.mojom.h" -#include "components/arc/video_accelerator/video_accelerator.h" -#include "gpu/command_buffer/service/gpu_preferences.h" - -namespace chromeos { -namespace arc { - -// GpuArcVideoService manages life-cycle and IPC message translation for -// ArcVideoAccelerator. -// -// For each creation request from GpuArcVideoServiceHost, GpuArcVideoService -// will create a new IPC channel. -class GpuArcVideoService : public ::arc::mojom::VideoAcceleratorService, - public ArcVideoAccelerator::Client { - public: - explicit GpuArcVideoService(const gpu::GpuPreferences& gpu_preferences); - ~GpuArcVideoService() override; - - private: - // ArcVideoAccelerator::Client implementation. - void OnError(ArcVideoAccelerator::Result error) override; - void OnBufferDone(PortType port, - uint32_t index, - const BufferMetadata& metadata) override; - void OnFlushDone() override; - void OnResetDone() override; - void OnOutputFormatChanged(const VideoFormat& format) override; - - // ::arc::mojom::VideoAcceleratorService implementation. - void Initialize(::arc::mojom::ArcVideoAcceleratorConfigPtr config, - ::arc::mojom::VideoAcceleratorServiceClientPtr client, - const InitializeCallback& callback) override; - void BindSharedMemory(::arc::mojom::PortType port, - uint32_t index, - mojo::ScopedHandle ashmem_handle, - uint32_t offset, - uint32_t length) override; - void BindDmabuf(::arc::mojom::PortType port, - uint32_t index, - mojo::ScopedHandle dmabuf_handle, - std::vector<::arc::ArcVideoAcceleratorDmabufPlane> - dmabuf_planes) override; - void UseBuffer(::arc::mojom::PortType port, - uint32_t index, - ::arc::mojom::BufferMetadataPtr metadata) override; - void SetNumberOfOutputBuffers(uint32_t number) override; - void Flush() override; - void Reset() override; - - base::ScopedFD UnwrapFdFromMojoHandle(mojo::ScopedHandle handle); - - base::ThreadChecker thread_checker_; - - gpu::GpuPreferences gpu_preferences_; - std::unique_ptr<ArcVideoAccelerator> accelerator_; - ::arc::mojom::VideoAcceleratorServiceClientPtr client_; - - DISALLOW_COPY_AND_ASSIGN(GpuArcVideoService); -}; - -} // namespace arc -} // namespace chromeos - -#endif // CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
diff --git a/chrome/renderer/extensions/automation_internal_custom_bindings.cc b/chrome/renderer/extensions/automation_internal_custom_bindings.cc index 9f629de..4121198 100644 --- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc +++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
@@ -742,6 +742,34 @@ std::string name_from_str = ui::ToString(name_from); result.Set(v8::String::NewFromUtf8(isolate, name_from_str.c_str())); }); + RouteNodeIDFunction( + "GetBold", [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result, + TreeCache* cache, ui::AXNode* node) { + bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) & + ui::AX_TEXT_STYLE_BOLD) != 0; + result.Set(v8::Boolean::New(isolate, value)); + }); + RouteNodeIDFunction( + "GetItalic", [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result, + TreeCache* cache, ui::AXNode* node) { + bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) & + ui::AX_TEXT_STYLE_ITALIC) != 0; + result.Set(v8::Boolean::New(isolate, value)); + }); + RouteNodeIDFunction("GetUnderline", [](v8::Isolate* isolate, + v8::ReturnValue<v8::Value> result, + TreeCache* cache, ui::AXNode* node) { + bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) & + ui::AX_TEXT_STYLE_UNDERLINE) != 0; + result.Set(v8::Boolean::New(isolate, value)); + }); + RouteNodeIDFunction("GetLineThrough", [](v8::Isolate* isolate, + v8::ReturnValue<v8::Value> result, + TreeCache* cache, ui::AXNode* node) { + bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) & + ui::AX_TEXT_STYLE_LINE_THROUGH) != 0; + result.Set(v8::Boolean::New(isolate, value)); + }); RouteNodeIDFunction("GetChecked", [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result, TreeCache* cache, ui::AXNode* node) {
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js index 95924e76..1e359f8 100644 --- a/chrome/renderer/resources/extensions/automation/automation_node.js +++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -238,6 +238,34 @@ */ var GetNameFrom = requireNative('automationInternal').GetNameFrom; +/** + * @param {number} axTreeID The id of the accessibility tree. + * @param {number} nodeID The id of a node. + * @return {boolean} + */ +var GetBold = requireNative('automationInternal').GetBold; + +/** + * @param {number} axTreeID The id of the accessibility tree. + * @param {number} nodeID The id of a node. + * @return {boolean} + */ +var GetItalic = requireNative('automationInternal').GetItalic; + +/** + * @param {number} axTreeID The id of the accessibility tree. + * @param {number} nodeID The id of a node. + * @return {boolean} + */ +var GetUnderline = requireNative('automationInternal').GetUnderline; + +/** + * @param {number} axTreeID The id of the accessibility tree. + * @param {number} nodeID The id of a node. + * @return {boolean} + */ +var GetLineThrough = requireNative('automationInternal').GetLineThrough; + var lastError = require('lastError'); var logging = requireNative('logging'); var utils = require('utils'); @@ -380,6 +408,22 @@ return GetNameFrom(this.treeID, this.id); }, + get bold() { + return GetBold(this.treeID, this.id); + }, + + get italic() { + return GetItalic(this.treeID, this.id); + }, + + get underline() { + return GetUnderline(this.treeID, this.id); + }, + + get lineThrough() { + return GetLineThrough(this.treeID, this.id); + }, + doDefault: function() { this.performAction_('doDefault'); }, @@ -1137,6 +1181,10 @@ 'root', 'htmlAttributes', 'nameFrom', + 'bold', + 'italic', + 'underline', + 'lineThrough', ]), });
diff --git a/chrome/test/data/banners/appinstalled_test_page.html b/chrome/test/data/banners/appinstalled_test_page.html index 39345b5..c4cb27c7 100644 --- a/chrome/test/data/banners/appinstalled_test_page.html +++ b/chrome/test/data/banners/appinstalled_test_page.html
@@ -3,12 +3,25 @@ <head> <title>appinstalled event test page</title> <script> - function onAppInstalled() { - window.document.title = 'Got appinstalled'; + // These blanks will get filled in when each event comes through. + var gotEventsFrom = ['________', '____']; + + function setTitle() { + window.document.title = 'Got appinstalled: ' + + gotEventsFrom.join(', '); } window.addEventListener('load', () => { - window.addEventListener('appinstalled', onAppInstalled); + // Test both the addEventListener and onX attribute versions. + // When an app is installed, each should fire once. + window.addEventListener('appinstalled', () => { + gotEventsFrom[0] = 'listener'; + setTitle(); + }); + window.onappinstalled = () => { + gotEventsFrom[1] = 'attr'; + setTitle(); + }; }); </script> </head>
diff --git a/chrome/test/data/banners/beforeinstallprompt_test_page.html b/chrome/test/data/banners/beforeinstallprompt_test_page.html new file mode 100644 index 0000000..fd2d5fe --- /dev/null +++ b/chrome/test/data/banners/beforeinstallprompt_test_page.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> + <head> + <title>beforeinstallprompt event test page</title> + <link rel="manifest" href="manifest.json" /> + <script src="main.js"></script> + <script> + // These blanks will get filled in when each event comes through. + var gotEventsFrom = ['________', '____']; + + function setTitle() { + window.document.title = 'Got beforeinstallprompt: ' + + gotEventsFrom.join(', '); + } + + window.addEventListener('load', () => { + // Test both the addEventListener and onX attribute versions. + // When a prompt is shown, each should fire once. + window.addEventListener('beforeinstallprompt', () => { + gotEventsFrom[0] = 'listener'; + setTitle(); + }); + window.onbeforeinstallprompt = () => { + gotEventsFrom[1] = 'attr'; + setTitle(); + }; + }); + </script> + </head> + <body onload="initialize()"></body> +</html>
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index aae34597..fa3f1d2 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -55,6 +55,7 @@ "cr_elements/cr_elements_browsertest.js", "engagement/site_engagement_browsertest.js", "extensions/cr_extensions_browsertest.js", + "load_time_data_browsertest.js", "md_bookmarks/md_bookmarks_browsertest.js", "md_downloads/downloads_browsertest.js", "md_history/md_history_browsertest.js",
diff --git a/chrome/test/data/webui/load_time_data_browsertest.js b/chrome/test/data/webui/load_time_data_browsertest.js new file mode 100644 index 0000000..0ef769f --- /dev/null +++ b/chrome/test/data/webui/load_time_data_browsertest.js
@@ -0,0 +1,95 @@ +// 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. + +/** + * @constructor + * @extends testing.Test + */ +function LoadTimeDataTest() {} + +LoadTimeDataTest.prototype = { + __proto__: testing.Test.prototype, + + /** @override */ + browsePreload: 'chrome://resources/html/load_time_data.html', +}; + +TEST_F('LoadTimeDataTest', 'getStringPieces', function() { + function assertSubstitutedPieces(expected, var_args) { + var var_args = Array.prototype.slice.call(arguments, 1); + var pieces = + loadTimeData.getSubstitutedStringPieces.apply(loadTimeData, var_args); + assertDeepEquals(expected, pieces); + + // Ensure output matches getStringF. + assertEquals( + loadTimeData.substituteString.apply(loadTimeData, var_args), + pieces.map(p => p.value).join('')); + } + + assertSubstitutedPieces([{value: 'paper', arg: null}], 'paper'); + assertSubstitutedPieces([{value: 'paper', arg: '$1'}], '$1', 'paper'); + + assertSubstitutedPieces( + [ + {value: 'i think ', arg: null}, + {value: 'paper mario', arg: '$1'}, + {value: ' is a good game', arg: null}, + ], + 'i think $1 is a good game', 'paper mario'); + + assertSubstitutedPieces( + [ + {value: 'paper mario', arg: '$1'}, + {value: ' costs $', arg: null}, + {value: '60', arg: '$2'}, + ], + '$1 costs $$$2', 'paper mario', '60'); + + assertSubstitutedPieces( + [ + {value: 'paper mario', arg: '$1'}, + {value: ' costs $60', arg: null}, + ], + '$1 costs $$60', 'paper mario'); + + assertSubstitutedPieces( + [ + {value: 'paper mario', arg: '$1'}, + {value: ' costs\n$60 ', arg: null}, + {value: 'today', arg: '$2'}, + ], + '$1 costs\n$$60 $2', 'paper mario', 'today'); + + assertSubstitutedPieces( + [ + {value: '$$', arg: null}, + {value: '1', arg: '$1'}, + {value: '2', arg: '$2'}, + {value: '1', arg: '$1'}, + {value: '$$2', arg: null}, + {value: '2', arg: '$2'}, + {value: '$', arg: null}, + {value: '1', arg: '$1'}, + {value: '$', arg: null}, + ], + '$$$$$1$2$1$$$$2$2$$$1$$', '1', '2'); +}); + +TEST_F('LoadTimeDataTest', 'unescapedDollarSign', function() { + function assertSubstitutionThrows(label) { + assertThrows(() => { + loadTimeData.getSubstitutedStringPieces(label); + }, 'Assertion failed: Unescaped $ found in localized string.'); + + assertThrows(() => { + loadTimeData.substituteString(label); + }, 'Assertion failed: Unescaped $ found in localized string.'); + } + assertSubstitutionThrows('$'); + assertSubstitutionThrows('$1$$$a2'); + assertSubstitutionThrows('$$$'); + assertSubstitutionThrows('a$'); + assertSubstitutionThrows('a$\n'); +});
diff --git a/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js b/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js index c8a02d5..f563218 100644 --- a/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js +++ b/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js
@@ -244,6 +244,25 @@ }); }); + // Tests that pseudo sinks are ignored for the purpose of computing + // which cast mode to show. + test('cast modes not affected by pseudo sink', function(done) { + assertEquals(media_router.CastModeType.AUTO, + container.shownCastModeValue_); + container.castModeList = fakeCastModeList; + var sink = new media_router.Sink('pseudo-sink-id', + 'Pseudo sink', null, null, media_router.SinkIconType.GENERIC, + media_router.SinkStatus.ACTIVE, /* DESKTOP */ 0x4); + sink.isPseudoSink = true; + container.allSinks = [sink]; + + setTimeout(function() { + assertEquals(media_router.CastModeType.AUTO, + container.shownCastModeValue_); + done(); + }); + }); + // Tests for expected visible UI when the view is CAST_MODE_LIST. test('cast mode list state visibility', function(done) { container.showCastModeList_();
diff --git a/components/arc/BUILD.gn b/components/arc/BUILD.gn index 9b890790..e7aede7 100644 --- a/components/arc/BUILD.gn +++ b/components/arc/BUILD.gn
@@ -161,7 +161,7 @@ "common/tracing.mojom", "common/tts.mojom", "common/video.mojom", - "common/video_accelerator.mojom", + "common/video_decode_accelerator.mojom", "common/voice_interaction_arc_home.mojom", "common/voice_interaction_framework.mojom", "common/wallpaper.mojom",
diff --git a/components/arc/common/video.mojom b/components/arc/common/video.mojom index f8c95829..80db4123 100644 --- a/components/arc/common/video.mojom +++ b/components/arc/common/video.mojom
@@ -4,7 +4,7 @@ module arc.mojom; -import "video_accelerator.mojom"; +import "video_decode_accelerator.mojom"; // Next MinVersion: 5 // Deprecated method IDs: 0 @@ -24,5 +24,5 @@ }; interface VideoAcceleratorFactory { - Create@0(VideoAcceleratorService& accelerator); + CreateDecodeAccelerator@0(VideoDecodeAccelerator& decoder); };
diff --git a/components/arc/common/video_accelerator.typemap b/components/arc/common/video_accelerator.typemap index 3461d86..8a88113 100644 --- a/components/arc/common/video_accelerator.typemap +++ b/components/arc/common/video_accelerator.typemap
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -mojom = "//components/arc/common/video_accelerator.mojom" +mojom = "//components/arc/common/video_decode_accelerator.mojom" public_headers = [ "//components/arc/video_accelerator/video_accelerator.h" ] traits_headers = [ "//components/arc/video_accelerator/video_accelerator_struct_traits.h" ]
diff --git a/components/arc/common/video_accelerator.mojom b/components/arc/common/video_decode_accelerator.mojom similarity index 78% rename from components/arc/common/video_accelerator.mojom rename to components/arc/common/video_decode_accelerator.mojom index a329c335..984f3b1b 100644 --- a/components/arc/common/video_accelerator.mojom +++ b/components/arc/common/video_decode_accelerator.mojom
@@ -3,7 +3,7 @@ // found in the LICENSE file. // This file defined the mojo interface between Android and Chromium for video -// decoding and encoding. See comments of ArcVideoAccelerator for more info. +// decoding. See comments of VideoDecodeAccelerator for more info. module arc.mojom; @@ -38,13 +38,15 @@ uint32 crop_height; }; -struct ArcVideoAcceleratorConfig { - enum DeviceType { +struct VideoDecodeAcceleratorConfig { + // Deprecated. This config struct is used for decoder only. + enum DeviceTypeDeprecated { DEVICE_ENCODER = 0, DEVICE_DECODER = 1, }; - DeviceType device_type; + // Deprecated. Only decoder will be supported. + DeviceTypeDeprecated device_type_deprecated; uint32 num_input_buffers; uint32 input_pixel_format; }; @@ -57,7 +59,7 @@ // Next MinVersion: 4 // Deprecated method IDs: 2, 7 // Next method ID: 10 -interface VideoAcceleratorService { +interface VideoDecodeAccelerator { enum Result { SUCCESS = 0, ILLEGAL_STATE = 1, @@ -68,8 +70,8 @@ }; [MinVersion=2] - Initialize@8(ArcVideoAcceleratorConfig config, - VideoAcceleratorServiceClient client) => (Result result); + Initialize@8(VideoDecodeAcceleratorConfig config, + VideoDecodeClient client) => (Result result); BindSharedMemory@1(PortType port, uint32 index, handle ashmem_fd, uint32 offset, uint32 length); @@ -89,8 +91,8 @@ // Deprecated method IDs: 0 // Next method ID: 6 -interface VideoAcceleratorServiceClient { - OnError@1(VideoAcceleratorService.Result error); +interface VideoDecodeClient { + OnError@1(VideoDecodeAccelerator.Result error); OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata);
diff --git a/components/arc/video_accelerator/video_accelerator_struct_traits.h b/components/arc/video_accelerator/video_accelerator_struct_traits.h index 6c76c90..99c9f488 100644 --- a/components/arc/video_accelerator/video_accelerator_struct_traits.h +++ b/components/arc/video_accelerator/video_accelerator_struct_traits.h
@@ -5,7 +5,7 @@ #ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ #define COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ -#include "components/arc/common/video_accelerator.mojom.h" +#include "components/arc/common/video_decode_accelerator.mojom.h" #include "components/arc/video_accelerator/video_accelerator.h" namespace mojo {
diff --git a/components/browser_sync/profile_sync_service_unittest.cc b/components/browser_sync/profile_sync_service_unittest.cc index 4dd3cb8..4d56b6d 100644 --- a/components/browser_sync/profile_sync_service_unittest.cc +++ b/components/browser_sync/profile_sync_service_unittest.cc
@@ -60,7 +60,7 @@ explicit FakeDataTypeManager(const ConfigureCalled& configure_called) : configure_called_(configure_called) {} - ~FakeDataTypeManager() override{}; + ~FakeDataTypeManager() override {} void Configure(syncer::ModelTypeSet desired_types, syncer::ConfigureReason reason) override { @@ -72,7 +72,7 @@ void ResetDataTypeErrors() override {} void PurgeForMigration(syncer::ModelTypeSet undesired_types, syncer::ConfigureReason reason) override {} - void Stop() override{}; + void Stop() override {} ModelTypeSet GetActiveDataTypes() const override { return ModelTypeSet(); } bool IsNigoriEnabled() const override { return true; } State state() const override { return syncer::DataTypeManager::CONFIGURED; }
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java index f2d0c01..186cff6b 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
@@ -19,7 +19,6 @@ import org.chromium.base.FileUtils; import org.chromium.base.PathUtils; import org.chromium.base.annotations.JNINamespace; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.net.TestUrlRequestCallback.ResponseStep; import org.chromium.net.impl.CronetEngineBuilderImpl; @@ -487,11 +486,9 @@ assertTrue(file2.delete()); } - //@SmallTest - //@Feature({"Cronet"}) - //@OnlyRunNativeCronet - // Frequently crashes on Cronet builders - see crbug.com/729257 - @DisabledTest + @SmallTest + @Feature({"Cronet"}) + @OnlyRunNativeCronet // Tests that NetLog contains events emitted by all live CronetEngines. public void testBoundedFileNetLogContainEventsFromAllLiveEngines() throws Exception { Context context = getContext();
diff --git a/components/cronet/ios/BUILD.gn b/components/cronet/ios/BUILD.gn index 8b8f4b1..902824f3 100644 --- a/components/cronet/ios/BUILD.gn +++ b/components/cronet/ios/BUILD.gn
@@ -206,6 +206,13 @@ current_cpu, ] + if (!use_system_xcode) { + args += [ + "--developer_dir", + hermetic_xcode_path, + ] + } + public_configs = [ ":cronet_static_config" ] }
diff --git a/components/cronet/tools/hide_symbols.py b/components/cronet/tools/hide_symbols.py index 55e7fb8..a66c108 100755 --- a/components/cronet/tools/hide_symbols.py +++ b/components/cronet/tools/hide_symbols.py
@@ -51,9 +51,15 @@ '--current_cpu', help='The current processor architecture in the format of the target_cpu ' 'attribute in GN.') + parser.add_option( + '--developer_dir', + help='Path to Xcode.') (options, args) = parser.parse_args() assert not args + if options.developer_dir: + os.environ['DEVELOPER_DIR'] = options.developer_dir + # ld -r concatenates multiple .o files and .a files into a single .o file, # while "hiding" symbols not marked as visible. command = [
diff --git a/components/download/internal/model.h b/components/download/internal/model.h index d45a2559..642ba5f4 100644 --- a/components/download/internal/model.h +++ b/components/download/internal/model.h
@@ -9,11 +9,11 @@ #include <string> #include <vector> +#include "components/download/internal/entry.h" #include "components/download/public/clients.h" namespace download { -struct Entry; class Store; // The model that contains a runtime representation of Entry entries. Any @@ -78,6 +78,9 @@ // modifications to this model. virtual Entry* Get(const std::string& guid) = 0; + // Returns the total number of in-memory entries with the specific |state|. + virtual uint32_t StateCount(Entry::State state) = 0; + // Returns a temporary list of Entry objects that this Model stores. // IMPORTANT NOTE: Like Get(), the result of this method should be used // immediately and NOT stored. The underlying data may get updated or removed
diff --git a/components/download/internal/model_impl.cc b/components/download/internal/model_impl.cc index 266c086..c1c093dd 100644 --- a/components/download/internal/model_impl.cc +++ b/components/download/internal/model_impl.cc
@@ -32,6 +32,7 @@ DCHECK(store_->IsInitialized()); DCHECK(entries_.find(entry.guid) == entries_.end()); + state_counts_[entry.state]++; entries_.emplace(entry.guid, base::MakeUnique<Entry>(entry)); store_->Update(entry, base::BindOnce(&ModelImpl::OnAddFinished, @@ -43,6 +44,8 @@ DCHECK(store_->IsInitialized()); DCHECK(entries_.find(entry.guid) != entries_.end()); + state_counts_[entries_[entry.guid]->state]--; + state_counts_[entry.state]++; entries_[entry.guid] = base::MakeUnique<Entry>(entry); store_->Update(entry, base::BindOnce(&ModelImpl::OnUpdateFinished, weak_ptr_factory_.GetWeakPtr(), @@ -56,6 +59,7 @@ DCHECK(it != entries_.end()); DownloadClient client = it->second->client; + state_counts_[it->second->state]--; entries_.erase(it); store_->Remove(guid, base::BindOnce(&ModelImpl::OnRemoveFinished, @@ -67,6 +71,10 @@ return it == entries_.end() ? nullptr : it->second.get(); } +uint32_t ModelImpl::StateCount(Entry::State state) { + return state_counts_[state]; +} + Model::EntryList ModelImpl::PeekEntries() { EntryList entries; for (const auto& it : entries_) @@ -85,8 +93,10 @@ return; } - for (const auto& entry : *entries) + for (const auto& entry : *entries) { + state_counts_[entry.state]++; entries_.emplace(entry.guid, base::MakeUnique<Entry>(entry)); + } client_->OnModelReady(true); } @@ -97,12 +107,15 @@ stats::LogModelOperationResult(stats::ModelAction::ADD, success); // Don't notify the Client if the entry was already removed. - if (entries_.find(guid) == entries_.end()) + auto it = entries_.find(guid); + if (it == entries_.end()) return; // Remove the entry from the map if the add failed. - if (!success) - entries_.erase(guid); + if (!success) { + state_counts_[it->second->state]--; + entries_.erase(it); + } client_->OnItemAdded(success, client, guid); }
diff --git a/components/download/internal/model_impl.h b/components/download/internal/model_impl.h index bb5fecb..b9a1c72 100644 --- a/components/download/internal/model_impl.h +++ b/components/download/internal/model_impl.h
@@ -32,6 +32,7 @@ void Update(const Entry& entry) override; void Remove(const std::string& guid) override; Entry* Get(const std::string& guid) override; + uint32_t StateCount(Entry::State state) override; EntryList PeekEntries() override; private: @@ -61,6 +62,9 @@ // entries saved in Store. OwnedEntryMap entries_; + // A map of Entry::State -> the total number of entries with that state. + std::map<Entry::State, uint32_t> state_counts_; + base::WeakPtrFactory<ModelImpl> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(ModelImpl);
diff --git a/components/download/internal/model_impl_unittest.cc b/components/download/internal/model_impl_unittest.cc index 1ccbdddd..fd78650b 100644 --- a/components/download/internal/model_impl_unittest.cc +++ b/components/download/internal/model_impl_unittest.cc
@@ -72,6 +72,7 @@ EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid))); EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid))); + EXPECT_EQ(2u, model_->StateCount(Entry::State::NEW)); } TEST_F(DownloadServiceModelImplTest, BadInit) { @@ -93,15 +94,18 @@ model_->Initialize(&client_); store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); model_->Add(entry1); EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid))); EXPECT_TRUE(test::CompareEntry(&entry1, store_->LastUpdatedEntry())); store_->TriggerUpdate(true); + EXPECT_EQ(1u, model_->StateCount(Entry::State::NEW)); model_->Add(entry2); EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid))); EXPECT_TRUE(test::CompareEntry(&entry2, store_->LastUpdatedEntry())); + EXPECT_EQ(2u, model_->StateCount(Entry::State::NEW)); store_->TriggerUpdate(false); EXPECT_EQ(nullptr, model_->Get(entry2.guid)); @@ -127,15 +131,21 @@ model_->Initialize(&client_); store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + EXPECT_EQ(1u, model_->StateCount(Entry::State::NEW)); model_->Update(entry2); EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid))); EXPECT_TRUE(test::CompareEntry(&entry2, store_->LastUpdatedEntry())); store_->TriggerUpdate(true); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); + EXPECT_EQ(1u, model_->StateCount(Entry::State::AVAILABLE)); model_->Update(entry3); EXPECT_TRUE(test::CompareEntry(&entry3, model_->Get(entry3.guid))); EXPECT_TRUE(test::CompareEntry(&entry3, store_->LastUpdatedEntry())); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); + EXPECT_EQ(0u, model_->StateCount(Entry::State::AVAILABLE)); + EXPECT_EQ(1u, model_->StateCount(Entry::State::ACTIVE)); store_->TriggerUpdate(false); EXPECT_TRUE(test::CompareEntry(&entry3, model_->Get(entry3.guid))); @@ -155,16 +165,19 @@ model_->Initialize(&client_); store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + EXPECT_EQ(2u, model_->StateCount(Entry::State::NEW)); model_->Remove(entry1.guid); EXPECT_EQ(entry1.guid, store_->LastRemovedEntry()); EXPECT_EQ(nullptr, model_->Get(entry1.guid)); store_->TriggerRemove(true); + EXPECT_EQ(1u, model_->StateCount(Entry::State::NEW)); model_->Remove(entry2.guid); EXPECT_EQ(entry2.guid, store_->LastRemovedEntry()); EXPECT_EQ(nullptr, model_->Get(entry2.guid)); store_->TriggerRemove(false); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); } TEST_F(DownloadServiceModelImplTest, Get) { @@ -208,12 +221,15 @@ model_->Initialize(&client_); store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); model_->Add(entry); EXPECT_TRUE(test::CompareEntry(&entry, model_->Get(entry.guid))); + EXPECT_EQ(1u, model_->StateCount(Entry::State::NEW)); model_->Remove(entry.guid); EXPECT_EQ(nullptr, model_->Get(entry.guid)); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); store_->TriggerUpdate(true); store_->TriggerRemove(true); @@ -236,12 +252,17 @@ model_->Initialize(&client_); store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid))); + EXPECT_EQ(1u, model_->StateCount(Entry::State::NEW)); model_->Update(entry2); EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid))); + EXPECT_EQ(1u, model_->StateCount(Entry::State::AVAILABLE)); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); model_->Remove(entry2.guid); EXPECT_EQ(nullptr, model_->Get(entry2.guid)); + EXPECT_EQ(0u, model_->StateCount(Entry::State::AVAILABLE)); + EXPECT_EQ(0u, model_->StateCount(Entry::State::NEW)); store_->TriggerUpdate(true); store_->TriggerRemove(true);
diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc index d5dc2d3..660b3a3 100644 --- a/components/favicon/core/large_icon_service.cc +++ b/components/favicon/core/large_icon_service.cc
@@ -393,12 +393,14 @@ min_source_size_in_pixel, desired_size_in_pixel, raw_bitmap_callback, image_callback, background_task_runner_, tracker); + int max_size_in_pixel = + std::max(desired_size_in_pixel, min_source_size_in_pixel); // TODO(beaudoin): For now this is just a wrapper around // GetLargestRawFaviconForPageURL. Add the logic required to select the best // possible large icon. Also add logic to fetch-on-demand when the URL of // a large icon is known but its bitmap is not available. return favicon_service_->GetLargestRawFaviconForPageURL( - page_url, large_icon_types_, min_source_size_in_pixel, + page_url, large_icon_types_, max_size_in_pixel, base::Bind(&LargeIconWorker::OnIconLookupComplete, worker), tracker); }
diff --git a/components/favicon/core/large_icon_service.h b/components/favicon/core/large_icon_service.h index 38d465c..0501625 100644 --- a/components/favicon/core/large_icon_service.h +++ b/components/favicon/core/large_icon_service.h
@@ -39,15 +39,19 @@ ~LargeIconService() override; // Requests the best large icon for the page at |page_url|. - // Case 1. An icon exists whose size is >= |min_source_size_in_pixel|: + // Case 1. An icon exists whose size is >= MAX(|min_source_size_in_pixel|, + // |desired_size_in_pixel|): // - If |desired_size_in_pixel| == 0: returns icon as is. // - Else: returns the icon resized to |desired_size_in_pixel|. - // Case 2. An icon exists whose size is < |min_source_size_in_pixel|: + // Case 2. An icon exists whose size is >= |min_source_size_in_pixel| and < + // |desired_size_in_pixel|: + // - Same as 1 with the biggest icon. + // Case 4. An icon exists whose size is < |min_source_size_in_pixel|: // - Extracts dominant color of smaller image, returns a fallback icon style // that has a matching background. - // Case 3. No icon exists. + // Case 5. No icon exists. // - Returns the default fallback icon style. - // For cases 2 and 3, this function returns the style of the fallback icon + // For cases 4 and 5, this function returns the style of the fallback icon // instead of rendering an icon so clients can render the icon themselves. // TODO(jkrcal): Rename to GetLargeIconRawBitmapOrFallbackStyle. base::CancelableTaskTracker::TaskId GetLargeIconOrFallbackStyle(
diff --git a/components/history/core/browser/typed_url_sync_bridge_unittest.cc b/components/history/core/browser/typed_url_sync_bridge_unittest.cc index 2453270..be2a855 100644 --- a/components/history/core/browser/typed_url_sync_bridge_unittest.cc +++ b/components/history/core/browser/typed_url_sync_bridge_unittest.cc
@@ -108,23 +108,23 @@ void NotifyProfileError(sql::InitStatus init_status, const std::string& diagnostics) override {} void SetInMemoryBackend( - std::unique_ptr<InMemoryHistoryBackend> backend) override{}; + std::unique_ptr<InMemoryHistoryBackend> backend) override {} void NotifyFaviconsChanged(const std::set<GURL>& page_urls, - const GURL& icon_url) override{}; + const GURL& icon_url) override {} void NotifyURLVisited(ui::PageTransition transition, const URLRow& row, const RedirectList& redirects, - base::Time visit_time) override{}; - void NotifyURLsModified(const URLRows& changed_urls) override{}; + base::Time visit_time) override {} + void NotifyURLsModified(const URLRows& changed_urls) override {} void NotifyURLsDeleted(bool all_history, bool expired, const URLRows& deleted_rows, - const std::set<GURL>& favicon_urls) override{}; + const std::set<GURL>& favicon_urls) override {} void NotifyKeywordSearchTermUpdated(const URLRow& row, KeywordID keyword_id, - const base::string16& term) override{}; - void NotifyKeywordSearchTermDeleted(URLID url_id) override{}; - void DBLoaded() override{}; + const base::string16& term) override {} + void NotifyKeywordSearchTermDeleted(URLID url_id) override {} + void DBLoaded() override {} private: DISALLOW_COPY_AND_ASSIGN(TestHistoryBackendDelegate);
diff --git a/components/history/core/browser/typed_url_syncable_service_unittest.cc b/components/history/core/browser/typed_url_syncable_service_unittest.cc index 9367396..844b182b 100644 --- a/components/history/core/browser/typed_url_syncable_service_unittest.cc +++ b/components/history/core/browser/typed_url_syncable_service_unittest.cc
@@ -154,23 +154,23 @@ void NotifyProfileError(sql::InitStatus init_status, const std::string& diagnostics) override {} void SetInMemoryBackend( - std::unique_ptr<InMemoryHistoryBackend> backend) override{}; + std::unique_ptr<InMemoryHistoryBackend> backend) override {} void NotifyFaviconsChanged(const std::set<GURL>& page_urls, - const GURL& icon_url) override{}; + const GURL& icon_url) override {} void NotifyURLVisited(ui::PageTransition transition, const URLRow& row, const RedirectList& redirects, - base::Time visit_time) override{}; - void NotifyURLsModified(const URLRows& changed_urls) override{}; + base::Time visit_time) override {} + void NotifyURLsModified(const URLRows& changed_urls) override {} void NotifyURLsDeleted(bool all_history, bool expired, const URLRows& deleted_rows, - const std::set<GURL>& favicon_urls) override{}; + const std::set<GURL>& favicon_urls) override {} void NotifyKeywordSearchTermUpdated(const URLRow& row, KeywordID keyword_id, - const base::string16& term) override{}; - void NotifyKeywordSearchTermDeleted(URLID url_id) override{}; - void DBLoaded() override{}; + const base::string16& term) override {} + void NotifyKeywordSearchTermDeleted(URLID url_id) override {} + void DBLoaded() override {} private: DISALLOW_COPY_AND_ASSIGN(TestHistoryBackendDelegate);
diff --git a/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc b/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc index a52a10e..60cafb4 100644 --- a/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc +++ b/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
@@ -60,7 +60,7 @@ bool IsTemporarilyHiddenInUI(const ClientId& client_id) override { return is_temporarily_hidden; } - void SetUIAdapter(DownloadUIAdapter* ui_adapter) override{}; + void SetUIAdapter(DownloadUIAdapter* ui_adapter) override {} bool is_visible = true; bool is_temporarily_hidden = false;
diff --git a/components/safe_browsing_db/test_database_manager.h b/components/safe_browsing_db/test_database_manager.h index 180723f0..37598e6 100644 --- a/components/safe_browsing_db/test_database_manager.h +++ b/components/safe_browsing_db/test_database_manager.h
@@ -48,7 +48,7 @@ void StopOnIOThread(bool shutdown) override; protected: - ~TestSafeBrowsingDatabaseManager() override {}; + ~TestSafeBrowsingDatabaseManager() override {} }; } // namespace safe_browsing
diff --git a/components/sync_sessions/revisit/page_revisit_broadcaster.cc b/components/sync_sessions/revisit/page_revisit_broadcaster.cc index cfeca0b..f887f26 100644 --- a/components/sync_sessions/revisit/page_revisit_broadcaster.cc +++ b/components/sync_sessions/revisit/page_revisit_broadcaster.cc
@@ -28,7 +28,7 @@ public: explicit SessionsSyncManagerWrapper(SessionsSyncManager* manager) : manager_(manager) {} - ~SessionsSyncManagerWrapper() override{}; + ~SessionsSyncManagerWrapper() override {} bool GetAllForeignSessions( std::vector<const SyncedSession*>* sessions) override { return manager_->GetAllForeignSessions(sessions);
diff --git a/components/sync_sessions/revisit/sessions_page_revisit_observer_unittest.cc b/components/sync_sessions/revisit/sessions_page_revisit_observer_unittest.cc index b86549e..f69c731 100644 --- a/components/sync_sessions/revisit/sessions_page_revisit_observer_unittest.cc +++ b/components/sync_sessions/revisit/sessions_page_revisit_observer_unittest.cc
@@ -31,7 +31,7 @@ TestForeignSessionsProvider(const std::vector<const SyncedSession*>& sessions, bool return_value) : sessions_(sessions), return_value_(return_value) {} - ~TestForeignSessionsProvider() override{}; + ~TestForeignSessionsProvider() override {} bool GetAllForeignSessions( std::vector<const SyncedSession*>* sessions) override {
diff --git a/components/url_formatter/idn_spoof_checker.cc b/components/url_formatter/idn_spoof_checker.cc index 930d1fc5..1c4d9bd 100644 --- a/components/url_formatter/idn_spoof_checker.cc +++ b/components/url_formatter/idn_spoof_checker.cc
@@ -240,6 +240,8 @@ // - Disallow combining diacritical mark (U+0300-U+0339) after a non-LGC // character. Other combining diacritical marks are not in the allowed // character set. + // - Disallow Arabic non-spacing marks after non-Arabic characters. + // - Disallow Hebrew non-spacing marks after non-Hebrew characters. dangerous_pattern = new icu::RegexMatcher( icu::UnicodeString( R"([^\p{scx=kana}\p{scx=hira}\p{scx=hani}])" @@ -256,7 +258,9 @@ R"([\p{scx=armn}][og]+[\p{scx=armn}]|)" R"([\p{sc=cans}].*[a-z]|[a-z].*[\p{sc=cans}]|)" R"([\p{sc=tfng}].*[a-z]|[a-z].*[\p{sc=tfng}]|)" - R"([^\p{scx=latn}\p{scx=grek}\p{scx=cyrl}][\u0300-\u0339])", + R"([^\p{scx=latn}\p{scx=grek}\p{scx=cyrl}][\u0300-\u0339]|)" + R"([^\p{scx=arab}][\u064b-\u0655\u0670]|)" + R"([^\p{scx=hebr}]\u05b4)", -1, US_INV), 0, status); tls_index.Set(dangerous_pattern);
diff --git a/components/url_formatter/url_formatter_unittest.cc b/components/url_formatter/url_formatter_unittest.cc index acb4de7..544f550 100644 --- a/components/url_formatter/url_formatter_unittest.cc +++ b/components/url_formatter/url_formatter_unittest.cc
@@ -53,483 +53,626 @@ // TODO(jshin): Replace L"..." with "..." in UTF-8 when it's easier to read. const IDNTestCase idn_cases[] = { - // No IDN - {"www.google.com", L"www.google.com", true}, - {"www.google.com.", L"www.google.com.", true}, - {".", L".", true}, - {"", L"", true}, - // IDN - // Hanzi (Traditional Chinese) - {"xn--1lq90ic7f1rc.cn", L"\x5317\x4eac\x5927\x5b78.cn", true}, - // Hanzi ('video' in Simplified Chinese - {"xn--cy2a840a.com", L"\x89c6\x9891.com", true}, - // Hanzi + '123' - {"www.xn--123-p18d.com", L"www.\x4e00" L"123.com", true}, - // Hanzi + Latin : U+56FD is simplified - {"www.xn--hello-9n1hm04c.com", L"www.hello\x4e2d\x56fd.com", true}, - // Kanji + Kana (Japanese) - {"xn--l8jvb1ey91xtjb.jp", L"\x671d\x65e5\x3042\x3055\x3072.jp", true}, - // Katakana including U+30FC - {"xn--tckm4i2e.jp", L"\x30b3\x30de\x30fc\x30b9.jp", true}, - {"xn--3ck7a7g.jp", L"\u30ce\u30f3\u30bd.jp", true}, - // Katakana + Latin (Japanese) - {"xn--e-efusa1mzf.jp", L"e\x30b3\x30de\x30fc\x30b9.jp", true}, - {"xn--3bkxe.jp", L"\x30c8\x309a.jp", true}, - // Hangul (Korean) - {"www.xn--or3b17p6jjc.kr", L"www.\xc804\xc790\xc815\xbd80.kr", true}, - // b<u-umlaut>cher (German) - {"xn--bcher-kva.de", L"b\x00fc" L"cher.de", true}, - // a with diaeresis - {"www.xn--frgbolaget-q5a.se", L"www.f\x00e4rgbolaget.se", true}, - // c-cedilla (French) - {"www.xn--alliancefranaise-npb.fr", - L"www.alliancefran\x00e7" L"aise.fr", true}, - // caf'e with acute accent' (French) - {"xn--caf-dma.fr", L"caf\x00e9.fr", true}, - // c-cedillla and a with tilde (Portuguese) - {"xn--poema-9qae5a.com.br", L"p\x00e3oema\x00e7\x00e3.com.br", true}, - // s with caron - {"xn--achy-f6a.com", L"\x0161" L"achy.com", true}, - {"xn--kxae4bafwg.gr", L"\x03bf\x03c5\x03c4\x03bf\x03c0\x03af\x03b1.gr", - true}, - // Eutopia + 123 (Greek) - {"xn---123-pldm0haj2bk.gr", - L"\x03bf\x03c5\x03c4\x03bf\x03c0\x03af\x03b1-123.gr", true}, - // Cyrillic (Russian) - {"xn--n1aeec9b.ru", L"\x0442\x043e\x0440\x0442\x044b.ru", true}, - // Cyrillic + 123 (Russian) - {"xn---123-45dmmc5f.ru", L"\x0442\x043e\x0440\x0442\x044b-123.ru", true}, - // 'president' in Russian. Is a wholescript confusable, but allowed. - {"xn--d1abbgf6aiiy.xn--p1ai", - L"\x043f\x0440\x0435\x0437\x0438\x0434\x0435\x043d\x0442.\x0440\x0444", - true}, - // Arabic - {"xn--mgba1fmg.eg", L"\x0627\x0641\x0644\x0627\x0645.eg", true}, - // Hebrew - {"xn--4dbib.he", L"\x05d5\x05d0\x05d4.he", true}, - // Hebrew + Common - {"xn---123-ptf2c5c6bt.il", L"\x05e2\x05d1\x05e8\x05d9\x05ea-123.il", true}, - // Thai - {"xn--12c2cc4ag3b4ccu.th", - L"\x0e2a\x0e32\x0e22\x0e01\x0e32\x0e23\x0e1a\x0e34\x0e19.th", true}, - // Thai + Common - {"xn---123-9goxcp8c9db2r.th", - L"\x0e20\x0e32\x0e29\x0e32\x0e44\x0e17\x0e22-123.th", true}, - // Devangari (Hindi) - {"www.xn--l1b6a9e1b7c.in", L"www.\x0905\x0915\x094b\x0932\x093e.in", true}, - // Devanagari + Common - {"xn---123-kbjl2j0bl2k.in", - L"\x0939\x093f\x0928\x094d\x0926\x0940-123.in", true}, + // No IDN + {"www.google.com", L"www.google.com", true}, + {"www.google.com.", L"www.google.com.", true}, + {".", L".", true}, + {"", L"", true}, + // IDN + // Hanzi (Traditional Chinese) + {"xn--1lq90ic7f1rc.cn", L"\x5317\x4eac\x5927\x5b78.cn", true}, + // Hanzi ('video' in Simplified Chinese + {"xn--cy2a840a.com", L"\x89c6\x9891.com", true}, + // Hanzi + '123' + {"www.xn--123-p18d.com", + L"www.\x4e00" + L"123.com", + true}, + // Hanzi + Latin : U+56FD is simplified + {"www.xn--hello-9n1hm04c.com", L"www.hello\x4e2d\x56fd.com", true}, + // Kanji + Kana (Japanese) + {"xn--l8jvb1ey91xtjb.jp", L"\x671d\x65e5\x3042\x3055\x3072.jp", true}, + // Katakana including U+30FC + {"xn--tckm4i2e.jp", L"\x30b3\x30de\x30fc\x30b9.jp", true}, + {"xn--3ck7a7g.jp", L"\u30ce\u30f3\u30bd.jp", true}, + // Katakana + Latin (Japanese) + {"xn--e-efusa1mzf.jp", L"e\x30b3\x30de\x30fc\x30b9.jp", true}, + {"xn--3bkxe.jp", L"\x30c8\x309a.jp", true}, + // Hangul (Korean) + {"www.xn--or3b17p6jjc.kr", L"www.\xc804\xc790\xc815\xbd80.kr", true}, + // b<u-umlaut>cher (German) + {"xn--bcher-kva.de", + L"b\x00fc" + L"cher.de", + true}, + // a with diaeresis + {"www.xn--frgbolaget-q5a.se", L"www.f\x00e4rgbolaget.se", true}, + // c-cedilla (French) + {"www.xn--alliancefranaise-npb.fr", + L"www.alliancefran\x00e7" + L"aise.fr", + true}, + // caf'e with acute accent' (French) + {"xn--caf-dma.fr", L"caf\x00e9.fr", true}, + // c-cedillla and a with tilde (Portuguese) + {"xn--poema-9qae5a.com.br", L"p\x00e3oema\x00e7\x00e3.com.br", true}, + // s with caron + {"xn--achy-f6a.com", + L"\x0161" + L"achy.com", + true}, + {"xn--kxae4bafwg.gr", L"\x03bf\x03c5\x03c4\x03bf\x03c0\x03af\x03b1.gr", + true}, + // Eutopia + 123 (Greek) + {"xn---123-pldm0haj2bk.gr", + L"\x03bf\x03c5\x03c4\x03bf\x03c0\x03af\x03b1-123.gr", true}, + // Cyrillic (Russian) + {"xn--n1aeec9b.ru", L"\x0442\x043e\x0440\x0442\x044b.ru", true}, + // Cyrillic + 123 (Russian) + {"xn---123-45dmmc5f.ru", L"\x0442\x043e\x0440\x0442\x044b-123.ru", true}, + // 'president' in Russian. Is a wholescript confusable, but allowed. + {"xn--d1abbgf6aiiy.xn--p1ai", + L"\x043f\x0440\x0435\x0437\x0438\x0434\x0435\x043d\x0442.\x0440\x0444", + true}, + // Arabic + {"xn--mgba1fmg.eg", L"\x0627\x0641\x0644\x0627\x0645.eg", true}, + // Hebrew + {"xn--4dbib.he", L"\x05d5\x05d0\x05d4.he", true}, + // Hebrew + Common + {"xn---123-ptf2c5c6bt.il", L"\x05e2\x05d1\x05e8\x05d9\x05ea-123.il", true}, + // Thai + {"xn--12c2cc4ag3b4ccu.th", + L"\x0e2a\x0e32\x0e22\x0e01\x0e32\x0e23\x0e1a\x0e34\x0e19.th", true}, + // Thai + Common + {"xn---123-9goxcp8c9db2r.th", + L"\x0e20\x0e32\x0e29\x0e32\x0e44\x0e17\x0e22-123.th", true}, + // Devangari (Hindi) + {"www.xn--l1b6a9e1b7c.in", L"www.\x0905\x0915\x094b\x0932\x093e.in", true}, + // Devanagari + Common + {"xn---123-kbjl2j0bl2k.in", L"\x0939\x093f\x0928\x094d\x0926\x0940-123.in", + true}, - // 5 Aspirational scripts - // Unifieid Canadian Syllabary - {"xn--dfe0tte.ca", L"\x1456\x14c2\x14ef.ca", true}, - // Tifinagh - {"xn--4ljxa2bb4a6bxb.ma", - L"\x2d5c\x2d49\x2d3c\x2d49\x2d4f\x2d30\x2d56.ma", true}, - // Tifinagh with a disallowed character(U+2D6F) - {"xn--hmjzaby5d5f.ma", L"\x2d5c\x2d49\x2d3c\x2d6f\x2d49\x2d4f.ma", false}, - // Yi - {"xn--4o7a6e1x64c.cn", L"\xa188\xa320\xa071\xa0b7.cn", true}, - // Mongolian - 'ordu' (place, camp) - {"xn--56ec8bp.cn", L"\x1823\x1837\x1833\x1824.cn", true}, - // Mongolian with a disallowed character - {"xn--95e5de3ds.cn", L"\x1823\x1837\x1804\x1833\x1824.cn", false}, - // Miao/Pollad - {"xn--2u0fpf0a.cn", L"\U00016f04\U00016f62\U00016f59.cn", true}, + // 5 Aspirational scripts + // Unifieid Canadian Syllabary + {"xn--dfe0tte.ca", L"\x1456\x14c2\x14ef.ca", true}, + // Tifinagh + {"xn--4ljxa2bb4a6bxb.ma", L"\x2d5c\x2d49\x2d3c\x2d49\x2d4f\x2d30\x2d56.ma", + true}, + // Tifinagh with a disallowed character(U+2D6F) + {"xn--hmjzaby5d5f.ma", L"\x2d5c\x2d49\x2d3c\x2d6f\x2d49\x2d4f.ma", false}, + // Yi + {"xn--4o7a6e1x64c.cn", L"\xa188\xa320\xa071\xa0b7.cn", true}, + // Mongolian - 'ordu' (place, camp) + {"xn--56ec8bp.cn", L"\x1823\x1837\x1833\x1824.cn", true}, + // Mongolian with a disallowed character + {"xn--95e5de3ds.cn", L"\x1823\x1837\x1804\x1833\x1824.cn", false}, + // Miao/Pollad + {"xn--2u0fpf0a.cn", L"\U00016f04\U00016f62\U00016f59.cn", true}, - // Script mixing tests - // The following script combinations are allowed. - // MODERATELY_RESTRICTIVE with Latin limited to ASCII-Latin. - // ASCII-Latin + Japn (Kana + Han) - // ASCII-Latin + Kore (Hangul + Han) - // ASCII-Latin + Han + Bopomofo - // ASCII-Latin + any allowed script other than Cyrillic, Greek, Cherokee - // and Unified Canadian Syllabary - // "payp<alpha>l.com" - {"www.xn--paypl-g9d.com", L"payp\x03b1l.com", false}, - // google.gr with Greek omicron and epsilon - {"xn--ggl-6xc1ca.gr", L"g\x03bf\x03bfgl\x03b5.gr", false}, - // google.ru with Cyrillic o - {"xn--ggl-tdd6ba.ru", L"g\x043e\x043egl\x0435.ru", false}, - // h<e with acute>llo<China in Han>.cn - {"xn--hllo-bpa7979ih5m.cn", L"h\x00e9llo\x4e2d\x56fd.cn", false}, - // <Greek rho><Cyrillic a><Cyrillic u>.ru - {"xn--2xa6t2b.ru", L"\x03c1\x0430\x0443.ru", false}, - // Hangul + Latin - {"xn--han-eb9ll88m.kr", L"\xd55c\xae00han.kr", true}, - // Hangul + Latin + Han with IDN ccTLD - {"xn--han-or0kq92gkm3c.xn--3e0b707e", - L"\xd55c\xae00han\x97d3.\xd55c\xad6d", true}, - // non-ASCII Latin + Hangul - {"xn--caf-dma9024xvpg.kr", L"caf\x00e9\xce74\xd398.kr", false}, - // Hangul + Hiragana - {"xn--y9j3b9855e.kr", L"\xd55c\x3072\x3089.kr", false}, - // <Hiragana>.<Hangul> is allowed because script mixing check is per label. - {"xn--y9j3b.xn--3e0b707e", L"\x3072\x3089.\xd55c\xad6d", true}, - // Traditional Han + Latin - {"xn--hanzi-u57ii69i.tw", L"\x6f22\x5b57hanzi.tw", true}, - // Simplified Han + Latin - {"xn--hanzi-u57i952h.cn", L"\x6c49\x5b57hanzi.cn", true}, - // Simplified Han + Traditonal Han - {"xn--hanzi-if9kt8n.cn", L"\x6c49\x6f22hanzi.cn", true}, - // Han + Hiragana + Katakana + Latin - {"xn--kanji-ii4dpizfq59yuykqr4b.jp", - L"\x632f\x308a\x4eee\x540d\x30ab\x30bfkanji.jp", true}, - // Han + Bopomofo - {"xn--5ekcde0577e87tc.tw", L"\x6ce8\x97f3\x3105\x3106\x3107\x3108.tw", true}, - // Han + Latin + Bopomofo - {"xn--bopo-ty4cghi8509kk7xd.tw", - L"\x6ce8\x97f3" L"bopo\x3105\x3106\x3107\x3108.tw", true}, - // Latin + Bopomofo - {"xn--bopomofo-hj5gkalm.tw", L"bopomofo\x3105\x3106\x3107\x3108.tw", true}, - // Bopomofo + Katakana - {"xn--lcka3d1bztghi.tw", - L"\x3105\x3106\x3107\x3108\x30ab\x30bf\x30ab\x30ca.tw", false}, - // Bopomofo + Hangul - {"xn--5ekcde4543qbec.tw", L"\x3105\x3106\x3107\x3108\xc8fc\xc74c.tw", false}, - // Devanagari + Latin - {"xn--ab-3ofh8fqbj6h.in", L"ab\x0939\x093f\x0928\x094d\x0926\x0940.in", true}, - // Thai + Latin - {"xn--ab-jsi9al4bxdb6n.th", - L"ab\x0e20\x0e32\x0e29\x0e32\x0e44\x0e17\x0e22.th", true}, - // <vitamin in Katakana>b1.com - {"xn--b1-xi4a7cvc9f.com", L"\x30d3\x30bf\x30df\x30f3" L"b1.com", true}, - // Devanagari + Han - {"xn--t2bes3ds6749n.com", L"\x0930\x094b\x0932\x0947\x76e7\x0938.com", false}, - // Devanagari + Bengali - {"xn--11b0x.in", L"\x0915\x0995.in", false}, - // Canadian Syllabary + Latin - {"xn--ab-lym.com", L"ab\x14BF.com", false}, - {"xn--ab1-p6q.com", L"ab1\x14BF.com", false}, - {"xn--1ab-m6qd.com", L"\x14BF" L"1ab.com", false}, - {"xn--ab-jymc.com", L"\x14BF" L"ab.com", false}, - // Tifinagh + Latin - {"xn--liy-go4a.com", L"li\u24dfy.com", false}, - {"xn--rol-ho4a.com", L"rol\u24df.com", false}, - {"xn--ily-eo4a.com", L"\u24dfily.com", false}, - {"xn--1ly-eo4a.com", L"\u24df1ly.com", false}, + // Script mixing tests + // The following script combinations are allowed. + // MODERATELY_RESTRICTIVE with Latin limited to ASCII-Latin. + // ASCII-Latin + Japn (Kana + Han) + // ASCII-Latin + Kore (Hangul + Han) + // ASCII-Latin + Han + Bopomofo + // ASCII-Latin + any allowed script other than Cyrillic, Greek, Cherokee + // and Unified Canadian Syllabary + // "payp<alpha>l.com" + {"www.xn--paypl-g9d.com", L"payp\x03b1l.com", false}, + // google.gr with Greek omicron and epsilon + {"xn--ggl-6xc1ca.gr", L"g\x03bf\x03bfgl\x03b5.gr", false}, + // google.ru with Cyrillic o + {"xn--ggl-tdd6ba.ru", L"g\x043e\x043egl\x0435.ru", false}, + // h<e with acute>llo<China in Han>.cn + {"xn--hllo-bpa7979ih5m.cn", L"h\x00e9llo\x4e2d\x56fd.cn", false}, + // <Greek rho><Cyrillic a><Cyrillic u>.ru + {"xn--2xa6t2b.ru", L"\x03c1\x0430\x0443.ru", false}, + // Hangul + Latin + {"xn--han-eb9ll88m.kr", L"\xd55c\xae00han.kr", true}, + // Hangul + Latin + Han with IDN ccTLD + {"xn--han-or0kq92gkm3c.xn--3e0b707e", L"\xd55c\xae00han\x97d3.\xd55c\xad6d", + true}, + // non-ASCII Latin + Hangul + {"xn--caf-dma9024xvpg.kr", L"caf\x00e9\xce74\xd398.kr", false}, + // Hangul + Hiragana + {"xn--y9j3b9855e.kr", L"\xd55c\x3072\x3089.kr", false}, + // <Hiragana>.<Hangul> is allowed because script mixing check is per label. + {"xn--y9j3b.xn--3e0b707e", L"\x3072\x3089.\xd55c\xad6d", true}, + // Traditional Han + Latin + {"xn--hanzi-u57ii69i.tw", L"\x6f22\x5b57hanzi.tw", true}, + // Simplified Han + Latin + {"xn--hanzi-u57i952h.cn", L"\x6c49\x5b57hanzi.cn", true}, + // Simplified Han + Traditonal Han + {"xn--hanzi-if9kt8n.cn", L"\x6c49\x6f22hanzi.cn", true}, + // Han + Hiragana + Katakana + Latin + {"xn--kanji-ii4dpizfq59yuykqr4b.jp", + L"\x632f\x308a\x4eee\x540d\x30ab\x30bfkanji.jp", true}, + // Han + Bopomofo + {"xn--5ekcde0577e87tc.tw", L"\x6ce8\x97f3\x3105\x3106\x3107\x3108.tw", + true}, + // Han + Latin + Bopomofo + {"xn--bopo-ty4cghi8509kk7xd.tw", + L"\x6ce8\x97f3" + L"bopo\x3105\x3106\x3107\x3108.tw", + true}, + // Latin + Bopomofo + {"xn--bopomofo-hj5gkalm.tw", L"bopomofo\x3105\x3106\x3107\x3108.tw", true}, + // Bopomofo + Katakana + {"xn--lcka3d1bztghi.tw", + L"\x3105\x3106\x3107\x3108\x30ab\x30bf\x30ab\x30ca.tw", false}, + // Bopomofo + Hangul + {"xn--5ekcde4543qbec.tw", L"\x3105\x3106\x3107\x3108\xc8fc\xc74c.tw", + false}, + // Devanagari + Latin + {"xn--ab-3ofh8fqbj6h.in", L"ab\x0939\x093f\x0928\x094d\x0926\x0940.in", + true}, + // Thai + Latin + {"xn--ab-jsi9al4bxdb6n.th", + L"ab\x0e20\x0e32\x0e29\x0e32\x0e44\x0e17\x0e22.th", true}, + // <vitamin in Katakana>b1.com + {"xn--b1-xi4a7cvc9f.com", + L"\x30d3\x30bf\x30df\x30f3" + L"b1.com", + true}, + // Devanagari + Han + {"xn--t2bes3ds6749n.com", L"\x0930\x094b\x0932\x0947\x76e7\x0938.com", + false}, + // Devanagari + Bengali + {"xn--11b0x.in", L"\x0915\x0995.in", false}, + // Canadian Syllabary + Latin + {"xn--ab-lym.com", L"ab\x14BF.com", false}, + {"xn--ab1-p6q.com", L"ab1\x14BF.com", false}, + {"xn--1ab-m6qd.com", + L"\x14BF" + L"1ab.com", + false}, + {"xn--ab-jymc.com", + L"\x14BF" + L"ab.com", + false}, + // Tifinagh + Latin + {"xn--liy-go4a.com", L"li\u24dfy.com", false}, + {"xn--rol-ho4a.com", L"rol\u24df.com", false}, + {"xn--ily-eo4a.com", L"\u24dfily.com", false}, + {"xn--1ly-eo4a.com", L"\u24df1ly.com", false}, - // Invisibility check - // Thai tone mark malek(U+0E48) repeated - {"xn--03c0b3ca.th", L"\x0e23\x0e35\x0e48\x0e48.th", false}, - // Accute accent repeated - {"xn--a-xbba.com", L"a\x0301\x0301.com", false}, - // 'a' with acuted accent + another acute accent - {"xn--1ca20i.com", L"\x00e1\x0301.com", false}, - // Combining mark at the beginning - {"xn--abc-fdc.jp", L"\x0300" L"abc.jp", false}, + // Invisibility check + // Thai tone mark malek(U+0E48) repeated + {"xn--03c0b3ca.th", L"\x0e23\x0e35\x0e48\x0e48.th", false}, + // Accute accent repeated + {"xn--a-xbba.com", L"a\x0301\x0301.com", false}, + // 'a' with acuted accent + another acute accent + {"xn--1ca20i.com", L"\x00e1\x0301.com", false}, + // Combining mark at the beginning + {"xn--abc-fdc.jp", + L"\x0300" + L"abc.jp", + false}, - // Mixed script confusable - // google with Armenian Small Letter Oh(U+0585) - {"xn--gogle-lkg.com", L"g\x0585ogle.com", false}, - {"xn--range-kkg.com", L"\x0585range.com", false}, - {"xn--cucko-pkg.com", L"cucko\x0585.com", false}, - // Latin 'o' in Armenian. - {"xn--o-ybcg0cu0cq.com", - L"o\x0585\x0580\x0574\x0578\x0582\x0566\x0568.com", false}, - // Hiragana HE(U+3078) mixed with Katakana - {"xn--49jxi3as0d0fpc.com", - L"\x30e2\x30d2\x30fc\x30c8\x3078\x30d6\x30f3.com", false}, + // Mixed script confusable + // google with Armenian Small Letter Oh(U+0585) + {"xn--gogle-lkg.com", L"g\x0585ogle.com", false}, + {"xn--range-kkg.com", L"\x0585range.com", false}, + {"xn--cucko-pkg.com", L"cucko\x0585.com", false}, + // Latin 'o' in Armenian. + {"xn--o-ybcg0cu0cq.com", L"o\x0585\x0580\x0574\x0578\x0582\x0566\x0568.com", + false}, + // Hiragana HE(U+3078) mixed with Katakana + {"xn--49jxi3as0d0fpc.com", + L"\x30e2\x30d2\x30fc\x30c8\x3078\x30d6\x30f3.com", false}, - // U+30FC should be preceded by a Hiragana/Katakana. - // Katakana + U+30FC + Han - {"xn--lck0ip02qw5ya.jp", L"\x30ab\x30fc\x91ce\x7403.jp", true}, - // Hiragana + U+30FC + Han - {"xn--u8j5tr47nw5ya.jp", L"\x304b\x30fc\x91ce\x7403.jp", true}, - // U+30FC + Han - {"xn--weka801xo02a.com", L"\x30fc\x52d5\x753b\x30fc.com", false}, - // Han + U+30FC + Han - {"xn--wekz60nb2ay85atj0b.jp", L"\x65e5\x672c\x30fc\x91ce\x7403.jp", false}, - // U+30FC at the beginning - {"xn--wek060nb2a.jp", L"\x30fc\x65e5\x672c", false}, - // Latin + U+30FC + Latin - {"xn--abcdef-r64e.jp", L"abc\x30fc" L"def.jp", false}, + // U+30FC should be preceded by a Hiragana/Katakana. + // Katakana + U+30FC + Han + {"xn--lck0ip02qw5ya.jp", L"\x30ab\x30fc\x91ce\x7403.jp", true}, + // Hiragana + U+30FC + Han + {"xn--u8j5tr47nw5ya.jp", L"\x304b\x30fc\x91ce\x7403.jp", true}, + // U+30FC + Han + {"xn--weka801xo02a.com", L"\x30fc\x52d5\x753b\x30fc.com", false}, + // Han + U+30FC + Han + {"xn--wekz60nb2ay85atj0b.jp", L"\x65e5\x672c\x30fc\x91ce\x7403.jp", false}, + // U+30FC at the beginning + {"xn--wek060nb2a.jp", L"\x30fc\x65e5\x672c", false}, + // Latin + U+30FC + Latin + {"xn--abcdef-r64e.jp", + L"abc\x30fc" + L"def.jp", + false}, - // U+30FB (・) is not allowed next to Latin, but allowed otherwise. - // U+30FB + Han - {"xn--vekt920a.jp", L"\x30fb\x91ce.jp", true}, - // Han + U+30FB + Han - {"xn--vek160nb2ay85atj0b.jp", L"\x65e5\x672c\x30fb\x91ce\x7403.jp", true}, - // Latin + U+30FB + Latin - {"xn--abcdef-k64e.jp", L"abc\x30fb" L"def.jp", false}, - // U+30FB + Latin - {"xn--abc-os4b.jp", L"\x30fb" L"abc.jp", false}, + // U+30FB (・) is not allowed next to Latin, but allowed otherwise. + // U+30FB + Han + {"xn--vekt920a.jp", L"\x30fb\x91ce.jp", true}, + // Han + U+30FB + Han + {"xn--vek160nb2ay85atj0b.jp", L"\x65e5\x672c\x30fb\x91ce\x7403.jp", true}, + // Latin + U+30FB + Latin + {"xn--abcdef-k64e.jp", + L"abc\x30fb" + L"def.jp", + false}, + // U+30FB + Latin + {"xn--abc-os4b.jp", + L"\x30fb" + L"abc.jp", + false}, - // U+30FD (ヽ) is allowed only after Katakana. - // Katakana + U+30FD - {"xn--lck2i.jp", L"\x30ab\x30fd.jp", true}, - // Hiragana + U+30FD - {"xn--u8j7t.jp", L"\x304b\x30fd.jp", false}, - // Han + U+30FD - {"xn--xek368f.jp", L"\x4e00\x30fd.jp", false}, - {"xn--aa-mju.jp", L"a\x30fd.jp", false}, - {"xn--a1-bo4a.jp", L"a1\x30fd.jp", false}, + // U+30FD (ヽ) is allowed only after Katakana. + // Katakana + U+30FD + {"xn--lck2i.jp", L"\x30ab\x30fd.jp", true}, + // Hiragana + U+30FD + {"xn--u8j7t.jp", L"\x304b\x30fd.jp", false}, + // Han + U+30FD + {"xn--xek368f.jp", L"\x4e00\x30fd.jp", false}, + {"xn--aa-mju.jp", L"a\x30fd.jp", false}, + {"xn--a1-bo4a.jp", L"a1\x30fd.jp", false}, - // U+30FE (ヾ) is allowed only after Katakana. - // Katakana + U+30FE - {"xn--lck4i.jp", L"\x30ab\x30fe.jp", true}, - // Hiragana + U+30FE - {"xn--u8j9t.jp", L"\x304b\x30fe.jp", false}, - // Han + U+30FE - {"xn--yek168f.jp", L"\x4e00\x30fe.jp", false}, - {"xn--a-oju.jp", L"a\x30fe.jp", false}, - {"xn--a1-eo4a.jp", L"a1\x30fe.jp", false}, + // U+30FE (ヾ) is allowed only after Katakana. + // Katakana + U+30FE + {"xn--lck4i.jp", L"\x30ab\x30fe.jp", true}, + // Hiragana + U+30FE + {"xn--u8j9t.jp", L"\x304b\x30fe.jp", false}, + // Han + U+30FE + {"xn--yek168f.jp", L"\x4e00\x30fe.jp", false}, + {"xn--a-oju.jp", L"a\x30fe.jp", false}, + {"xn--a1-eo4a.jp", L"a1\x30fe.jp", false}, - // Cyrillic labels made of Latin-look-alike Cyrillic letters. - // ѕсоре.com with ѕсоре in Cyrillic - {"xn--e1argc3h.com", L"\x0455\x0441\x043e\x0440\x0435.com", false}, - // ѕсоре123.com with ѕсоре in Cyrillic. - {"xn--123-qdd8bmf3n.com", - L"\x0455\x0441\x043e\x0440\x0435" L"123.com", false}, - // ѕсоре-рау.com with ѕсоре and рау in Cyrillic. - {"xn----8sbn9akccw8m.com", - L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.com", false}, - // ѕсоре·рау.com with scope and pay in Cyrillic and U+00B7 between them. - {"xn--uba29ona9akccw8m.com", - L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.com", false}, + // Cyrillic labels made of Latin-look-alike Cyrillic letters. + // ѕсоре.com with ѕсоре in Cyrillic + {"xn--e1argc3h.com", L"\x0455\x0441\x043e\x0440\x0435.com", false}, + // ѕсоре123.com with ѕсоре in Cyrillic. + {"xn--123-qdd8bmf3n.com", + L"\x0455\x0441\x043e\x0440\x0435" + L"123.com", + false}, + // ѕсоре-рау.com with ѕсоре and рау in Cyrillic. + {"xn----8sbn9akccw8m.com", + L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.com", false}, + // ѕсоре·рау.com with scope and pay in Cyrillic and U+00B7 between them. + {"xn--uba29ona9akccw8m.com", + L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.com", false}, - // The same as above three, but in IDN TLD. - {"xn--e1argc3h.xn--p1ai", - L"\x0455\x0441\x043e\x0440\x0435.\x0440\x0444", true}, - {"xn--123-qdd8bmf3n.xn--p1ai", - L"\x0455\x0441\x043e\x0440\x0435" L"123.\x0440\x0444", true}, - {"xn--uba29ona9akccw8m.xn--p1ai", - L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.\x0440\x0444", - true}, + // The same as above three, but in IDN TLD. + {"xn--e1argc3h.xn--p1ai", L"\x0455\x0441\x043e\x0440\x0435.\x0440\x0444", + true}, + {"xn--123-qdd8bmf3n.xn--p1ai", + L"\x0455\x0441\x043e\x0440\x0435" + L"123.\x0440\x0444", + true}, + {"xn--uba29ona9akccw8m.xn--p1ai", + L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.\x0440\x0444", + true}, - // ѕсоре-рау.한국 with ѕсоре and рау in Cyrillic. - {"xn----8sbn9akccw8m.xn--3e0b707e", - L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.\xd55c\xad6d", true}, + // ѕсоре-рау.한국 with ѕсоре and рау in Cyrillic. + {"xn----8sbn9akccw8m.xn--3e0b707e", + L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.\xd55c\xad6d", true}, - // музей (museum in Russian) has characters without a Latin-look-alike. - {"xn--e1adhj9a.com", L"\x043c\x0443\x0437\x0435\x0439.com", true}, + // музей (museum in Russian) has characters without a Latin-look-alike. + {"xn--e1adhj9a.com", L"\x043c\x0443\x0437\x0435\x0439.com", true}, - // Combining Diacritic marks after a script other than Latin-Greek-Cyrillic - {"xn--rsa2568fvxya.com", L"\xd55c\x0301\xae00.com", false}, // 한́글.com - {"xn--rsa0336bjom.com", L"\x6f22\x0307\x5b57.com", false}, // 漢̇字.com - // नागरी́.com - {"xn--lsa922apb7a6do.com", L"\x0928\x093e\x0917\x0930\x0940\x0301.com", - false}, + // Combining Diacritic marks after a script other than Latin-Greek-Cyrillic + {"xn--rsa2568fvxya.com", L"\xd55c\x0301\xae00.com", false}, // 한́글.com + {"xn--rsa0336bjom.com", L"\x6f22\x0307\x5b57.com", false}, // 漢̇字.com + // नागरी́.com + {"xn--lsa922apb7a6do.com", L"\x0928\x093e\x0917\x0930\x0940\x0301.com", + false}, - // Similarity checks against the list of top domains. "digklmo68.com" and - // 'digklmo68.co.uk" are listed for unittest in the top domain list. - {"xn--igklmo68-nea32c.com", L"\x0111igklmo68.com", false}, // đigklmo68.com - {"www.xn--igklmo68-nea32c.com", L"www.\x0111igklmo68.com", false}, - {"foo.bar.xn--igklmo68-nea32c.com", L"foo.bar.\x0111igklmo68.com", false}, - {"xn--igklmo68-nea32c.co.uk", L"\x0111igklmo68.co.uk", false}, - {"mail.xn--igklmo68-nea32c.co.uk", L"mail.\x0111igklmo68.co.uk", false}, - {"xn--digklmo68-6jf.com", L"di\x0307gklmo68.com", false}, // di̇gklmo68.com - {"xn--digklmo68-7vf.com", L"dig\x0331klmo68.com", false}, // dig̱klmo68.com - {"xn--diglmo68-omb.com", L"dig\x0138lmo68.com", false}, // digĸlmo68.com - {"xn--digkmo68-9ob.com", L"digk\x0142mo68.com", false}, // digkłmo68.com - {"xn--digklo68-l89c.com", L"digkl\x1e43o68.com", false}, // digklṃo68.com - {"xn--digklm68-b5a.com", L"digklm\x00f8" L"68.com", false}, // digklmø68.com - {"xn--digklmo8-h7g.com", L"digklmo\x0431" L"8.com", false}, // digklmoб8.com - {"xn--digklmo6-7yr.com", L"digklmo6\x09ea.com", false}, // digklmo6৪.com + // Similarity checks against the list of top domains. "digklmo68.com" and + // 'digklmo68.co.uk" are listed for unittest in the top domain list. + {"xn--igklmo68-nea32c.com", L"\x0111igklmo68.com", false}, // đigklmo68.com + {"www.xn--igklmo68-nea32c.com", L"www.\x0111igklmo68.com", false}, + {"foo.bar.xn--igklmo68-nea32c.com", L"foo.bar.\x0111igklmo68.com", false}, + {"xn--igklmo68-nea32c.co.uk", L"\x0111igklmo68.co.uk", false}, + {"mail.xn--igklmo68-nea32c.co.uk", L"mail.\x0111igklmo68.co.uk", false}, + {"xn--digklmo68-6jf.com", L"di\x0307gklmo68.com", false}, // di̇gklmo68.com + {"xn--digklmo68-7vf.com", L"dig\x0331klmo68.com", false}, // dig̱klmo68.com + {"xn--diglmo68-omb.com", L"dig\x0138lmo68.com", false}, // digĸlmo68.com + {"xn--digkmo68-9ob.com", L"digk\x0142mo68.com", false}, // digkłmo68.com + {"xn--digklo68-l89c.com", L"digkl\x1e43o68.com", false}, // digklṃo68.com + {"xn--digklm68-b5a.com", + L"digklm\x00f8" + L"68.com", + false}, // digklmø68.com + {"xn--digklmo8-h7g.com", + L"digklmo\x0431" + L"8.com", + false}, // digklmoб8.com + {"xn--digklmo6-7yr.com", L"digklmo6\x09ea.com", false}, // digklmo6৪.com - // 'islkpx123.com' is listed for unitest in the top domain list. - // 'іѕӏкрх123' can look like 'islkpx123' in some fonts. - {"xn--123-bed4a4a6hh40i.com", - L"\x0456\x0455\x04cf\x043a\x0440\x0445" L"123.com", false}, + // 'islkpx123.com' is listed for unitest in the top domain list. + // 'іѕӏкрх123' can look like 'islkpx123' in some fonts. + {"xn--123-bed4a4a6hh40i.com", + L"\x0456\x0455\x04cf\x043a\x0440\x0445" + L"123.com", + false}, - // Mixed digits: the first two will also fail mixed script test - // Latin + ASCII digit + Deva digit - {"xn--asc1deva-j0q.co.in", L"asc1deva\x0967.co.in", false}, - // Latin + Deva digit + Beng digit - {"xn--devabeng-f0qu3f.co.in", L"deva\x0967" L"beng\x09e7.co.in", false}, - // ASCII digit + Deva digit - {"xn--79-v5f.co.in", L"7\x09ea" L"9.co.in", false}, - // Deva digit + Beng digit - {"xn--e4b0x.co.in", L"\x0967\x09e7.co.in", false}, - // U+4E00 (CJK Ideograph One) is not a digit - {"xn--d12-s18d.cn", L"d12\x4e00.cn", true}, - // One that's really long that will force a buffer realloc - {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaa", - L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - L"aaaaaaaa", - true}, + // Mixed digits: the first two will also fail mixed script test + // Latin + ASCII digit + Deva digit + {"xn--asc1deva-j0q.co.in", L"asc1deva\x0967.co.in", false}, + // Latin + Deva digit + Beng digit + {"xn--devabeng-f0qu3f.co.in", + L"deva\x0967" + L"beng\x09e7.co.in", + false}, + // ASCII digit + Deva digit + {"xn--79-v5f.co.in", + L"7\x09ea" + L"9.co.in", + false}, + // Deva digit + Beng digit + {"xn--e4b0x.co.in", L"\x0967\x09e7.co.in", false}, + // U+4E00 (CJK Ideograph One) is not a digit + {"xn--d12-s18d.cn", L"d12\x4e00.cn", true}, + // One that's really long that will force a buffer realloc + {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaa", + L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + L"aaaaaaaa", + true}, - // Not allowed; characters outside [:Identifier_Status=Allowed:] - // Limited Use Scripts: UTS 31 Table 7. - // Vai - {"xn--sn8a.com", L"\xa50b.com", false}, - // 'CARD' look-alike in Cherokee - {"xn--58db0a9q.com", L"\x13df\x13aa\x13a1\x13a0.com", false}, - // Scripts excluded from Identifiers: UTS 31 Table 4 - // Coptic - {"xn--5ya.com", L"\x03e7.com", false}, - // Old Italic - {"xn--097cc.com", L"\U00010300\U00010301.com", false}, + // Not allowed; characters outside [:Identifier_Status=Allowed:] + // Limited Use Scripts: UTS 31 Table 7. + // Vai + {"xn--sn8a.com", L"\xa50b.com", false}, + // 'CARD' look-alike in Cherokee + {"xn--58db0a9q.com", L"\x13df\x13aa\x13a1\x13a0.com", false}, + // Scripts excluded from Identifiers: UTS 31 Table 4 + // Coptic + {"xn--5ya.com", L"\x03e7.com", false}, + // Old Italic + {"xn--097cc.com", L"\U00010300\U00010301.com", false}, - // U+115F (Hangul Filler) - {"xn--osd3820f24c.kr", L"\xac00\xb098\x115f.kr", false}, - {"www.xn--google-ho0coa.com", L"www.\x2039google\x203a.com", false}, - // Latin small capital w: hardᴡare.com - {"xn--hardare-l41c.com", L"hard\x1d21" L"are.com", false}, - // Minus Sign(U+2212) - {"xn--t9g238xc2a.jp", L"\x65e5\x2212\x672c.jp", false}, - // Latin Small Letter Script G: ɡɡ.com - {"xn--0naa.com", L"\x0261\x0261.com", false}, - // Hangul Jamo(U+11xx) - {"xn--0pdc3b.com", L"\x1102\x1103\x1110.com", false}, - // degree sign: 36°c.com - {"xn--36c-tfa.com", L"36\x00b0" L"c.com", false}, - // Pound sign - {"xn--5free-9ga.com", L"5free\x00a8.com", false}, - // Hebrew points (U+05B0, U+05B6) - {"xn--7cbl2kc2a.com", L"\x05e1\x05b6\x05e7\x05b0\x05e1.com", false}, - // Danda(U+0964) - {"xn--81bp1b6ch8s.com", L"\x0924\x093f\x091c\x0964\x0930\x0940.com", false}, - // Small letter script G(U+0261) - {"xn--oogle-qmc.com", L"\x0261oogle.com", false}, - // Small Katakana Extension(U+31F1) - {"xn--wlk.com", L"\x31f1.com", false}, - // Heart symbol: ♥ - {"xn--ab-u0x.com", L"ab\x2665.com", false}, - // Emoji - {"xn--vi8hiv.xyz", L"\U0001f355\U0001f4a9.xyz", false}, - // Registered trade mark - {"xn--egistered-fna.com", L"\x00ae" L"egistered.com", false}, - // Latin Letter Retroflex Click - {"xn--registered-25c.com", L"registered\x01c3.com", false}, - // ASCII '!' not allowed in IDN - {"xn--!-257eu42c.kr", L"\xc548\xb155!.kr", false}, - // 'GOOGLE' in IPA extension: ɢᴏᴏɢʟᴇ - {"xn--1naa7pn51hcbaa.com", - L"\x0262\x1d0f\x1d0f\x0262\x029f\x1d07.com", false}, - // Padlock icon spoof. - {"xn--google-hj64e", L"\U0001f512google.com", false}, + // U+115F (Hangul Filler) + {"xn--osd3820f24c.kr", L"\xac00\xb098\x115f.kr", false}, + {"www.xn--google-ho0coa.com", L"www.\x2039google\x203a.com", false}, + // Latin small capital w: hardᴡare.com + {"xn--hardare-l41c.com", + L"hard\x1d21" + L"are.com", + false}, + // Minus Sign(U+2212) + {"xn--t9g238xc2a.jp", L"\x65e5\x2212\x672c.jp", false}, + // Latin Small Letter Script G: ɡɡ.com + {"xn--0naa.com", L"\x0261\x0261.com", false}, + // Hangul Jamo(U+11xx) + {"xn--0pdc3b.com", L"\x1102\x1103\x1110.com", false}, + // degree sign: 36°c.com + {"xn--36c-tfa.com", + L"36\x00b0" + L"c.com", + false}, + // Pound sign + {"xn--5free-9ga.com", L"5free\x00a8.com", false}, + // Hebrew points (U+05B0, U+05B6) + {"xn--7cbl2kc2a.com", L"\x05e1\x05b6\x05e7\x05b0\x05e1.com", false}, + // Danda(U+0964) + {"xn--81bp1b6ch8s.com", L"\x0924\x093f\x091c\x0964\x0930\x0940.com", false}, + // Small letter script G(U+0261) + {"xn--oogle-qmc.com", L"\x0261oogle.com", false}, + // Small Katakana Extension(U+31F1) + {"xn--wlk.com", L"\x31f1.com", false}, + // Heart symbol: ♥ + {"xn--ab-u0x.com", L"ab\x2665.com", false}, + // Emoji + {"xn--vi8hiv.xyz", L"\U0001f355\U0001f4a9.xyz", false}, + // Registered trade mark + {"xn--egistered-fna.com", + L"\x00ae" + L"egistered.com", + false}, + // Latin Letter Retroflex Click + {"xn--registered-25c.com", L"registered\x01c3.com", false}, + // ASCII '!' not allowed in IDN + {"xn--!-257eu42c.kr", L"\xc548\xb155!.kr", false}, + // 'GOOGLE' in IPA extension: ɢᴏᴏɢʟᴇ + {"xn--1naa7pn51hcbaa.com", L"\x0262\x1d0f\x1d0f\x0262\x029f\x1d07.com", + false}, + // Padlock icon spoof. + {"xn--google-hj64e", L"\U0001f512google.com", false}, - // Custom black list - // Combining Long Solidus Overlay - {"google.xn--comabc-k8d", L"google.com\x0338" L"abc", false}, - // Hyphenation Point instead of Katakana Middle dot - {"xn--svgy16dha.jp", L"\x30a1\x2027\x30a3.jp", false}, - // Gershayim with other Hebrew characters is allowed. - {"xn--5db6bh9b.il", L"\x05e9\x05d1\x05f4\x05e6.il", true}, - // Hebrew Gershayim with Latin is disallowed. - {"xn--ab-yod.com", L"a\x05f4" L"b.com", false}, - // Hebrew Gershayim with Arabic is disallowed. - {"xn--5eb7h.eg", L"\x0628\x05f4.eg", false}, + // Custom black list + // Combining Long Solidus Overlay + {"google.xn--comabc-k8d", + L"google.com\x0338" + L"abc", + false}, + // Hyphenation Point instead of Katakana Middle dot + {"xn--svgy16dha.jp", L"\x30a1\x2027\x30a3.jp", false}, + // Gershayim with other Hebrew characters is allowed. + {"xn--5db6bh9b.il", L"\x05e9\x05d1\x05f4\x05e6.il", true}, + // Hebrew Gershayim with Latin is disallowed. + {"xn--ab-yod.com", + L"a\x05f4" + L"b.com", + false}, + // Hebrew Gershayim with Arabic is disallowed. + {"xn--5eb7h.eg", L"\x0628\x05f4.eg", false}, #if defined(OS_MACOSX) - // These characters are blocked due to a font issue on Mac. - // Tibetan transliteration characters. - {"xn--com-luma.test.pl", L"\u0f8c.test.pl", false}, - // Arabic letter KASHMIRI YEH - {"xn--fgb.com", L"\u0620.com", false}, + // These characters are blocked due to a font issue on Mac. + // Tibetan transliteration characters. + {"xn--com-luma.test.pl", L"\u0f8c.test.pl", false}, + // Arabic letter KASHMIRI YEH + {"xn--fgb.com", L"\u0620.com", false}, #endif - // 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}, + // 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}, - // Block NV8 (Not valid in IDN 2008) characters. - // U+058A (֊) - {"xn--ab-vfd.com", L"a\x058a" L"b.com", false}, - {"xn--y9ac3j.com", L"\x0561\x058a\x0562.com", false}, - // U+2019 (’) - {"xn--ab-n2t.com", L"a\x2019" L"b.com", false}, - // U+2027 (‧) - {"xn--ab-u3t.com", L"a\x2027" L"b.com", false}, - // U+30A0 (゠) - {"xn--ab-bg4a.com", L"a\x30a0" L"b.com", false}, - {"xn--9bk3828aea.com", L"\xac00\x30a0\xac01.com", false}, - {"xn--9bk279fba.com", L"\x4e00\x30a0\x4e00.com", false}, - {"xn--n8jl2x.com", L"\x304a\x30a0\x3044.com", false}, - {"xn--fbke7f.com", L"\x3082\x30a0\x3084.com", false}, + // Block NV8 (Not valid in IDN 2008) characters. + // U+058A (֊) + {"xn--ab-vfd.com", + L"a\x058a" + L"b.com", + false}, + {"xn--y9ac3j.com", L"\x0561\x058a\x0562.com", false}, + // U+2019 (’) + {"xn--ab-n2t.com", + L"a\x2019" + L"b.com", + false}, + // U+2027 (‧) + {"xn--ab-u3t.com", + L"a\x2027" + L"b.com", + false}, + // U+30A0 (゠) + {"xn--ab-bg4a.com", + L"a\x30a0" + L"b.com", + false}, + {"xn--9bk3828aea.com", L"\xac00\x30a0\xac01.com", false}, + {"xn--9bk279fba.com", L"\x4e00\x30a0\x4e00.com", false}, + {"xn--n8jl2x.com", L"\x304a\x30a0\x3044.com", false}, + {"xn--fbke7f.com", L"\x3082\x30a0\x3084.com", false}, - // Block single/double-quote-like characters. - // U+02BB (ʻ) - {"xn--ab-8nb.com", L"a\x02bb" L"b.com", false}, - // U+02BC (ʼ) - {"xn--ab-cob.com", L"a\x02bc" L"b.com", false}, - // U+144A: Not allowed to mix with scripts other than Canadian Syllabics. - {"xn--ab-jom.com", L"a\x144a" L"b.com", false}, - {"xn--xcec9s.com", L"\x1401\x144a\x1402.com", true}, + // Block single/double-quote-like characters. + // U+02BB (ʻ) + {"xn--ab-8nb.com", + L"a\x02bb" + L"b.com", + false}, + // U+02BC (ʼ) + {"xn--ab-cob.com", + L"a\x02bc" + L"b.com", + false}, + // U+144A: Not allowed to mix with scripts other than Canadian Syllabics. + {"xn--ab-jom.com", + L"a\x144a" + L"b.com", + false}, + {"xn--xcec9s.com", L"\x1401\x144a\x1402.com", true}, - // 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}, - // Katakana Letter No not enclosed by {Han,Hiragana,Katakana}. - {"google.xn--comevil-v04f.jp", L"google.com\x30ce" L"evil.jp", false}, - // TODO(jshin): Review the danger of allowing the following two. - // Hiragana 'No' by itself is allowed. - {"xn--ldk.jp", L"\x30ce.jp", true}, - // Hebrew Gershayim used by itself is allowed. - {"xn--5eb.il", L"\x05f4.il", true}, + // 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}, + // Katakana Letter No not enclosed by {Han,Hiragana,Katakana}. + {"google.xn--comevil-v04f.jp", + L"google.com\x30ce" + L"evil.jp", + false}, + // TODO(jshin): Review the danger of allowing the following two. + // Hiragana 'No' by itself is allowed. + {"xn--ldk.jp", L"\x30ce.jp", true}, + // Hebrew Gershayim used by itself is allowed. + {"xn--5eb.il", L"\x05f4.il", true}, - // 4 Deviation characters between IDNA 2003 and IDNA 2008 - // When entered in Unicode, the first two are mapped to 'ss' and Greek sigma - // and the latter two are mapped away. However, the punycode form should - // remain in punycode. - // U+00DF(sharp-s) - {"xn--fu-hia.de", L"fu\x00df.de", false}, - // U+03C2(final-sigma) - {"xn--mxac2c.gr", L"\x03b1\x03b2\x03c2.gr", false}, - // U+200C(ZWNJ) - {"xn--h2by8byc123p.in", L"\x0924\x094d\x200c\x0930\x093f.in", false}, - // U+200C(ZWJ) - {"xn--11b6iy14e.in", L"\x0915\x094d\x200d.in", false}, + // Block RTL nonspacing marks (NSM) after unrelated scripts. + {"xn--foog-ycg.com", L"foog\x0650.com", false}, // Latin + Arabic NSM + {"xn--foog-jdg.com", L"foog\x0654.com", false}, // Latin + Arabic NSM + {"xn--foog-jhg.com", L"foog\x0670.com", false}, // Latin + Arbic NSM + {"xn--foog-opf.com", L"foog\x05b4.com", false}, // Latin + Hebrew NSM + {"xn--shb5495f.com", L"\xac00\x0650.com", false}, // Hang + Arabic NSM - // Math Monospace Small A. When entered in Unicode, it's canonicalized to - // 'a'. The punycode form should remain in punycode. - {"xn--bc-9x80a.xyz", L"\U0001d68a" L"bc.xyz", false}, - // Math Sans Bold Capital Alpha - {"xn--bc-rg90a.xyz", L"\U0001d756" L"bc.xyz", false}, - // U+3000 is canonicalized to a space(U+0020), but the punycode form - // should remain in punycode. - {"xn--p6j412gn7f.cn", L"\x4e2d\x56fd\x3000", false}, - // U+3002 is canonicalized to ASCII fullstop(U+002E), but the punycode form - // should remain in punycode. - {"xn--r6j012gn7f.cn", L"\x4e2d\x56fd\x3002", false}, - // Invalid punycode - // Has a codepoint beyond U+10FFFF. - {"xn--krank-kg706554a", nullptr, false}, - // '?' in punycode. - {"xn--hello?world.com", nullptr, false}, + // 4 Deviation characters between IDNA 2003 and IDNA 2008 + // When entered in Unicode, the first two are mapped to 'ss' and Greek sigma + // and the latter two are mapped away. However, the punycode form should + // remain in punycode. + // U+00DF(sharp-s) + {"xn--fu-hia.de", L"fu\x00df.de", false}, + // U+03C2(final-sigma) + {"xn--mxac2c.gr", L"\x03b1\x03b2\x03c2.gr", false}, + // U+200C(ZWNJ) + {"xn--h2by8byc123p.in", L"\x0924\x094d\x200c\x0930\x093f.in", false}, + // U+200C(ZWJ) + {"xn--11b6iy14e.in", L"\x0915\x094d\x200d.in", false}, - // Not allowed in UTS46/IDNA 2008 - // Georgian Capital Letter(U+10BD) - {"xn--1nd.com", L"\x10bd.com", false}, - // 3rd and 4th characters are '-'. - {"xn-----8kci4dhsd", L"\x0440\x0443--\x0430\x0432\x0442\x043e", false}, - // Leading combining mark - {"xn--72b.com", L"\x093e.com", false}, - // BiDi check per IDNA 2008/UTS 46 - // Cannot starts with AN(Arabic-Indic Number) - {"xn--8hbae.eg", L"\x0662\x0660\x0660.eg", false}, - // Cannot start with a RTL character and ends with a LTR - {"xn--x-ymcov.eg", L"\x062c\x0627\x0631x.eg", false}, - // Can start with a RTL character and ends with EN(European Number) - {"xn--2-ymcov.eg", L"\x062c\x0627\x0631" L"2.eg", true}, - // Can start with a RTL and end with AN - {"xn--mgbjq0r.eg", L"\x062c\x0627\x0631\x0662.eg", true}, + // Math Monospace Small A. When entered in Unicode, it's canonicalized to + // 'a'. The punycode form should remain in punycode. + {"xn--bc-9x80a.xyz", + L"\U0001d68a" + L"bc.xyz", + false}, + // Math Sans Bold Capital Alpha + {"xn--bc-rg90a.xyz", + L"\U0001d756" + L"bc.xyz", + false}, + // U+3000 is canonicalized to a space(U+0020), but the punycode form + // should remain in punycode. + {"xn--p6j412gn7f.cn", L"\x4e2d\x56fd\x3000", false}, + // U+3002 is canonicalized to ASCII fullstop(U+002E), but the punycode form + // should remain in punycode. + {"xn--r6j012gn7f.cn", L"\x4e2d\x56fd\x3002", false}, + // Invalid punycode + // Has a codepoint beyond U+10FFFF. + {"xn--krank-kg706554a", nullptr, false}, + // '?' in punycode. + {"xn--hello?world.com", nullptr, false}, + + // Not allowed in UTS46/IDNA 2008 + // Georgian Capital Letter(U+10BD) + {"xn--1nd.com", L"\x10bd.com", false}, + // 3rd and 4th characters are '-'. + {"xn-----8kci4dhsd", L"\x0440\x0443--\x0430\x0432\x0442\x043e", false}, + // Leading combining mark + {"xn--72b.com", L"\x093e.com", false}, + // BiDi check per IDNA 2008/UTS 46 + // Cannot starts with AN(Arabic-Indic Number) + {"xn--8hbae.eg", L"\x0662\x0660\x0660.eg", false}, + // Cannot start with a RTL character and ends with a LTR + {"xn--x-ymcov.eg", L"\x062c\x0627\x0631x.eg", false}, + // Can start with a RTL character and ends with EN(European Number) + {"xn--2-ymcov.eg", + L"\x062c\x0627\x0631" + L"2.eg", + true}, + // Can start with a RTL and end with AN + {"xn--mgbjq0r.eg", L"\x062c\x0627\x0631\x0662.eg", true}, }; struct AdjustOffsetCase {
diff --git a/components/web_resource/web_resource_service_unittest.cc b/components/web_resource/web_resource_service_unittest.cc index b875810..79d08c2 100644 --- a/components/web_resource/web_resource_service_unittest.cc +++ b/components/web_resource/web_resource_service_unittest.cc
@@ -73,7 +73,7 @@ parse_json_callback, TRAFFIC_ANNOTATION_FOR_TESTS){}; - void Unpack(const base::DictionaryValue& parsed_json) override{}; + void Unpack(const base::DictionaryValue& parsed_json) override {} }; class WebResourceServiceTest : public testing::Test {
diff --git a/content/browser/compositor/gpu_vsync_begin_frame_source_unittest.cc b/content/browser/compositor/gpu_vsync_begin_frame_source_unittest.cc index b3b234f8..75fca12 100644 --- a/content/browser/compositor/gpu_vsync_begin_frame_source_unittest.cc +++ b/content/browser/compositor/gpu_vsync_begin_frame_source_unittest.cc
@@ -22,7 +22,7 @@ return true; } - void OnBeginFrameSourcePausedChanged(bool paused) override {}; + void OnBeginFrameSourcePausedChanged(bool paused) override {} int begin_frame_count_ = 0;
diff --git a/content/browser/compositor/offscreen_browser_compositor_output_surface.h b/content/browser/compositor/offscreen_browser_compositor_output_surface.h index 53af8a5..41d82d23 100644 --- a/content/browser/compositor/offscreen_browser_compositor_output_surface.h +++ b/content/browser/compositor/offscreen_browser_compositor_output_surface.h
@@ -55,7 +55,7 @@ // BrowserCompositorOutputSurface implementation. void OnReflectorChanged() override; #if defined(OS_MACOSX) - void SetSurfaceSuspendedForRecycle(bool suspended) override {}; + void SetSurfaceSuspendedForRecycle(bool suspended) override {} #endif void OnSwapBuffersComplete(const std::vector<ui::LatencyInfo>& latency_info);
diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc index e91af24d..19249afca 100644 --- a/content/browser/devtools/devtools_agent_host_impl.cc +++ b/content/browser/devtools/devtools_agent_host_impl.cc
@@ -43,6 +43,7 @@ char DevToolsAgentHost::kTypeServiceWorker[] = "service_worker"; char DevToolsAgentHost::kTypeExternal[] = "external"; char DevToolsAgentHost::kTypeBrowser[] = "browser"; +char DevToolsAgentHost::kTypeGuest[] = "webview"; char DevToolsAgentHost::kTypeOther[] = "other"; int DevToolsAgentHostImpl::s_attached_count_ = 0; int DevToolsAgentHostImpl::s_force_creation_count_ = 0;
diff --git a/content/browser/devtools/protocol/target_handler.cc b/content/browser/devtools/protocol/target_handler.cc index 2d7c6597..7a51b79 100644 --- a/content/browser/devtools/protocol/target_handler.cc +++ b/content/browser/devtools/protocol/target_handler.cc
@@ -6,6 +6,7 @@ #include "content/browser/devtools/devtools_manager.h" #include "content/browser/devtools/devtools_session.h" +#include "content/browser/devtools/render_frame_devtools_agent_host.h" #include "content/browser/devtools/service_worker_devtools_agent_host.h" #include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/frame_tree_node.h" @@ -150,7 +151,7 @@ bool cross_process = node->current_frame_host()->IsCrossProcessSubframe(); if (node != root && cross_process) { scoped_refptr<DevToolsAgentHost> new_host = - DevToolsAgentHost::GetOrCreateFor(node->current_frame_host()); + RenderFrameDevToolsAgentHost::GetOrCreateFor(node); new_hosts[new_host->GetId()] = new_host; } else { for (size_t i = 0; i < node->child_count(); ++i) @@ -217,8 +218,7 @@ auto it = reported_hosts_.find(host->GetId()); if (it == reported_hosts_.end()) return; - if (discover_) - frontend_->TargetDestroyed(host->GetId()); + frontend_->TargetDestroyed(host->GetId()); reported_hosts_.erase(it); }
diff --git a/content/browser/devtools/render_frame_devtools_agent_host.cc b/content/browser/devtools/render_frame_devtools_agent_host.cc index 2383d1d..7554bf6 100644 --- a/content/browser/devtools/render_frame_devtools_agent_host.cc +++ b/content/browser/devtools/render_frame_devtools_agent_host.cc
@@ -60,19 +60,7 @@ namespace { base::LazyInstance<Instances>::Leaky g_instances = LAZY_INSTANCE_INITIALIZER; -static RenderFrameDevToolsAgentHost* FindAgentHost(RenderFrameHost* host) { - if (g_instances == NULL) - return NULL; - for (Instances::iterator it = g_instances.Get().begin(); - it != g_instances.Get().end(); ++it) { - if ((*it)->HasRenderFrameHost(host)) - return *it; - } - return NULL; -} - -static RenderFrameDevToolsAgentHost* FindAgentHost( - FrameTreeNode* frame_tree_node) { +RenderFrameDevToolsAgentHost* FindAgentHost(FrameTreeNode* frame_tree_node) { if (g_instances == NULL) return NULL; for (Instances::iterator it = g_instances.Get().begin(); @@ -83,24 +71,19 @@ return NULL; } -static RenderFrameDevToolsAgentHost* FindAgentHost(WebContents* web_contents) { - if (!web_contents->GetMainFrame()) - return nullptr; - return FindAgentHost(web_contents->GetMainFrame()); -} - -bool ShouldCreateDevToolsFor(RenderFrameHost* rfh) { +bool ShouldCreateDevToolsForHost(RenderFrameHost* rfh) { return rfh->IsCrossProcessSubframe() || !rfh->GetParent(); } bool ShouldCreateDevToolsForNode(FrameTreeNode* ftn) { - return ShouldCreateDevToolsFor(ftn->current_frame_host()); + return ShouldCreateDevToolsForHost(ftn->current_frame_host()); } -static RenderFrameDevToolsAgentHost* GetAgentHostFor(FrameTreeNode* ftn) { - while (ftn && !ShouldCreateDevToolsForNode(ftn)) - ftn = ftn->parent(); - return FindAgentHost(ftn); +FrameTreeNode* GetFrameTreeNodeAncestor(FrameTreeNode* frame_tree_node) { + while (frame_tree_node && !ShouldCreateDevToolsForNode(frame_tree_node)) + frame_tree_node = frame_tree_node->parent(); + DCHECK(frame_tree_node); + return frame_tree_node; } } // namespace @@ -283,67 +266,53 @@ // static scoped_refptr<DevToolsAgentHost> -DevToolsAgentHost::GetOrCreateFor(RenderFrameHost* frame_host) { - while (frame_host && !ShouldCreateDevToolsFor(frame_host)) - frame_host = frame_host->GetParent(); - DCHECK(frame_host); - RenderFrameDevToolsAgentHost* result = FindAgentHost(frame_host); - if (!result) { - result = new RenderFrameDevToolsAgentHost( - static_cast<RenderFrameHostImpl*>(frame_host)); - } - return result; -} - -// static -scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetOrCreateFor(WebContents* web_contents) { + FrameTreeNode* node = + static_cast<WebContentsImpl*>(web_contents)->GetFrameTree()->root(); // TODO(dgozman): this check should not be necessary. See // http://crbug.com/489664. - if (!web_contents->GetMainFrame()) + if (!node) return nullptr; - return DevToolsAgentHost::GetOrCreateFor(web_contents->GetMainFrame()); + return RenderFrameDevToolsAgentHost::GetOrCreateFor(node); } // static scoped_refptr<DevToolsAgentHost> RenderFrameDevToolsAgentHost::GetOrCreateFor( - RenderFrameHostImpl* host) { - RenderFrameDevToolsAgentHost* result = FindAgentHost(host); + FrameTreeNode* frame_tree_node) { + frame_tree_node = GetFrameTreeNodeAncestor(frame_tree_node); + RenderFrameDevToolsAgentHost* result = FindAgentHost(frame_tree_node); if (!result) - result = new RenderFrameDevToolsAgentHost(host); + result = new RenderFrameDevToolsAgentHost(frame_tree_node); return result; } // static -void RenderFrameDevToolsAgentHost::AppendAgentHostForFrameIfApplicable( - DevToolsAgentHost::List* result, - RenderFrameHost* host) { - RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(host); - if (!rfh->IsRenderFrameLive()) - return; - if (ShouldCreateDevToolsFor(rfh)) - result->push_back(RenderFrameDevToolsAgentHost::GetOrCreateFor(rfh)); -} - -// static bool DevToolsAgentHost::HasFor(WebContents* web_contents) { - return FindAgentHost(web_contents) != NULL; + FrameTreeNode* node = + static_cast<WebContentsImpl*>(web_contents)->GetFrameTree()->root(); + return node ? FindAgentHost(node) != nullptr : false; } // static bool DevToolsAgentHost::IsDebuggerAttached(WebContents* web_contents) { - RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(web_contents); - return agent_host && agent_host->IsAttached(); + FrameTreeNode* node = + static_cast<WebContentsImpl*>(web_contents)->GetFrameTree()->root(); + RenderFrameDevToolsAgentHost* host = node ? FindAgentHost(node) : nullptr; + return host && host->IsAttached(); } // static void RenderFrameDevToolsAgentHost::AddAllAgentHosts( DevToolsAgentHost::List* result) { - base::Callback<void(RenderFrameHost*)> callback = base::Bind( - RenderFrameDevToolsAgentHost::AppendAgentHostForFrameIfApplicable, - base::Unretained(result)); - for (auto* wc : WebContentsImpl::GetAllWebContents()) - wc->ForEachFrame(callback); + for (WebContentsImpl* wc : WebContentsImpl::GetAllWebContents()) { + for (FrameTreeNode* node : wc->GetFrameTree()->Nodes()) { + if (!node->current_frame_host() || !ShouldCreateDevToolsForNode(node)) + continue; + if (!node->current_frame_host()->IsRenderFrameLive()) + continue; + result->push_back(RenderFrameDevToolsAgentHost::GetOrCreateFor(node)); + } + } } // static @@ -353,7 +322,8 @@ if (IsBrowserSideNavigationEnabled()) return; - RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(pending); + RenderFrameDevToolsAgentHost* agent_host = FindAgentHost( + static_cast<RenderFrameHostImpl*>(pending)->frame_tree_node()); if (!agent_host) return; if (agent_host->pending_ && agent_host->pending_->host() == pending) { @@ -366,7 +336,8 @@ // static void RenderFrameDevToolsAgentHost::OnBeforeNavigation( RenderFrameHost* current, RenderFrameHost* pending) { - RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(current); + RenderFrameDevToolsAgentHost* agent_host = FindAgentHost( + static_cast<RenderFrameHostImpl*>(current)->frame_tree_node()); if (agent_host) agent_host->AboutToNavigateRenderFrame(current, pending); } @@ -387,7 +358,8 @@ const CommonNavigationParams& common_params, const BeginNavigationParams& begin_params, net::Error error_code) { - RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(host); + RenderFrameDevToolsAgentHost* agent_host = + FindAgentHost(static_cast<RenderFrameHostImpl*>(host)->frame_tree_node()); if (agent_host) agent_host->OnFailedNavigation(common_params, begin_params, error_code); } @@ -419,7 +391,8 @@ // static bool RenderFrameDevToolsAgentHost::IsNetworkHandlerEnabled( FrameTreeNode* frame_tree_node) { - RenderFrameDevToolsAgentHost* agent_host = GetAgentHostFor(frame_tree_node); + frame_tree_node = GetFrameTreeNodeAncestor(frame_tree_node); + RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(frame_tree_node); if (!agent_host) return false; for (auto* network : protocol::NetworkHandler::ForAgentHost(agent_host)) { @@ -432,7 +405,8 @@ // static std::string RenderFrameDevToolsAgentHost::UserAgentOverride( FrameTreeNode* frame_tree_node) { - RenderFrameDevToolsAgentHost* agent_host = GetAgentHostFor(frame_tree_node); + frame_tree_node = GetFrameTreeNodeAncestor(frame_tree_node); + RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(frame_tree_node); if (!agent_host) return std::string(); for (auto* network : protocol::NetworkHandler::ForAgentHost(agent_host)) { @@ -453,24 +427,25 @@ } RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( - RenderFrameHostImpl* host) + FrameTreeNode* frame_tree_node) : DevToolsAgentHostImpl(base::GenerateGUID()), frame_trace_recorder_(nullptr), handlers_frame_host_(nullptr), current_frame_crashed_(false), pending_handle_(nullptr), - frame_tree_node_(host->frame_tree_node()) { - SetPending(host); - CommitPending(); - WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host)); + frame_tree_node_(frame_tree_node) { + if (frame_tree_node->current_frame_host()) { + SetPending(frame_tree_node->current_frame_host()); + CommitPending(); + } + WebContentsObserver::Observe( + WebContentsImpl::FromFrameTreeNode(frame_tree_node)); if (web_contents() && web_contents()->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) { - current_frame_crashed_ = true; + current_frame_crashed_ = true; } - UpdateTypeAndTitle(host); - g_instances.Get().push_back(this); AddRef(); // Balanced in RenderFrameHostDestroyed. @@ -496,7 +471,7 @@ DCHECK(pending_); current_frame_crashed_ = false; - if (!ShouldCreateDevToolsFor(pending_->host())) { + if (!ShouldCreateDevToolsForHost(pending_->host())) { DestroyOnRenderFrameGone(); // |this| may be deleted at this point. return; @@ -827,16 +802,6 @@ handlers_frame_host_ == manager->pending_frame_host(); } -void RenderFrameDevToolsAgentHost::UpdateTypeAndTitle(RenderFrameHost* host) { - DevToolsManager* manager = DevToolsManager::GetInstance(); - if (!manager->delegate()) - return; - if (type_.empty() || type_ == DevToolsAgentHost::kTypeOther) - type_ = manager->delegate()->GetTargetType(host); - if (title_.empty()) - title_ = manager->delegate()->GetTargetTitle(host); -} - #if defined(OS_ANDROID) device::mojom::WakeLock* RenderFrameDevToolsAgentHost::GetWakeLock() { // Here is a lazy binding, and will not reconnect after connection error. @@ -1016,12 +981,11 @@ } std::string RenderFrameDevToolsAgentHost::GetParentId() { - if (IsChildFrame() && current_) { - RenderFrameHostImpl* frame_host = current_->host()->GetParent(); - while (frame_host && !ShouldCreateDevToolsFor(frame_host)) - frame_host = frame_host->GetParent(); - if (frame_host) - return DevToolsAgentHost::GetOrCreateFor(frame_host)->GetId(); + if (IsChildFrame()) { + FrameTreeNode* frame_tree_node = + GetFrameTreeNodeAncestor(frame_tree_node_->parent()); + return RenderFrameDevToolsAgentHost::GetOrCreateFor(frame_tree_node) + ->GetId(); } WebContentsImpl* contents = static_cast<WebContentsImpl*>(web_contents()); @@ -1034,33 +998,40 @@ } std::string RenderFrameDevToolsAgentHost::GetType() { - if (current_) - UpdateTypeAndTitle(current_->host()); - if (!type_.empty()) - return type_; + if (web_contents() && + static_cast<WebContentsImpl*>(web_contents())->GetOuterWebContents()) { + return kTypeGuest; + } if (IsChildFrame()) return kTypeFrame; + DevToolsManager* manager = DevToolsManager::GetInstance(); + if (manager->delegate() && web_contents()) { + std::string type = manager->delegate()->GetTargetType(web_contents()); + if (!type.empty()) + return type; + } return kTypePage; } std::string RenderFrameDevToolsAgentHost::GetTitle() { - if (current_) - UpdateTypeAndTitle(current_->host()); - if (!title_.empty()) - return title_; + DevToolsManager* manager = DevToolsManager::GetInstance(); + if (manager->delegate() && web_contents()) { + std::string title = manager->delegate()->GetTargetTitle(web_contents()); + if (!title.empty()) + return title; + } if (current_ && current_->host()->GetParent()) return current_->host()->GetLastCommittedURL().spec(); - content::WebContents* web_contents = GetWebContents(); - if (web_contents) - return base::UTF16ToUTF8(web_contents->GetTitle()); + if (web_contents()) + return base::UTF16ToUTF8(web_contents()->GetTitle()); return GetURL().spec(); } std::string RenderFrameDevToolsAgentHost::GetDescription() { DevToolsManager* manager = DevToolsManager::GetInstance(); - if (manager->delegate() && current_) - return manager->delegate()->GetTargetDescription(current_->host()); - return ""; + if (manager->delegate() && web_contents()) + return manager->delegate()->GetTargetDescription(web_contents()); + return std::string(); } GURL RenderFrameDevToolsAgentHost::GetURL() { @@ -1117,7 +1088,8 @@ void RenderFrameDevToolsAgentHost::SignalSynchronousSwapCompositorFrame( RenderFrameHost* frame_host, cc::CompositorFrameMetadata frame_metadata) { - scoped_refptr<RenderFrameDevToolsAgentHost> dtah(FindAgentHost(frame_host)); + scoped_refptr<RenderFrameDevToolsAgentHost> dtah(FindAgentHost( + static_cast<RenderFrameHostImpl*>(frame_host)->frame_tree_node())); if (dtah) { // Unblock the compositor. BrowserThread::PostTask( @@ -1171,7 +1143,8 @@ bool success = false; if (IsAttached() && sender->GetRoutingID() != new_routing_id && frame_host) { scoped_refptr<DevToolsAgentHost> agent = - DevToolsAgentHost::GetOrCreateFor(frame_host); + RenderFrameDevToolsAgentHost::GetOrCreateFor( + frame_host->frame_tree_node()); success = static_cast<DevToolsAgentHostImpl*>(agent.get())->Inspect(); } @@ -1179,12 +1152,6 @@ sender->GetRoutingID(), success)); } -bool RenderFrameDevToolsAgentHost::HasRenderFrameHost( - RenderFrameHost* host) { - return (current_ && current_->host() == host) || - (pending_ && pending_->host() == host); -} - bool RenderFrameDevToolsAgentHost::IsChildFrame() { return current_ && current_->host()->GetParent(); }
diff --git a/content/browser/devtools/render_frame_devtools_agent_host.h b/content/browser/devtools/render_frame_devtools_agent_host.h index 88fdccbc..82ef5c6f0 100644 --- a/content/browser/devtools/render_frame_devtools_agent_host.h +++ b/content/browser/devtools/render_frame_devtools_agent_host.h
@@ -44,6 +44,8 @@ private WebContentsObserver { public: static void AddAllAgentHosts(DevToolsAgentHost::List* result); + static scoped_refptr<DevToolsAgentHost> GetOrCreateFor( + FrameTreeNode* frame_tree_node); static void OnCancelPendingNavigation(RenderFrameHost* pending, RenderFrameHost* current); @@ -65,8 +67,6 @@ RenderFrameHost* frame_host, cc::CompositorFrameMetadata frame_metadata); - bool HasRenderFrameHost(RenderFrameHost* host); - FrameTreeNode* frame_tree_node() { return frame_tree_node_; } // DevToolsAgentHost overrides. @@ -88,15 +88,9 @@ private: friend class DevToolsAgentHost; - explicit RenderFrameDevToolsAgentHost(RenderFrameHostImpl*); + explicit RenderFrameDevToolsAgentHost(FrameTreeNode*); ~RenderFrameDevToolsAgentHost() override; - static scoped_refptr<DevToolsAgentHost> GetOrCreateFor( - RenderFrameHostImpl* host); - static void AppendAgentHostForFrameIfApplicable( - DevToolsAgentHost::List* result, - RenderFrameHost* host); - // DevToolsAgentHostImpl overrides. void AttachSession(DevToolsSession* session) override; void DetachSession(int session_id) override; @@ -150,8 +144,6 @@ bool CheckConsistency(); - void UpdateTypeAndTitle(RenderFrameHost* host); - #if defined(OS_ANDROID) device::mojom::WakeLock* GetWakeLock(); #endif @@ -173,8 +165,6 @@ #endif RenderFrameHostImpl* handlers_frame_host_; bool current_frame_crashed_; - std::string type_; - std::string title_; // PlzNavigate
diff --git a/content/browser/devtools/site_per_process_devtools_browsertest.cc b/content/browser/devtools/site_per_process_devtools_browsertest.cc index 2bac5725..2d9ad30 100644 --- a/content/browser/devtools/site_per_process_devtools_browsertest.cc +++ b/content/browser/devtools/site_per_process_devtools_browsertest.cc
@@ -5,6 +5,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "build/build_config.h" +#include "content/browser/devtools/render_frame_devtools_agent_host.h" #include "content/browser/frame_host/frame_tree.h" #include "content/browser/site_per_process_browsertest.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -153,7 +154,7 @@ GetFrameTree()->root(); scoped_refptr<DevToolsAgentHost> main_frame_agent = - DevToolsAgentHost::GetOrCreateFor(root->current_frame_host()); + RenderFrameDevToolsAgentHost::GetOrCreateFor(root); EXPECT_EQ(page_agent.get(), main_frame_agent.get()); // Load same-site page into iframe. @@ -162,7 +163,7 @@ NavigateFrameToURL(child, http_url); scoped_refptr<DevToolsAgentHost> child_frame_agent = - DevToolsAgentHost::GetOrCreateFor(child->current_frame_host()); + RenderFrameDevToolsAgentHost::GetOrCreateFor(child); EXPECT_EQ(page_agent.get(), child_frame_agent.get()); // Load cross-site page into iframe. @@ -172,8 +173,7 @@ cross_site_url = cross_site_url.ReplaceComponents(replace_host); NavigateFrameToURL(root->child_at(0), cross_site_url); - child_frame_agent = - DevToolsAgentHost::GetOrCreateFor(child->current_frame_host()); + child_frame_agent = RenderFrameDevToolsAgentHost::GetOrCreateFor(child); EXPECT_NE(page_agent.get(), child_frame_agent.get()); EXPECT_EQ(child_frame_agent->GetParentId(), page_agent->GetId()); EXPECT_NE(child_frame_agent->GetId(), page_agent->GetId()); @@ -199,9 +199,9 @@ // First ask for child frame, then for main frame. scoped_refptr<DevToolsAgentHost> child_frame_agent = - DevToolsAgentHost::GetOrCreateFor(child->current_frame_host()); + RenderFrameDevToolsAgentHost::GetOrCreateFor(child); scoped_refptr<DevToolsAgentHost> main_frame_agent = - DevToolsAgentHost::GetOrCreateFor(root->current_frame_host()); + RenderFrameDevToolsAgentHost::GetOrCreateFor(root); EXPECT_NE(main_frame_agent.get(), child_frame_agent.get()); EXPECT_EQ(child_frame_agent->GetParentId(), main_frame_agent->GetId()); EXPECT_NE(child_frame_agent->GetId(), main_frame_agent->GetId());
diff --git a/content/browser/download/download_worker.cc b/content/browser/download/download_worker.cc index ce225f0..2473e03a 100644 --- a/content/browser/download/download_worker.cc +++ b/content/browser/download/download_worker.cc
@@ -25,7 +25,7 @@ return ByteStreamReader::STREAM_COMPLETE; } int GetStatus() const override { return status_; } - void RegisterCallback(const base::Closure& sink_callback) override {}; + void RegisterCallback(const base::Closure& sink_callback) override {} private: int status_;
diff --git a/content/browser/generic_sensor_browsertest.cc b/content/browser/generic_sensor_browsertest.cc index 364e308..66375fe 100644 --- a/content/browser/generic_sensor_browsertest.cc +++ b/content/browser/generic_sensor_browsertest.cc
@@ -47,7 +47,7 @@ return true; } - void StopSensor() override {}; + void StopSensor() override {} protected: ~FakeAmbientLightSensor() override = default;
diff --git a/content/browser/media/capture/cursor_renderer_mac_unittest.mm b/content/browser/media/capture/cursor_renderer_mac_unittest.mm index 326e5ad..cefbf9c2 100644 --- a/content/browser/media/capture/cursor_renderer_mac_unittest.mm +++ b/content/browser/media/capture/cursor_renderer_mac_unittest.mm
@@ -22,7 +22,7 @@ class CursorRendererMacTest : public ui::CocoaTest { public: CursorRendererMacTest() {} - ~CursorRendererMacTest() override{}; + ~CursorRendererMacTest() override {} void SetUp() override { ui::CocoaTest::SetUp();
diff --git a/content/browser/net/network_errors_listing_ui.h b/content/browser/net/network_errors_listing_ui.h index d3022cd..cd4eb86 100644 --- a/content/browser/net/network_errors_listing_ui.h +++ b/content/browser/net/network_errors_listing_ui.h
@@ -14,7 +14,7 @@ class NetworkErrorsListingUI : public WebUIController { public: explicit NetworkErrorsListingUI(WebUI* web_ui); - ~NetworkErrorsListingUI() override {}; + ~NetworkErrorsListingUI() override {} private: DISALLOW_COPY_AND_ASSIGN(NetworkErrorsListingUI);
diff --git a/content/browser/service_worker/embedded_worker_instance_unittest.cc b/content/browser/service_worker/embedded_worker_instance_unittest.cc index 94ac7e9c..450fbeb3 100644 --- a/content/browser/service_worker/embedded_worker_instance_unittest.cc +++ b/content/browser/service_worker/embedded_worker_instance_unittest.cc
@@ -151,7 +151,7 @@ class StalledInStartWorkerHelper : public EmbeddedWorkerTestHelper { public: StalledInStartWorkerHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} - ~StalledInStartWorkerHelper() override{}; + ~StalledInStartWorkerHelper() override {} void OnStartWorker(int embedded_worker_id, int64_t service_worker_version_id,
diff --git a/content/browser/service_worker/service_worker_metrics.cc b/content/browser/service_worker/service_worker_metrics.cc index ebc38fb..4e418ab 100644 --- a/content/browser/service_worker/service_worker_metrics.cc +++ b/content/browser/service_worker/service_worker_metrics.cc
@@ -843,76 +843,58 @@ base::TimeDelta worker_start, base::TimeDelta response_start, EmbeddedWorkerStatus initial_worker_status, - StartSituation start_situation) { + StartSituation start_situation, + ResourceType resource_type) { DCHECK_GE(worker_start.ToInternalValue(), 0); DCHECK_GE(response_start.ToInternalValue(), 0); - - UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NavigationPreload.ResponseTime", - response_start); - - const bool nav_preload_finished_first = response_start < worker_start; - UMA_HISTOGRAM_BOOLEAN( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker", - nav_preload_finished_first); - + DCHECK(resource_type == RESOURCE_TYPE_MAIN_FRAME || + resource_type == RESOURCE_TYPE_SUB_FRAME); + const bool is_main_frame = (resource_type == RESOURCE_TYPE_MAIN_FRAME); + // TODO(falken): Log sub-frame navigations also. + if (!is_main_frame) { + return; + } const bool existing_process_startup = (initial_worker_status == EmbeddedWorkerStatus::STOPPED && start_situation == ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS); - if (existing_process_startup) { - UMA_HISTOGRAM_BOOLEAN( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker" - "_StartWorkerExistingProcess", - nav_preload_finished_first); + const bool nav_preload_finished_first = response_start < worker_start; + const base::TimeDelta concurrent_time = + nav_preload_finished_first ? response_start : worker_start; + base::TimeDelta worker_wait_time; + if (nav_preload_finished_first) { + worker_wait_time = worker_start - response_start; } + UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NavPreload.ResponseTime_MainFrame", + response_start); + UMA_HISTOGRAM_BOOLEAN("ServiceWorker.NavPreload.FinishedFirst_MainFrame", + nav_preload_finished_first); UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime", - nav_preload_finished_first ? response_start : worker_start); - + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame", concurrent_time); if (nav_preload_finished_first) { UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime_NavPreloadFirst", + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame", worker_wait_time); + } + + if (existing_process_startup) { + UMA_HISTOGRAM_MEDIUM_TIMES( + "ServiceWorker.NavPreload.ResponseTime_MainFrame_" + "StartWorkerExistingProcess", response_start); + UMA_HISTOGRAM_BOOLEAN( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + nav_preload_finished_first); UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.SWStartAfterNavPreload", - worker_start - response_start); - - if (existing_process_startup) { + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame_" + "StartWorkerExistingProcess", + concurrent_time); + if (nav_preload_finished_first) { UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime_" + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame_" "StartWorkerExistingProcess", - response_start); - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime_" - "NavPreloadFirst_StartWorkerExistingProcess", - response_start); - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.SWStartAfterNavPreload_" - "StartWorkerExistingProcess", - worker_start - response_start); - } - } else { - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst", - worker_start); - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart", - response_start - worker_start); - - if (existing_process_startup) { - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime_" - "StartWorkerExistingProcess", - worker_start); - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.ConcurrentTime_" - "SWStartFirst_StartWorkerExistingProcess", - worker_start); - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart_" - "StartWorkerExistingProcess", - response_start - worker_start); + worker_wait_time); } } }
diff --git a/content/browser/service_worker/service_worker_metrics.h b/content/browser/service_worker/service_worker_metrics.h index c34d7a2..ac8d41b 100644 --- a/content/browser/service_worker/service_worker_metrics.h +++ b/content/browser/service_worker/service_worker_metrics.h
@@ -337,11 +337,14 @@ // |start_situation| describe the preparation needed. // |response_start| is the time it took until the navigation preload response // started. + // |resource_type| must be RESOURCE_TYPE_MAIN_FRAME or + // RESOURCE_TYPE_SUB_FRAME. CONTENT_EXPORT static void RecordNavigationPreloadResponse( base::TimeDelta worker_start, base::TimeDelta response_start, EmbeddedWorkerStatus initial_worker_status, - StartSituation start_situation); + StartSituation start_situation, + ResourceType resource_type); // Records the result of trying to handle a request for a service worker // script.
diff --git a/content/browser/service_worker/service_worker_metrics_unittest.cc b/content/browser/service_worker/service_worker_metrics_unittest.cc index 6858630..9069e1f 100644 --- a/content/browser/service_worker/service_worker_metrics_unittest.cc +++ b/content/browser/service_worker/service_worker_metrics_unittest.cc
@@ -19,6 +19,56 @@ "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time"; const std::string kPreparationType = "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type"; + +void ExpectNoNavPreloadMainFrameUMA( + const base::HistogramTester& histogram_tester) { + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame", 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame", 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame", 0); + + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame_" + "StartWorkerExistingProcess", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame_" + "StartWorkerExistingProcess", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame_" + "StartWorkerExistingProcess", + 0); +} + +void ExpectNoNavPreloadStartWorkerExistingProcessUMA( + const base::HistogramTester& histogram_tester) { + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame_" + "StartWorkerExistingProcess", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame_" + "StartWorkerExistingProcess", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame_" + "StartWorkerExistingProcess", + 0); +} + } // namespace TEST(ServiceWorkerMetricsTest, ActivatedWorkerPreparation) { @@ -103,150 +153,180 @@ } } -TEST(ServiceWorkerMetricsTest, NavigationPreloadResponse) { - // The worker was already running. - { - base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(123); - base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); - EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::RUNNING; - ServiceWorkerMetrics::StartSituation start_situation = - ServiceWorkerMetrics::StartSituation::UNKNOWN; - base::HistogramTester histogram_tester; - ServiceWorkerMetrics::RecordNavigationPreloadResponse( - worker_start, response_start, initial_worker_status, start_situation); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ResponseTime", response_start, 1); - histogram_tester.ExpectUniqueSample( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker", false, 1); - histogram_tester.ExpectTotalCount( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker_" - "StartWorkerExistingProcess", - 0); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime", worker_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst", - worker_start, 1); - histogram_tester.ExpectTotalCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst_" - "StartWorkerExistingProcess", - 0); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart", - response_start - worker_start, 1); - histogram_tester.ExpectTotalCount( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart_" - "StartWorkerExistingProcess", - 0); - } +// =========================================================================== +// Navigation preload tests +// =========================================================================== +// The worker was already running. +TEST(ServiceWorkerMetricsTest, + NavigationPreloadResponse_WorkerAlreadyRunning_MainFrame) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(123); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::RUNNING; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::UNKNOWN; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_MAIN_FRAME); - // The worker had to start up. - { - base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(234); - base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); - EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; - ServiceWorkerMetrics::StartSituation start_situation = - ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; - base::HistogramTester histogram_tester; - ServiceWorkerMetrics::RecordNavigationPreloadResponse( - worker_start, response_start, initial_worker_status, start_situation); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ResponseTime", response_start, 1); - histogram_tester.ExpectUniqueSample( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker", false, 1); - histogram_tester.ExpectUniqueSample( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker_" - "StartWorkerExistingProcess", - false, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime", worker_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst", - worker_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst_" - "StartWorkerExistingProcess", - worker_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart", - response_start - worker_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart_" - "StartWorkerExistingProcess", - response_start - worker_start, 1); - } + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame", response_start, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", false, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame", worker_start, 1); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame", 0); - // The worker had to start up. But it happened during browser startup. - { - base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(456); - base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); - EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; - ServiceWorkerMetrics::StartSituation start_situation = - ServiceWorkerMetrics::StartSituation::DURING_STARTUP; - base::HistogramTester histogram_tester; - ServiceWorkerMetrics::RecordNavigationPreloadResponse( - worker_start, response_start, initial_worker_status, start_situation); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ResponseTime", response_start, 1); - histogram_tester.ExpectUniqueSample( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker", false, 1); - histogram_tester.ExpectTotalCount( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker_" - "StartWorkerExistingProcess", - 0); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime", worker_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst", - worker_start, 1); - histogram_tester.ExpectTotalCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_SWStartFirst_" - "StartWorkerExistingProcess", - 0); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart", - response_start - worker_start, 1); - histogram_tester.ExpectTotalCount( - "ServiceWorker.NavigationPreload.NavPreloadAfterSWStart_" - "StartWorkerExistingProcess", - 0); - } + ExpectNoNavPreloadStartWorkerExistingProcessUMA(histogram_tester); +} - // The worker had to start up, and navigation preload finished first. - { - base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(2345); - base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(456); - EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; - ServiceWorkerMetrics::StartSituation start_situation = - ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; - base::HistogramTester histogram_tester; - ServiceWorkerMetrics::RecordNavigationPreloadResponse( - worker_start, response_start, initial_worker_status, start_situation); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ResponseTime", response_start, 1); - histogram_tester.ExpectUniqueSample( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker", true, 1); - histogram_tester.ExpectUniqueSample( - "ServiceWorker.NavigationPreload.FinishedBeforeStartWorker_" - "StartWorkerExistingProcess", - true, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime", response_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_NavPreloadFirst", - response_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.ConcurrentTime_NavPreloadFirst_" - "StartWorkerExistingProcess", - response_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.SWStartAfterNavPreload", - worker_start - response_start, 1); - histogram_tester.ExpectTimeBucketCount( - "ServiceWorker.NavigationPreload.SWStartAfterNavPreload_" - "StartWorkerExistingProcess", - worker_start - response_start, 1); - } +// The worker was already running (subframe). +TEST(ServiceWorkerMetricsTest, + NavigationPreloadResponse_WorkerAlreadyRunning_SubFrame) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(123); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::RUNNING; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::UNKNOWN; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_SUB_FRAME); + + ExpectNoNavPreloadMainFrameUMA(histogram_tester); +} + +// The worker started up. +TEST(ServiceWorkerMetricsTest, + NavigationPreloadResponse_WorkerStart_MainFrame) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(234); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_MAIN_FRAME); + + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame", response_start, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", false, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame", worker_start, 1); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame", 0); + + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame_" + "StartWorkerExistingProcess", + response_start, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + false, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame_" + "StartWorkerExistingProcess", + worker_start, 1); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame_" + "StartWorkerExistingProcess", + 0); +} + +// The worker started up (subframe). +TEST(ServiceWorkerMetricsTest, NavigationPreloadResponse_WorkerStart_SubFrame) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(234); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_SUB_FRAME); + + ExpectNoNavPreloadMainFrameUMA(histogram_tester); +} + +// The worker started up, but during browser startup. +TEST(ServiceWorkerMetricsTest, + NavigationPreloadResponse_WorkerStart_BrowserStartup) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(456); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(789); + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::DURING_STARTUP; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_MAIN_FRAME); + + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame", response_start, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", false, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame", worker_start, 1); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame", 0); + + ExpectNoNavPreloadStartWorkerExistingProcessUMA(histogram_tester); +} + +// The worker started up, but navigation preload arrived first. +TEST(ServiceWorkerMetricsTest, + NavigationPreloadResponse_NavPreloadFinishedFirst) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(2345); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(456); + base::TimeDelta wait_time = worker_start - response_start; + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_MAIN_FRAME); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ResponseTime_MainFrame", response_start, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", true, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame", response_start, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame", wait_time, 1); + + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + true, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.ConcurrentTime_MainFrame_" + "StartWorkerExistingProcess", + response_start, 1); + histogram_tester.ExpectTimeBucketCount( + "ServiceWorker.NavPreload.WorkerWaitTime_MainFrame_" + "StartWorkerExistingProcess", + wait_time, 1); +} + +// The worker started up, but navigation preload arrived first (subframe). +TEST(ServiceWorkerMetricsTest, + NavigationPreloadResponse_NavPreloadFinishedFirst_SubFrame) { + base::TimeDelta worker_start = base::TimeDelta::FromMilliseconds(2345); + base::TimeDelta response_start = base::TimeDelta::FromMilliseconds(456); + EmbeddedWorkerStatus initial_worker_status = EmbeddedWorkerStatus::STOPPED; + ServiceWorkerMetrics::StartSituation start_situation = + ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; + base::HistogramTester histogram_tester; + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + worker_start, response_start, initial_worker_status, start_situation, + RESOURCE_TYPE_SUB_FRAME); + + ExpectNoNavPreloadMainFrameUMA(histogram_tester); } } // namespace content
diff --git a/content/browser/service_worker/service_worker_url_request_job.cc b/content/browser/service_worker/service_worker_url_request_job.cc index 8b2d029..bce92f8 100644 --- a/content/browser/service_worker/service_worker_url_request_job.cc +++ b/content/browser/service_worker/service_worker_url_request_job.cc
@@ -216,6 +216,92 @@ DISALLOW_COPY_AND_ASSIGN(FileSizeResolver); }; +// A helper for recording navigation preload UMA. The UMA is recorded +// after both service worker preparation finished and the +// navigation preload response arrived. +class ServiceWorkerURLRequestJob::NavigationPreloadMetrics { + public: + explicit NavigationPreloadMetrics(ServiceWorkerURLRequestJob* owner) + : owner_(owner) {} + ~NavigationPreloadMetrics() {} + + // Called when service worker preparation finished. + void ReportWorkerPreparationFinished() { + DCHECK(!owner_->worker_start_time_.is_null()); + DCHECK(!owner_->worker_ready_time_.is_null()); + switch (phase_) { + case Phase::INITIAL: + phase_ = Phase::WORKER_PREPARATION_FINISHED; + break; + case Phase::NAV_PRELOAD_FINISHED: + phase_ = Phase::BOTH_FINISHED; + Complete(); + break; + case Phase::DO_NOT_RECORD: + return; + case Phase::BOTH_FINISHED: + case Phase::WORKER_PREPARATION_FINISHED: + case Phase::RECORDED: + NOTREACHED(); + } + } + + // Called when the navigation preload response arrived. + void ReportNavigationPreloadFinished() { + navigation_preload_response_time_ = base::TimeTicks::Now(); + switch (phase_) { + case Phase::INITIAL: + phase_ = Phase::NAV_PRELOAD_FINISHED; + break; + case Phase::WORKER_PREPARATION_FINISHED: + phase_ = Phase::BOTH_FINISHED; + Complete(); + break; + case Phase::DO_NOT_RECORD: + return; + case Phase::BOTH_FINISHED: + case Phase::NAV_PRELOAD_FINISHED: + case Phase::RECORDED: + NOTREACHED(); + } + } + + // After Abort() is called, no navigation preload UMA will be recorded for + // this navigation. + void Abort() { + DCHECK_NE(phase_, Phase::RECORDED); + phase_ = Phase::DO_NOT_RECORD; + } + + private: + enum class Phase { + INITIAL, + WORKER_PREPARATION_FINISHED, + NAV_PRELOAD_FINISHED, + BOTH_FINISHED, + RECORDED, + DO_NOT_RECORD + }; + + void Complete() { + DCHECK_EQ(phase_, Phase::BOTH_FINISHED); + ServiceWorkerMetrics::RecordNavigationPreloadResponse( + owner_->worker_ready_time_ - owner_->worker_start_time_, + navigation_preload_response_time_ - owner_->worker_start_time_, + owner_->initial_worker_status_, owner_->worker_start_situation_, + owner_->resource_type_); + phase_ = Phase::RECORDED; + } + + // Owns and must outlive |this|. + ServiceWorkerURLRequestJob* owner_; + + base::TimeTicks navigation_preload_response_time_; + Phase phase_ = Phase::INITIAL; + + DISALLOW_COPY_AND_ASSIGN(NavigationPreloadMetrics); +}; + bool ServiceWorkerURLRequestJob::Delegate::RequestStillValid( ServiceWorkerMetrics::URLRequestJobResult* result) { return true; @@ -518,46 +604,57 @@ *blob_size = request_body_blob_data_handle_->size(); } +bool ServiceWorkerURLRequestJob::ShouldRecordNavigationMetrics( + const ServiceWorkerVersion* version) const { + // Don't record navigation metrics in the following situations. + // 1) The worker was in state INSTALLED or ACTIVATING, and the browser had to + // wait for it to become ACTIVATED. This is to avoid including the time to + // execute the activate event handlers in the worker's script. + if (!worker_already_activated_) { + return false; + } + // 2) The worker was started for the fetch AND DevTools was attached during + // startup. This is intended to avoid including the time for debugging. + if (version->skip_recording_startup_time() && + initial_worker_status_ != EmbeddedWorkerStatus::RUNNING) { + return false; + } + // 3) The request is for New Tab Page. This is because it tends to dominate + // the stats and makes the results largely skewed. + if (ServiceWorkerMetrics::ShouldExcludeSiteFromHistogram( + version->site_for_uma())) { + return false; + } + + return true; +} + void ServiceWorkerURLRequestJob::DidPrepareFetchEvent( scoped_refptr<ServiceWorkerVersion> version) { worker_ready_time_ = base::TimeTicks::Now(); load_timing_info_.send_start = worker_ready_time_; - - // Record the time taken for the browser to find and possibly start an active - // worker to which to dispatch a FetchEvent for a main frame resource request. - // For context, a FetchEvent can only be dispatched to an ACTIVATED worker - // that is running (it has been successfully started). The measurements starts - // when the browser process receives the request. The browser then finds the - // worker appropriate for this request (if there is none, this metric is not - // recorded). If that worker is already started, the browser process can send - // the request to it, so the measurement ends quickly. Otherwise the browser - // process has to start the worker and the measurement ends when the worker is - // successfully started. - // The metric is not recorded in the following situations: - // 1) The worker was in state INSTALLED or ACTIVATING, and the browser had to - // wait for it to become ACTIVATED. This is to avoid including the time to - // execute the activate event handlers in the worker's script. - // 2) The worker was started for the fetch AND DevTools was attached during - // startup. This is intended to avoid including the time for debugging. - // 3) The request is for New Tab Page. This is because it tends to dominate - // the stats and makes the results largely skewed. - if (resource_type_ != RESOURCE_TYPE_MAIN_FRAME) - return; - if (!worker_already_activated_) - return; - if (version->skip_recording_startup_time() && - initial_worker_status_ != EmbeddedWorkerStatus::RUNNING) { - return; - } - if (ServiceWorkerMetrics::ShouldExcludeSiteFromHistogram( - version->site_for_uma())) { - return; - } worker_start_situation_ = version->embedded_worker()->start_situation(); - ServiceWorkerMetrics::RecordActivatedWorkerPreparationForMainFrame( - worker_ready_time_ - request()->creation_time(), initial_worker_status_, - worker_start_situation_, did_navigation_preload_); - MaybeReportNavigationPreloadMetrics(); + + if (!ShouldRecordNavigationMetrics(version.get())) { + nav_preload_metrics_->Abort(); + return; + } + if (resource_type_ == RESOURCE_TYPE_MAIN_FRAME) { + // Record the time taken for the browser to find and possibly start an + // active worker to which to dispatch a FetchEvent for a main frame resource + // request. For context, a FetchEvent can only be dispatched to an ACTIVATED + // worker that is running (it has been successfully started). The + // measurements starts when the browser process receives the request. The + // browser then finds the worker appropriate for this request (if there is + // none, this metric is not recorded). If that worker is already started, + // the browser process can send the request to it, so the measurement ends + // quickly. Otherwise the browser process has to start the worker and the + // measurement ends when the worker is successfully started. + ServiceWorkerMetrics::RecordActivatedWorkerPreparationForMainFrame( + worker_ready_time_ - request()->creation_time(), initial_worker_status_, + worker_start_situation_, did_navigation_preload_); + } + nav_preload_metrics_->ReportWorkerPreparationFinished(); } void ServiceWorkerURLRequestJob::DidDispatchFetchEvent( @@ -889,31 +986,20 @@ base::Bind(&ServiceWorkerURLRequestJob::DidDispatchFetchEvent, weak_factory_.GetWeakPtr()))); worker_start_time_ = base::TimeTicks::Now(); - did_navigation_preload_ = fetch_dispatcher_->MaybeStartNavigationPreload( - request(), - base::BindOnce(&ServiceWorkerURLRequestJob::OnNavigationPreloadResponse, - weak_factory_.GetWeakPtr())); + nav_preload_metrics_ = base::MakeUnique<NavigationPreloadMetrics>(this); + if (simulate_navigation_preload_for_test_) { + did_navigation_preload_ = true; + } else { + did_navigation_preload_ = fetch_dispatcher_->MaybeStartNavigationPreload( + request(), + base::BindOnce(&ServiceWorkerURLRequestJob::OnNavigationPreloadResponse, + weak_factory_.GetWeakPtr())); + } fetch_dispatcher_->Run(); } void ServiceWorkerURLRequestJob::OnNavigationPreloadResponse() { - DCHECK(navigation_preload_response_time_.is_null()); - navigation_preload_response_time_ = base::TimeTicks::Now(); - MaybeReportNavigationPreloadMetrics(); -} - -void ServiceWorkerURLRequestJob::MaybeReportNavigationPreloadMetrics() { - if (worker_start_time_.is_null() || worker_ready_time_.is_null() || - navigation_preload_response_time_.is_null()) { - return; - } - DCHECK(!reported_navigation_preload_metrics_); - reported_navigation_preload_metrics_ = true; - - ServiceWorkerMetrics::RecordNavigationPreloadResponse( - worker_ready_time_ - worker_start_time_, - navigation_preload_response_time_ - worker_start_time_, - initial_worker_status_, worker_start_situation_); + nav_preload_metrics_->ReportNavigationPreloadFinished(); } } // namespace content
diff --git a/content/browser/service_worker/service_worker_url_request_job.h b/content/browser/service_worker/service_worker_url_request_job.h index 05c56d4..6576cd9 100644 --- a/content/browser/service_worker/service_worker_url_request_job.h +++ b/content/browser/service_worker/service_worker_url_request_job.h
@@ -105,6 +105,15 @@ const ResourceContext* resource_context() const { return resource_context_; } bool did_navigation_preload() const { return did_navigation_preload_; } + // When set, this job will pretend that navigation preload was triggered, but + // not actually do navigation preload. This is to aid unit tests that check + // UMA logging. It's difficult to get navigation preload to work in a unit + // test: there is a much setup of ResourceRequestInfoImpl, + // ResourceRequesterInfo, etc. required. + void set_simulate_navigation_preload_for_test() { + simulate_navigation_preload_for_test_ = true; + } + // Sets the response type. // When an in-flight request possibly needs CORS check, use // FallbackToNetworkOrRenderer. This method will decide whether the request @@ -151,6 +160,9 @@ private: class FileSizeResolver; + class NavigationPreloadMetrics; + friend class DelayHelper; + friend class ServiceWorkerURLRequestJobTest; FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, LostActiveVersion); @@ -177,6 +189,12 @@ // their sizes populated. void CreateRequestBodyBlob(std::string* blob_uuid, uint64_t* blob_size); + // Returns true if this job performed a navigation that should be logged to + // performance-related UMA. It returns false in certain cases that are not + // relevant to performance analysis, such as if the worker was not already + // activated or DevTools was attached to the worker. + bool ShouldRecordNavigationMetrics(const ServiceWorkerVersion* version) const; + // For FORWARD_TO_SERVICE_WORKER case. void DidPrepareFetchEvent(scoped_refptr<ServiceWorkerVersion> version); void DidDispatchFetchEvent( @@ -277,9 +295,9 @@ // True if navigation preload was enabled. bool did_navigation_preload_ = false; + bool simulate_navigation_preload_for_test_ = false; - // True if navigation preload metrics were reported. - bool reported_navigation_preload_metrics_ = false; + std::unique_ptr<NavigationPreloadMetrics> nav_preload_metrics_; ResponseType response_type_;
diff --git a/content/browser/service_worker/service_worker_url_request_job_unittest.cc b/content/browser/service_worker/service_worker_url_request_job_unittest.cc index 3ff8d94..09dffcc 100644 --- a/content/browser/service_worker/service_worker_url_request_job_unittest.cc +++ b/content/browser/service_worker/service_worker_url_request_job_unittest.cc
@@ -15,14 +15,17 @@ #include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" +#include "base/test/histogram_tester.h" #include "base/test/simple_test_tick_clock.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "content/browser/blob_storage/chrome_blob_storage_context.h" +#include "content/browser/loader/resource_request_info_impl.h" #include "content/browser/resource_context_impl.h" #include "content/browser/service_worker/embedded_worker_registry.h" #include "content/browser/service_worker/embedded_worker_test_helper.h" #include "content/browser/service_worker/service_worker_context_core.h" +#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_registration.h" #include "content/browser/service_worker/service_worker_response_info.h" @@ -33,6 +36,7 @@ #include "content/common/service_worker/service_worker_status_code.h" #include "content/common/service_worker/service_worker_types.h" #include "content/public/browser/blob_handle.h" +#include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/request_context_frame_type.h" #include "content/public/common/request_context_type.h" #include "content/public/common/resource_type.h" @@ -77,7 +81,8 @@ blob_storage_context_(blob_storage_context), job_(nullptr), delegate_(delegate), - resource_type_(RESOURCE_TYPE_MAIN_FRAME) {} + resource_type_(RESOURCE_TYPE_MAIN_FRAME), + simulate_navigation_preload_(false) {} ~MockHttpProtocolHandler() override {} @@ -85,6 +90,9 @@ void set_custom_timeout(base::Optional<base::TimeDelta> timeout) { custom_timeout_ = timeout; } + void set_simulate_navigation_preload() { + simulate_navigation_preload_ = true; + } net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, @@ -104,6 +112,9 @@ REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, scoped_refptr<ResourceRequestBodyImpl>(), ServiceWorkerFetchType::FETCH, custom_timeout_, delegate_); + if (simulate_navigation_preload_) { + job_->set_simulate_navigation_preload_for_test(); + } job_->ForwardToServiceWorker(); return job_; } @@ -116,6 +127,7 @@ mutable ServiceWorkerURLRequestJob* job_; ServiceWorkerURLRequestJob::Delegate* delegate_; ResourceType resource_type_; + bool simulate_navigation_preload_; base::Optional<base::TimeDelta> custom_timeout_; }; @@ -137,11 +149,19 @@ return headers; } +void SaveStatusCallback(ServiceWorkerStatusCode* out_status, + ServiceWorkerStatusCode status) { + *out_status = status; +} + } // namespace class ServiceWorkerURLRequestJobTest : public testing::Test, public ServiceWorkerURLRequestJob::Delegate { + public: + MockHttpProtocolHandler* handler() { return http_protocol_handler_; } + protected: ServiceWorkerURLRequestJobTest() : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), @@ -228,6 +248,7 @@ version_ = nullptr; registration_ = nullptr; helper_.reset(); + request_.reset(); } void TestRequestResult(int expected_status_code, @@ -339,6 +360,24 @@ base::RunLoop().RunUntilIdle(); } + // Starts a navigation request with navigation preload enabled. + void SetUpNavigationPreloadTest(ResourceType resource_type) { + version_->SetStatus(ServiceWorkerVersion::ACTIVATED); + http_protocol_handler_->set_resource_type(resource_type); + http_protocol_handler_->set_simulate_navigation_preload(); + request_ = url_request_context_.CreateRequest( + GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY, + &url_request_delegate_, TRAFFIC_ANNOTATION_FOR_TESTS); + ResourceRequestInfo::AllocateForTesting( + request_.get(), resource_type, browser_context_->GetResourceContext(), + -1, -1, -1, resource_type == RESOURCE_TYPE_MAIN_FRAME, false, true, + true, PREVIEWS_OFF); + + request_->set_method("GET"); + request_->Start(); + base::RunLoop().RunUntilIdle(); + } + TestBrowserThreadBundle thread_bundle_; std::unique_ptr<TestBrowserContext> browser_context_; @@ -385,6 +424,229 @@ EXPECT_EQ(std::string(), info->response_cache_storage_cache_name()); } +// Helper for controlling when to start a worker and respond to a fetch event. +class DelayHelper : public EmbeddedWorkerTestHelper { + public: + DelayHelper(ServiceWorkerURLRequestJobTest* test) + : EmbeddedWorkerTestHelper(base::FilePath()), test_(test) {} + ~DelayHelper() override {} + + void CompleteNavigationPreload() { + test_->handler()->job()->OnNavigationPreloadResponse(); + } + + void CompleteStartWorker() { + EmbeddedWorkerTestHelper::OnStartWorker( + embedded_worker_id_, service_worker_version_id_, scope_, script_url_, + pause_after_download_, std::move(start_worker_request_), + std::move(start_worker_instance_host_)); + } + + void Respond() { + response_callback_->OnResponse( + ServiceWorkerResponse( + base::MakeUnique<std::vector<GURL>>(), 200, "OK", + blink::kWebServiceWorkerResponseTypeDefault, + base::MakeUnique<ServiceWorkerHeaderMap>(), std::string(), 0, + blink::kWebServiceWorkerResponseErrorUnknown, base::Time(), + false /* response_is_in_cache_storage */, + std::string() /* response_cache_storage_cache_name */, + base::MakeUnique< + ServiceWorkerHeaderList>() /* cors_exposed_header_names */), + base::Time::Now()); + std::move(finish_callback_).Run(SERVICE_WORKER_OK, base::Time::Now()); + } + + protected: + void OnStartWorker(int embedded_worker_id, + int64_t service_worker_version_id, + const GURL& scope, + const GURL& script_url, + bool pause_after_download, + mojom::ServiceWorkerEventDispatcherRequest request, + mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo + instance_host) override { + embedded_worker_id_ = embedded_worker_id; + service_worker_version_id_ = service_worker_version_id; + scope_ = scope; + script_url_ = script_url; + pause_after_download_ = pause_after_download; + start_worker_request_ = std::move(request); + start_worker_instance_host_ = std::move(instance_host); + } + + void OnFetchEvent( + int embedded_worker_id, + int fetch_event_id, + const ServiceWorkerFetchRequest& /* request */, + mojom::FetchEventPreloadHandlePtr preload_handle, + mojom::ServiceWorkerFetchResponseCallbackPtr response_callback, + FetchCallback finish_callback) override { + embedded_worker_id_ = embedded_worker_id; + fetch_event_id_ = fetch_event_id; + response_callback_ = std::move(response_callback); + finish_callback_ = std::move(finish_callback); + preload_handle_ = std::move(preload_handle); + } + + private: + int64_t service_worker_version_id_; + GURL scope_; + GURL script_url_; + bool pause_after_download_; + mojom::ServiceWorkerEventDispatcherRequest start_worker_request_; + mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo + start_worker_instance_host_; + int embedded_worker_id_ = 0; + int fetch_event_id_ = 0; + mojom::ServiceWorkerFetchResponseCallbackPtr response_callback_; + mojom::FetchEventPreloadHandlePtr preload_handle_; + FetchCallback finish_callback_; + ServiceWorkerURLRequestJobTest* test_; + DISALLOW_COPY_AND_ASSIGN(DelayHelper); +}; + +TEST_F(ServiceWorkerURLRequestJobTest, + NavPreloadMetrics_WorkerAlreadyStarted_MainFrame) { + SetUpWithHelper(base::MakeUnique<DelayHelper>(this)); + DelayHelper* helper = static_cast<DelayHelper*>(helper_.get()); + + // Start the worker before the navigation. + ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE; + base::HistogramTester histogram_tester; + version_->StartWorker(ServiceWorkerMetrics::EventType::UNKNOWN, + base::Bind(&SaveStatusCallback, &status)); + base::RunLoop().RunUntilIdle(); + helper->CompleteStartWorker(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(SERVICE_WORKER_OK, status); + + // Do the navigation. + SetUpNavigationPreloadTest(RESOURCE_TYPE_MAIN_FRAME); + helper->CompleteNavigationPreload(); + helper->Respond(); + base::RunLoop().RunUntilIdle(); + + histogram_tester.ExpectUniqueSample( + "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type_" + "NavigationPreloadEnabled", + static_cast<int>(ServiceWorkerMetrics::WorkerPreparationType::RUNNING), + 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", false, 1); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + 0); +} + +TEST_F(ServiceWorkerURLRequestJobTest, + NavPreloadMetrics_WorkerFirst_MainFrame) { + SetUpWithHelper(base::MakeUnique<DelayHelper>(this)); + DelayHelper* helper = static_cast<DelayHelper*>(helper_.get()); + + base::HistogramTester histogram_tester; + SetUpNavigationPreloadTest(RESOURCE_TYPE_MAIN_FRAME); + + // Worker finishes first. + helper->CompleteStartWorker(); + helper->CompleteNavigationPreload(); + helper->Respond(); + base::RunLoop().RunUntilIdle(); + + histogram_tester.ExpectUniqueSample( + "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type_" + "NavigationPreloadEnabled", + static_cast<int>(ServiceWorkerMetrics::WorkerPreparationType:: + START_IN_EXISTING_PROCESS), + 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", false, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + false, 1); +} + +TEST_F(ServiceWorkerURLRequestJobTest, + NavPreloadMetrics_NavPreloadFirst_MainFrame) { + SetUpWithHelper(base::MakeUnique<DelayHelper>(this)); + DelayHelper* helper = static_cast<DelayHelper*>(helper_.get()); + + base::HistogramTester histogram_tester; + SetUpNavigationPreloadTest(RESOURCE_TYPE_MAIN_FRAME); + + // Nav preload finishes first. + helper->CompleteNavigationPreload(); + helper->CompleteStartWorker(); + helper->Respond(); + base::RunLoop().RunUntilIdle(); + + histogram_tester.ExpectUniqueSample( + "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type_" + "NavigationPreloadEnabled", + static_cast<int>(ServiceWorkerMetrics::WorkerPreparationType:: + START_IN_EXISTING_PROCESS), + 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", true, 1); + histogram_tester.ExpectUniqueSample( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + true, 1); +} + +TEST_F(ServiceWorkerURLRequestJobTest, NavPreloadMetrics_WorkerFirst_SubFrame) { + SetUpWithHelper(base::MakeUnique<DelayHelper>(this)); + DelayHelper* helper = static_cast<DelayHelper*>(helper_.get()); + + base::HistogramTester histogram_tester; + SetUpNavigationPreloadTest(RESOURCE_TYPE_SUB_FRAME); + + // Worker finishes first. + helper->CompleteStartWorker(); + helper->CompleteNavigationPreload(); + helper->Respond(); + base::RunLoop().RunUntilIdle(); + + histogram_tester.ExpectTotalCount( + "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type_" + "NavigationPreloadEnabled", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + 0); +} + +TEST_F(ServiceWorkerURLRequestJobTest, + NavPreloadMetrics_NavPreloadFirst_SubFrame) { + SetUpWithHelper(base::MakeUnique<DelayHelper>(this)); + DelayHelper* helper = static_cast<DelayHelper*>(helper_.get()); + + base::HistogramTester histogram_tester; + SetUpNavigationPreloadTest(RESOURCE_TYPE_SUB_FRAME); + + // Nav preload finishes first. + helper->CompleteNavigationPreload(); + helper->CompleteStartWorker(); + helper->Respond(); + base::RunLoop().RunUntilIdle(); + + histogram_tester.ExpectTotalCount( + "ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type_" + "NavigationPreloadEnabled", + 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame", 0); + histogram_tester.ExpectTotalCount( + "ServiceWorker.NavPreload.FinishedFirst_MainFrame_" + "StartWorkerExistingProcess", + 0); +} + TEST_F(ServiceWorkerURLRequestJobTest, CustomTimeout) { SetUpWithHelper(base::MakeUnique<EmbeddedWorkerTestHelper>(base::FilePath())); @@ -1137,54 +1399,10 @@ EXPECT_FALSE(version_->HasWork()); } -// Helper for controlling when to respond to a fetch event. -class DelayedResponseHelper : public EmbeddedWorkerTestHelper { - public: - DelayedResponseHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} - ~DelayedResponseHelper() override {} - - void Respond() { - response_callback_->OnResponse( - ServiceWorkerResponse( - base::MakeUnique<std::vector<GURL>>(), 200, "OK", - blink::kWebServiceWorkerResponseTypeDefault, - base::MakeUnique<ServiceWorkerHeaderMap>(), std::string(), 0, - blink::kWebServiceWorkerResponseErrorUnknown, base::Time(), - false /* response_is_in_cache_storage */, - std::string() /* response_cache_storage_cache_name */, - base::MakeUnique< - ServiceWorkerHeaderList>() /* cors_exposed_header_names */), - base::Time::Now()); - std::move(finish_callback_).Run(SERVICE_WORKER_OK, base::Time::Now()); - } - - protected: - void OnFetchEvent( - int embedded_worker_id, - int fetch_event_id, - const ServiceWorkerFetchRequest& /* request */, - mojom::FetchEventPreloadHandlePtr /* preload_handle */, - mojom::ServiceWorkerFetchResponseCallbackPtr response_callback, - FetchCallback finish_callback) override { - embedded_worker_id_ = embedded_worker_id; - fetch_event_id_ = fetch_event_id; - response_callback_ = std::move(response_callback); - finish_callback_ = std::move(finish_callback); - } - - private: - int embedded_worker_id_ = 0; - int fetch_event_id_ = 0; - mojom::ServiceWorkerFetchResponseCallbackPtr response_callback_; - FetchCallback finish_callback_; - DISALLOW_COPY_AND_ASSIGN(DelayedResponseHelper); -}; - // Test cancelling the URLRequest while the fetch event is in flight. TEST_F(ServiceWorkerURLRequestJobTest, CancelRequest) { - SetUpWithHelper(base::MakeUnique<DelayedResponseHelper>()); - DelayedResponseHelper* helper = - static_cast<DelayedResponseHelper*>(helper_.get()); + SetUpWithHelper(base::MakeUnique<DelayHelper>(this)); + DelayHelper* helper = static_cast<DelayHelper*>(helper_.get()); // Start the URL request. The job will be waiting for the // worker to respond to the fetch event. @@ -1195,6 +1413,8 @@ request_->set_method("GET"); request_->Start(); base::RunLoop().RunUntilIdle(); + helper->CompleteStartWorker(); + base::RunLoop().RunUntilIdle(); // Cancel the URL request. request_->Cancel();
diff --git a/content/browser/webui/shared_resources_data_source.cc b/content/browser/webui/shared_resources_data_source.cc index d9aaee7d..86f1cce 100644 --- a/content/browser/webui/shared_resources_data_source.cc +++ b/content/browser/webui/shared_resources_data_source.cc
@@ -196,4 +196,8 @@ return origin; } +bool SharedResourcesDataSource::IsGzipped(const std::string& path) const { + return path == "js/mojo_bindings.js"; +} + } // namespace content
diff --git a/content/browser/webui/shared_resources_data_source.h b/content/browser/webui/shared_resources_data_source.h index ed35d2e..5863c5e 100644 --- a/content/browser/webui/shared_resources_data_source.h +++ b/content/browser/webui/shared_resources_data_source.h
@@ -29,6 +29,7 @@ const std::string& path) const override; std::string GetAccessControlAllowOriginForOrigin( const std::string& origin) const override; + bool IsGzipped(const std::string& path) const override; private: ~SharedResourcesDataSource() override;
diff --git a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java index 22eaf64..f6c01ad0 100644 --- a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java +++ b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
@@ -176,6 +176,9 @@ @Override public void run() { ThreadUtils.assertOnUiThread(); + // Make sure to not call ContentMain.start twice, if startBrowserProcessesSync + // is called before this runs. + if (!sBrowserMayStartAsynchronously) return; if (contentStart() > 0) { // Failed. The callbacks may not have run, so run them. enqueueCallbackExecution(STARTUP_FAILURE, NOT_ALREADY_STARTED);
diff --git a/content/public/browser/devtools_agent_host.h b/content/public/browser/devtools_agent_host.h index 43b7dea3..93f6f1a2 100644 --- a/content/public/browser/devtools_agent_host.h +++ b/content/public/browser/devtools_agent_host.h
@@ -31,7 +31,6 @@ class BrowserContext; class DevToolsExternalAgentProxyDelegate; class DevToolsSocketFactory; -class RenderFrameHost; class WebContents; // Describes interface for managing devtools agents from browser process. @@ -44,6 +43,7 @@ static char kTypeServiceWorker[]; static char kTypeExternal[]; static char kTypeBrowser[]; + static char kTypeGuest[]; static char kTypeOther[]; // Latest DevTools protocol version supported. @@ -69,15 +69,6 @@ static scoped_refptr<DevToolsAgentHost> GetOrCreateFor( WebContents* web_contents); - // Returns DevToolsAgentHost that can be used for inspecting |frame_host|. - // A new DevToolsAgentHost will be created if it does not exist. - // For main frame cases, prefer using the above method which takes WebContents - // instead. - // TODO(dgozman): this is a temporary measure until we can inspect - // cross-process subframes within a single agent. - static scoped_refptr<DevToolsAgentHost> GetOrCreateFor( - RenderFrameHost* frame_host); - // Returns true iff an instance of DevToolsAgentHost for the |web_contents| // does exist. static bool HasFor(WebContents* web_contents);
diff --git a/content/public/browser/devtools_manager_delegate.cc b/content/public/browser/devtools_manager_delegate.cc index da64ce91..088bf75 100644 --- a/content/public/browser/devtools_manager_delegate.cc +++ b/content/public/browser/devtools_manager_delegate.cc
@@ -10,16 +10,15 @@ void DevToolsManagerDelegate::Inspect(DevToolsAgentHost* agent_host) { } -std::string DevToolsManagerDelegate::GetTargetType(RenderFrameHost* host) { +std::string DevToolsManagerDelegate::GetTargetType(WebContents* wc) { return std::string(); } -std::string DevToolsManagerDelegate::GetTargetTitle(RenderFrameHost* host) { +std::string DevToolsManagerDelegate::GetTargetTitle(WebContents* wc) { return std::string(); } -std::string DevToolsManagerDelegate::GetTargetDescription( - RenderFrameHost* host) { +std::string DevToolsManagerDelegate::GetTargetDescription(WebContents* wc) { return std::string(); }
diff --git a/content/public/browser/devtools_manager_delegate.h b/content/public/browser/devtools_manager_delegate.h index 22699ece9..091292f 100644 --- a/content/public/browser/devtools_manager_delegate.h +++ b/content/public/browser/devtools_manager_delegate.h
@@ -19,21 +19,21 @@ namespace content { -class RenderFrameHost; +class WebContents; class CONTENT_EXPORT DevToolsManagerDelegate { public: // Opens the inspector for |agent_host|. virtual void Inspect(DevToolsAgentHost* agent_host); - // Returns DevToolsAgentHost type to use for given |host| target. - virtual std::string GetTargetType(RenderFrameHost* host); + // Returns DevToolsAgentHost type to use for given |web_contents| target. + virtual std::string GetTargetType(WebContents* web_contents); - // Returns DevToolsAgentHost title to use for given |host| target. - virtual std::string GetTargetTitle(RenderFrameHost* host); + // Returns DevToolsAgentHost title to use for given |web_contents| target. + virtual std::string GetTargetTitle(WebContents* web_contents); - // Returns DevToolsAgentHost title to use for given |host| target. - virtual std::string GetTargetDescription(RenderFrameHost* host); + // Returns DevToolsAgentHost title to use for given |web_contents| target. + virtual std::string GetTargetDescription(WebContents* web_contents); // Returns all targets embedder would like to report as debuggable // remotely.
diff --git a/content/renderer/fetchers/resource_fetcher_impl.cc b/content/renderer/fetchers/resource_fetcher_impl.cc index f0f62b6..c83f04c 100644 --- a/content/renderer/fetchers/resource_fetcher_impl.cc +++ b/content/renderer/fetchers/resource_fetcher_impl.cc
@@ -183,6 +183,7 @@ request_.SetRequestContext(request_context); request_.SetFirstPartyForCookies(frame->GetDocument().FirstPartyForCookies()); + request_.SetRequestorOrigin(frame->GetDocument().GetSecurityOrigin()); request_.AddHTTPOriginIfNeeded(blink::WebSecurityOrigin::CreateUnique()); client_.reset(new ClientImpl(this, callback));
diff --git a/content/renderer/media/webrtc_audio_device_not_impl.h b/content/renderer/media/webrtc_audio_device_not_impl.h index e9a98f0..bff479c 100644 --- a/content/renderer/media/webrtc_audio_device_not_impl.h +++ b/content/renderer/media/webrtc_audio_device_not_impl.h
@@ -114,7 +114,7 @@ #endif // OS_IOS protected: - ~WebRtcAudioDeviceNotImpl() override{}; + ~WebRtcAudioDeviceNotImpl() override {} private: base::TimeTicks last_process_time_;
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 07aefd06..ffdd088 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -4216,29 +4216,6 @@ } void RenderFrameImpl::WillSendRequest(blink::WebURLRequest& request) { - // Set the first party for cookies url if it has not been set yet (new - // requests). This value will be updated during redirects, consistent with - // https://tools.ietf.org/html/draft-west-first-party-cookies-04#section-2.1.1 - if (request.FirstPartyForCookies().IsEmpty()) { - if (request.GetFrameType() == blink::WebURLRequest::kFrameTypeTopLevel) - request.SetFirstPartyForCookies(request.Url()); - else - request.SetFirstPartyForCookies( - frame_->GetDocument().FirstPartyForCookies()); - } - - // Set the requestor origin to the same origin as the frame's document if it - // hasn't yet been set. - // - // TODO(mkwst): It would be cleaner to adjust blink::ResourceRequest to - // initialize itself with a `nullptr` initiator so that this can be a simple - // `isNull()` check. https://crbug.com/625969 - WebDocument frame_document = frame_->GetDocument(); - if (request.RequestorOrigin().IsUnique() && - !frame_document.GetSecurityOrigin().IsUnique()) { - request.SetRequestorOrigin(frame_document.GetSecurityOrigin()); - } - WebDataSource* provisional_data_source = frame_->ProvisionalDataSource(); WebDataSource* data_source = provisional_data_source ? provisional_data_source : frame_->DataSource(); @@ -4309,6 +4286,7 @@ int parent_routing_id = parent ? RenderFrame::GetRoutingIdForWebFrame(parent) : -1; + WebDocument frame_document = frame_->GetDocument(); RequestExtraData* extra_data = static_cast<RequestExtraData*>(request.GetExtraData()); if (!extra_data) @@ -6291,6 +6269,8 @@ CHECK(IsBrowserSideNavigationEnabled()); browser_side_navigation_pending_ = true; + blink::WebURLRequest& request = info.url_request; + // Note: At this stage, the goal is to apply all the modifications the // renderer wants to make to the request, and then send it to the browser, so // that the actual network request can be started. Ideally, all such @@ -6301,7 +6281,15 @@ // TODO(clamy): Apply devtools override. // TODO(clamy): Make sure that navigation requests are not modified somewhere // else in blink. - WillSendRequest(info.url_request); + WillSendRequest(request); + + // Set RequestorOrigin and FirstPartyForCookies. + WebDocument frame_document = frame_->GetDocument(); + if (request.GetFrameType() == blink::WebURLRequest::kFrameTypeTopLevel) + request.SetFirstPartyForCookies(request.Url()); + else + request.SetFirstPartyForCookies(frame_document.FirstPartyForCookies()); + request.SetRequestorOrigin(frame_document.GetSecurityOrigin()); // Update the transition type of the request for client side redirects. if (!info.url_request.GetExtraData()) @@ -6331,10 +6319,9 @@ GetRequestContextFrameTypeForWebURLRequest(info.url_request) == REQUEST_CONTEXT_FRAME_TYPE_NESTED); + DCHECK(!info.url_request.RequestorOrigin().IsNull()); base::Optional<url::Origin> initiator_origin = - info.url_request.RequestorOrigin().IsNull() - ? base::Optional<url::Origin>() - : base::Optional<url::Origin>(info.url_request.RequestorOrigin()); + base::Optional<url::Origin>(info.url_request.RequestorOrigin()); int load_flags = GetLoadFlagsForWebURLRequest(info.url_request);
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index a342281..60821cc4 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -631,7 +631,7 @@ GetRoutingID(), request_id, options)); } -void ServiceWorkerContextClient::OpenWindowForClients( +void ServiceWorkerContextClient::OpenNewTab( const blink::WebURL& url, std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { DCHECK(callbacks); @@ -639,7 +639,7 @@ Send(new ServiceWorkerHostMsg_OpenNewTab(GetRoutingID(), request_id, url)); } -void ServiceWorkerContextClient::OpenWindowForPaymentHandler( +void ServiceWorkerContextClient::OpenNewPopup( const blink::WebURL& url, std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { DCHECK(callbacks);
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h index 12aacbf..5b5cac9 100644 --- a/content/renderer/service_worker/service_worker_context_client.h +++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -102,10 +102,10 @@ void GetClients( const blink::WebServiceWorkerClientQueryOptions&, std::unique_ptr<blink::WebServiceWorkerClientsCallbacks>) override; - void OpenWindowForClients( + void OpenNewTab( const blink::WebURL&, std::unique_ptr<blink::WebServiceWorkerClientCallbacks>) override; - void OpenWindowForPaymentHandler( + void OpenNewPopup( const blink::WebURL&, std::unique_ptr<blink::WebServiceWorkerClientCallbacks>) override; void SetCachedMetadata(const blink::WebURL&,
diff --git a/content/shell/test_runner/mock_web_media_stream_center.h b/content/shell/test_runner/mock_web_media_stream_center.h index 8354088..610f1a9d 100644 --- a/content/shell/test_runner/mock_web_media_stream_center.h +++ b/content/shell/test_runner/mock_web_media_stream_center.h
@@ -17,7 +17,7 @@ class MockWebMediaStreamCenter : public blink::WebMediaStreamCenter { public: MockWebMediaStreamCenter() = default; - ~MockWebMediaStreamCenter() override{}; + ~MockWebMediaStreamCenter() override {} void DidEnableMediaStreamTrack( const blink::WebMediaStreamTrack& track) override;
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 1482288a..4654ae71 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -44,10 +44,6 @@ self.Flaky('conformance2/query/occlusion-query.html', bug=603168) self.Fail('conformance2/glsl3/tricky-loop-conditions.html', bug=483282) - # canvas.commit() promise synchronization isn't fully reliable yet. - self.Fail('conformance/offscreencanvas/offscreencanvas-resize.html', - bug=709484) - self.Fail('conformance2/rendering/depth-stencil-feedback-loop.html', bug=660844) # WebGL 2.0.1 self.Fail('conformance2/rendering/rendering-sampling-feedback-loop.html', @@ -68,7 +64,6 @@ ['win', 'd3d11'], bug=644740) self.Fail('conformance2/textures/misc/tex-base-level-bug.html', ['win', 'd3d11'], bug=705865) - self.Fail('deqp/functional/gles3/sync.html', ['win', 'd3d11'], bug=676848) # Win / NVidia self.Flaky('deqp/functional/gles3/fbomultisample*', @@ -82,28 +77,11 @@ 'basic_types_interleaved_lines.html', ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) self.Fail('deqp/functional/gles3/transformfeedback/' + - 'basic_types_interleaved_triangles.html', - ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) - self.Fail('deqp/functional/gles3/transformfeedback/' + 'basic_types_separate_lines.html', ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) self.Fail('deqp/functional/gles3/transformfeedback/' + - 'basic_types_separate_triangles.html', - ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) - self.Fail('deqp/functional/gles3/transformfeedback/' + - 'random_interleaved_lines.html', - ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) - self.Fail('deqp/functional/gles3/transformfeedback/' + 'random_interleaved_triangles.html', ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) - self.Fail('deqp/functional/gles3/transformfeedback/' + - 'random_separate_lines.html', - ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) - self.Fail('deqp/functional/gles3/transformfeedback/' + - 'random_separate_triangles.html', - ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) - self.Fail('deqp/functional/gles3/transformfeedback/interpolation_flat.html', - ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=680754) self.Flaky('conformance/textures/image_bitmap_from_video/' + 'tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html', ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=728670) @@ -118,12 +96,8 @@ ['win10', ('nvidia', 0x1cb3), 'd3d11'], bug=728670) # Win / NVIDIA / OpenGL - self.Fail('conformance2/rendering/framebuffer-texture-level1.html', - ['win', 'nvidia', 'opengl'], bug=693090) self.Fail('conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug.html', ['win', 'nvidia', 'opengl'], bug=693090) - self.Fail('conformance2/textures/misc/tex-srgb-mipmap.html', - ['win', 'nvidia', 'opengl'], bug=693090) self.Fail('conformance2/glsl3/' + 'vector-dynamic-indexing-swizzled-lvalue.html', ['win', 'nvidia', 'opengl'], bug=709874) @@ -132,19 +106,6 @@ self.Fail('conformance2/rendering/blitframebuffer-stencil-only.html', ['win', 'amd', 'd3d11'], bug=483282) # owner:jmadill - # Failing on old R5 230 configuration. - self.Fail('deqp/functional/gles3/shadertexturefunction/' + - 'texelfetchoffset.html', - ['win', ('amd', 0x6779), 'd3d11'], bug=483282) - - self.Fail('deqp/functional/gles3/transformfeedback/*', - ['win', ('amd', 0x6779, 'd3d11')], bug=626068) - - self.Fail('deqp/functional/gles3/shadercommonfunction.html', - ['win', ('amd', 0x6779), 'd3d11'], bug=483282) - self.Fail('deqp/functional/gles3/multisample.html', - ['win', ('amd', 0x6779), 'd3d11'], bug=617290) - # Keep a separate set of failures for the R7 240, since it can use a new # and updated driver. The older drivers won't ever get fixes from AMD. # Use ['win', ('amd', 0x6613)] for the R7 240 devices. @@ -155,19 +116,10 @@ self.Flaky('deqp/functional/gles3/multisample.html', ['win', ('amd', 0x6613)], bug=687374) - # It's unfortunate that these suppressions need to be so broad, but - # basically any test that uses readPixels is potentially flaky, and - # it's infeasible to suppress individual failures one by one. - self.Flaky('conformance/*', ['win', ('amd', 0x6779), 'd3d11'], bug=491419) - self.Flaky('conformance2/*', ['win', ('amd', 0x6779), 'd3d11'], bug=491419) - self.Flaky('deqp/*', ['win', ('amd', 0x6779), 'd3d11'], bug=491419) - # Win / Intel self.Fail('conformance2/glsl3/' + 'texture-offset-uniform-texture-coordinate.html', ['win', 'intel', 'd3d11'], bug=662644) # WebGL 2.0.1 - self.Fail('conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html', - ['win', 'intel', 'd3d11'], bug=662644) # WebGL 2.0.1 self.Skip('conformance2/textures/misc/copy-texture-image.html', ['win', 'intel', 'd3d11'], bug=617449) # Seems to cause the harness to fail immediately afterward @@ -178,22 +130,9 @@ self.Skip('deqp/functional/gles3/texturespecification/' + 'teximage3d_depth_pbo.html', ['win', 'intel', 'd3d11'], bug=617449) - self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html', - ['win', 'intel', 'd3d11'], bug=614418) - self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html', - ['win', 'intel', 'd3d11'], bug=614418) - self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html', - ['win', 'intel', 'd3d11'], bug=614418) - self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html', - ['win', 'intel', 'd3d11'], bug=614418) - self.Fail('deqp/functional/gles3/textureformat/sized_depth_stencil.html', - ['win', 'intel', 'd3d11'], bug=614418) self.Flaky('deqp/functional/gles3/textureformat/unsized_3d.html', ['win', 'intel', 'd3d11'], bug=614418) - self.Fail('deqp/functional/gles3/fbomultisample*', - ['win', 'intel', 'd3d11'], bug=483282) - # These tests seem to crash flakily. It's best to leave them as skip # until we can run them without GPU hangs and crashes. self.Skip('deqp/functional/gles3/textureshadow/2d_array_*.html',
diff --git a/device/vr/openvr/openvr_gamepad_data_fetcher.cc b/device/vr/openvr/openvr_gamepad_data_fetcher.cc index d165b442..cccdb372 100644 --- a/device/vr/openvr/openvr_gamepad_data_fetcher.cc +++ b/device/vr/openvr/openvr_gamepad_data_fetcher.cc
@@ -195,10 +195,10 @@ gfx::DecomposeTransform(&decomposed_transform, transform); pad.pose.orientation.not_null = true; - pad.pose.orientation.x = decomposed_transform.quaternion[0]; - pad.pose.orientation.y = decomposed_transform.quaternion[1]; - pad.pose.orientation.z = decomposed_transform.quaternion[2]; - pad.pose.orientation.w = decomposed_transform.quaternion[3]; + pad.pose.orientation.x = decomposed_transform.quaternion.x(); + pad.pose.orientation.y = decomposed_transform.quaternion.y(); + pad.pose.orientation.z = decomposed_transform.quaternion.z(); + pad.pose.orientation.w = decomposed_transform.quaternion.w(); pad.pose.position.not_null = true; pad.pose.position.x = decomposed_transform.translate[0];
diff --git a/docs/clang_tool_refactoring.md b/docs/clang_tool_refactoring.md index 4554646..4168145 100644 --- a/docs/clang_tool_refactoring.md +++ b/docs/clang_tool_refactoring.md
@@ -110,6 +110,12 @@ It is important to use --bootstrap as there appear to be [bugs](https://crbug.com/580745) in the clang library this script produces if you build it with gcc, which is the default. +Once clang is bootsrapped, incremental builds can be done by invoking `ninja` in +the `third_party/llvm-build/Release+Asserts` directory. In particular, +recompiling solely the tool you are writing can be accomplished by executing +`ninja rewrite_to_chrome_style` (replace `rewrite_to_chrome_style` with your +tool's name). + ## Running First, build all Chromium targets to avoid failures due to missing dependencies that are generated as part of the build:
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc b/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc index 47180d3..004f8fa 100644 --- a/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc
@@ -27,7 +27,7 @@ public: TestUpstartClient() : enqueue_requests_(false) {} - ~TestUpstartClient() override{}; + ~TestUpstartClient() override {} // Overrides behavior to queue start requests. void StartMediaAnalytics(const UpstartCallback& callback) override {
diff --git a/google_apis/drive/drive_api_url_generator.cc b/google_apis/drive/drive_api_url_generator.cc index dcd4231..1f4f106 100644 --- a/google_apis/drive/drive_api_url_generator.cc +++ b/google_apis/drive/drive_api_url_generator.cc
@@ -211,6 +211,11 @@ url = net::AppendOrReplaceQueryParameter(url, kSupportsTeamDrives, "true"); url = net::AppendOrReplaceQueryParameter(url, kIncludeTeamDriveItems, "true"); + // This is a workaound as currently the server returns HTTP_NOT_FOUND when + // "default,allTeamDrives" corpora is combined with certain queries. + // TODO(yamaguchi): Remove this hack once "allTeamDrives" works correctly. + if (corpora == FilesListCorpora::ALL_TEAM_DRIVES) + corpora = FilesListCorpora::DEFAULT; url = net::AppendOrReplaceQueryParameter(url, kCorpora, GetCorporaString(corpora)); if (!team_drive_id.empty())
diff --git a/google_apis/drive/drive_api_url_generator_unittest.cc b/google_apis/drive/drive_api_url_generator_unittest.cc index f2f4523..ceed9bb5 100644 --- a/google_apis/drive/drive_api_url_generator_unittest.cc +++ b/google_apis/drive/drive_api_url_generator_unittest.cc
@@ -203,9 +203,16 @@ }; const std::string kV2FilesUrlPrefix = "https://www.example.com/drive/v2/files"; + + // "corpora=default" for this case is a workaound as currently the server + // returns HTTP_NOT_FOUND when "default,allTeamDrives" corpora is combined + // with certain queries. We use "default" corpora intead, so that we can + // still get some files under Team Drive which the user is subscribed. + // TODO(yamaguchi): Remove this workaround. The 3rd line should be + // "includeTeamDriveItems=true&corpora=default%2CallTeamDrives"; const std::string kV2FilesUrlPrefixWithTeamDrives = "https://www.example.com/drive/v2/files?supportsTeamDrives=true&" - "includeTeamDriveItems=true&corpora=default%2CallTeamDrives"; + "includeTeamDriveItems=true&corpora=default"; for (size_t i = 0; i < arraysize(kTestPatterns); ++i) { EXPECT_EQ(kV2FilesUrlPrefix +
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index c57d6d7..15816d5 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -106,9 +106,6 @@ sources = [ "lib/tab_socket.mojom", ] - - # TODO(crbug.com/714018): Convert the implementation to use OnceCallback. - use_once_callback = false } grit("resources") {
diff --git a/headless/lib/browser/headless_tab_socket_impl.cc b/headless/lib/browser/headless_tab_socket_impl.cc index a488ca0e..1fc89a5 100644 --- a/headless/lib/browser/headless_tab_socket_impl.cc +++ b/headless/lib/browser/headless_tab_socket_impl.cc
@@ -19,13 +19,12 @@ outgoing_message_queue_.push_back(message); return; } else { - callback = waiting_for_message_cb_; - waiting_for_message_cb_ = AwaitNextMessageFromEmbedderCallback(); + callback = std::move(waiting_for_message_cb_); DCHECK(waiting_for_message_cb_.is_null()); } } - callback.Run(message); + std::move(callback).Run(message); } void HeadlessTabSocketImpl::SetListener(Listener* listener) { @@ -61,12 +60,12 @@ } void HeadlessTabSocketImpl::AwaitNextMessageFromEmbedder( - const AwaitNextMessageFromEmbedderCallback& callback) { + AwaitNextMessageFromEmbedderCallback callback) { std::string message; { base::AutoLock lock(lock_); if (outgoing_message_queue_.empty()) { - waiting_for_message_cb_ = callback; + waiting_for_message_cb_ = std::move(callback); DCHECK(!waiting_for_message_cb_.is_null()); return; } else { @@ -74,7 +73,7 @@ outgoing_message_queue_.pop_front(); } } - callback.Run(message); + std::move(callback).Run(message); } void HeadlessTabSocketImpl::CreateMojoService(
diff --git a/headless/lib/browser/headless_tab_socket_impl.h b/headless/lib/browser/headless_tab_socket_impl.h index 93cc610..45796be 100644 --- a/headless/lib/browser/headless_tab_socket_impl.h +++ b/headless/lib/browser/headless_tab_socket_impl.h
@@ -26,7 +26,7 @@ // TabSocket implementation: void SendMessageToEmbedder(const std::string& message) override; void AwaitNextMessageFromEmbedder( - const AwaitNextMessageFromEmbedderCallback& callback) override; + AwaitNextMessageFromEmbedderCallback callback) override; void CreateMojoService(mojo::InterfaceRequest<TabSocket> request);
diff --git a/ios/build/bots/chromium.webrtc.fyi/ios-device.json b/ios/build/bots/chromium.webrtc.fyi/ios-device.json new file mode 100644 index 0000000..c03de84 --- /dev/null +++ b/ios/build/bots/chromium.webrtc.fyi/ios-device.json
@@ -0,0 +1,24 @@ +{ + "comments": [ + "Builder for 32-bit devices.", + "Build is performed with gn+ninja." + ], + "xcode version": "8.0", + "gn_args": [ + "additional_target_cpus=[ \"arm64\" ]", + "goma_dir=\"$(goma_dir)\"", + "ios_enable_code_signing=false", + "is_component_build=false", + "is_debug=false", + "target_cpu=\"arm\"", + "target_os=\"ios\"", + "use_goma=true" + ], + "additional_compile_targets": [ + "all" + ], + "configuration": "Release", + "sdk": "iphoneos10.0", + "tests": [ + ] +}
diff --git a/ios/build/bots/chromium.webrtc.fyi/ios-simulator.json b/ios/build/bots/chromium.webrtc.fyi/ios-simulator.json new file mode 100644 index 0000000..79d61520 --- /dev/null +++ b/ios/build/bots/chromium.webrtc.fyi/ios-simulator.json
@@ -0,0 +1,65 @@ +{ + "comments": [ + "Runs tests on @3x, @2x, 64-bit, 32-bit, phone, tablet, iOS 10, and iOS 9." + ], + "xcode version": "8.0", + "gn_args": [ + "additional_target_cpus=[\"x86\"]", + "goma_dir=\"$(goma_dir)\"", + "ios_enable_code_signing=false", + "is_component_build=false", + "is_debug=true", + "target_cpu=\"x64\"", + "target_os=\"ios\"", + "use_goma=true" + ], + "additional_compile_targets": [ + "all" + ], + "configuration": "Debug", + "sdk": "iphonesimulator10.0", + "tests": [ + { + "include": "common_tests.json", + "device type": "iPhone 6s Plus", + "os": "10.0", + "xcode version": "8.0" + }, + { + "include": "common_tests.json", + "device type": "iPhone 6s", + "os": "10.0", + "xcode version": "8.0" + }, + { + "include": "common_tests.json", + "device type": "iPhone 5", + "os": "10.0", + "xcode version": "8.0" + }, + { + "include": "common_tests.json", + "device type": "iPad Air 2", + "os": "10.0", + "xcode version": "8.0" + }, + { + "include": "common_tests.json", + "device type": "iPad Retina", + "os": "10.0", + "xcode version": "8.0" + }, + { + "include": "common_tests.json", + "device type": "iPhone 5", + "os": "9.0", + "xcode version": "8.0" + }, + { + "include": "common_tests.json", + "device type": "iPad Air 2", + "os": "9.0", + "xcode version": "8.0" + } + ] +}
diff --git a/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm b/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm index 87d0f307..f8cf7e7 100644 --- a/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm +++ b/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm
@@ -79,7 +79,7 @@ explicit SpotlightBookmarkModelBridge(BookmarksSpotlightManager* owner) : owner_(owner){}; - ~SpotlightBookmarkModelBridge() override{}; + ~SpotlightBookmarkModelBridge() override {} void BookmarkNodeRemoved(bookmarks::BookmarkModel* model, const bookmarks::BookmarkNode* parent, @@ -133,7 +133,7 @@ void BookmarkNodeChildrenReordered( bookmarks::BookmarkModel* model, - const bookmarks::BookmarkNode* node) override{}; + const bookmarks::BookmarkNode* node) override {} void BookmarkNodeMoved(bookmarks::BookmarkModel* model, const bookmarks::BookmarkNode* old_parent,
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index 3eed013..b1f5fb2 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -543,6 +543,12 @@ <message name="IDS_IOS_CONTENT_CONTEXT_SAVEIMAGE" desc="The name of the Save Image As command in the content area context menu"> Save Image </message> + <message name="IDS_IOS_CONTENT_SUGGESTIONS_ACCESSIBILITY_LABEL_SUGGESTION" desc="The accessibility label of a suggestion. Summarizes fields in the reading list entry (title, publisher informations, status and informations). Read by Text-to-Speech."> + <ph name="TITLE"><ex>Learn about the new Chromium Projects</ex>$1</ph>, <ph name="PUBLISHER_INFORMATION"><ex>The Chromium organization</ex>$2</ph>, <ph name="PUBLICATION_DATE"><ex>January 1 2017</ex>$3</ph>, <ph name="STATE"><ex>Available offline</ex>$4</ph>, <ph name="ADDITIONAL_INFORMATIONS"><ex>The Chromium projects include Chromium and Chromium OS...</ex>$5</ph> + </message> + <message name="IDS_IOS_CONTENT_SUGGESTIONS_ACCESSIBILITY_AVAILABLE_OFFLINE" desc="Accessibility label to indicate that the suggestion is available offline. Read by Text-to-Speech."> + Available offline + </message> <message name="IDS_IOS_CONTENT_SUGGESTIONS_FOOTER_TITLE" desc="The title of the footer of the sections of Content Suggestions"> More </message>
diff --git a/ios/chrome/browser/native_app_launcher/native_app_infobar_controller_unittest.mm b/ios/chrome/browser/native_app_launcher/native_app_infobar_controller_unittest.mm index 45b0d5d..5676ce2 100644 --- a/ios/chrome/browser/native_app_launcher/native_app_infobar_controller_unittest.mm +++ b/ios/chrome/browser/native_app_launcher/native_app_infobar_controller_unittest.mm
@@ -54,9 +54,9 @@ class MockInfobarViewDelegate : public InfoBarViewDelegate { public: - void SetInfoBarTargetHeight(int height) override{}; - void InfoBarDidCancel() override{}; - void InfoBarButtonDidPress(NSUInteger button_id) override{}; + void SetInfoBarTargetHeight(int height) override {} + void InfoBarDidCancel() override {} + void InfoBarButtonDidPress(NSUInteger button_id) override {} }; protected:
diff --git a/ios/chrome/browser/payments/test_payment_request.h b/ios/chrome/browser/payments/test_payment_request.h index 421c317..abfbca5 100644 --- a/ios/chrome/browser/payments/test_payment_request.h +++ b/ios/chrome/browser/payments/test_payment_request.h
@@ -30,7 +30,7 @@ autofill::PersonalDataManager* personal_data_manager) : PaymentRequest(web_payment_request, personal_data_manager) {} - ~TestPaymentRequest() override{}; + ~TestPaymentRequest() override {} void SetRegionDataLoader(autofill::RegionDataLoader* region_data_loader) { region_data_loader_ = region_data_loader;
diff --git a/ios/chrome/browser/ui/bookmarks/undo_manager_bridge_observer.h b/ios/chrome/browser/ui/bookmarks/undo_manager_bridge_observer.h index 0761fbb..8abc3bf 100644 --- a/ios/chrome/browser/ui/bookmarks/undo_manager_bridge_observer.h +++ b/ios/chrome/browser/ui/bookmarks/undo_manager_bridge_observer.h
@@ -20,7 +20,7 @@ class UndoManagerBridge : public UndoManagerObserver { public: explicit UndoManagerBridge(id<UndoManagerBridgeObserver> observer); - ~UndoManagerBridge() override{}; + ~UndoManagerBridge() override {} private: void OnUndoManagerStateChange() override;
diff --git a/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.mm b/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.mm index 735e137..0662dda 100644 --- a/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.mm +++ b/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.mm
@@ -79,6 +79,8 @@ [cell setAdditionalInformationWithPublisherName:self.publisher date:[self relativeDate] offlineAvailability:self.availableOffline]; + cell.isAccessibilityElement = YES; + cell.accessibilityLabel = [self accessibilityLabel]; } - (void)setImage:(UIImage*)image { @@ -108,4 +110,21 @@ return relativeDate; } +// Returns the accessibility label. +- (NSString*)accessibilityLabel { + NSString* offlineAvailability = @""; + if (self.availableOffline) { + offlineAvailability = l10n_util::GetNSString( + IDS_IOS_CONTENT_SUGGESTIONS_ACCESSIBILITY_AVAILABLE_OFFLINE); + } + + return l10n_util::GetNSStringF( + IDS_IOS_CONTENT_SUGGESTIONS_ACCESSIBILITY_LABEL_SUGGESTION, + base::SysNSStringToUTF16(self.title), + base::SysNSStringToUTF16(self.publisher), + base::SysNSStringToUTF16([self relativeDate]), + base::SysNSStringToUTF16(offlineAvailability), + base::SysNSStringToUTF16(self.subtitle)); +} + @end
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.mm b/ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.mm index ab307e6..da0aa9b 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.mm
@@ -53,7 +53,7 @@ [owner_ readingListModelCompletedBatchUpdates:model]; } - void ReadingListModelBeingDeleted(const ReadingListModel* model) override{}; + void ReadingListModelBeingDeleted(const ReadingListModel* model) override {} void ReadingListDidApplyChanges(ReadingListModel* model) override { [owner_ readingListModelCompletedBatchUpdates:model];
diff --git a/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm b/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm index 6fde817..4dca72ba 100644 --- a/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
@@ -137,7 +137,7 @@ public: SigninObserverBridge(ios::ChromeBrowserState* browserState, SettingsCollectionViewController* owner); - ~SigninObserverBridge() override{}; + ~SigninObserverBridge() override {} // SigninManagerBase::Observer implementation: void GoogleSigninSucceeded(const std::string& account_id,
diff --git a/ios/web/navigation/navigation_manager_impl_unittest.mm b/ios/web/navigation/navigation_manager_impl_unittest.mm index 3f24089..0cc3e0f0 100644 --- a/ios/web/navigation/navigation_manager_impl_unittest.mm +++ b/ios/web/navigation/navigation_manager_impl_unittest.mm
@@ -45,7 +45,7 @@ void LoadURLWithParams(const NavigationManager::WebLoadParams&) override {} void Reload() override { reload_called_ = true; } void OnNavigationItemsPruned(size_t pruned_item_count) override {} - void OnNavigationItemChanged() override{}; + void OnNavigationItemChanged() override {} void OnNavigationItemCommitted(const LoadCommittedDetails&) override {} WebState* GetWebState() override { return nullptr; }
diff --git a/ios/web/public/test/http_server/BUILD.gn b/ios/web/public/test/http_server/BUILD.gn index d96c5b40..eab43eb 100644 --- a/ios/web/public/test/http_server/BUILD.gn +++ b/ios/web/public/test/http_server/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. source_set("http_server") { + configs += [ "//build/config/compiler:enable_arc" ] testonly = true deps = [
diff --git a/ios/web/public/test/http_server/data_response_provider.mm b/ios/web/public/test/http_server/data_response_provider.mm index 3838e2a..8edfe34 100644 --- a/ios/web/public/test/http_server/data_response_provider.mm +++ b/ios/web/public/test/http_server/data_response_provider.mm
@@ -7,6 +7,10 @@ #include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace web { std::unique_ptr<net::test_server::HttpResponse>
diff --git a/ios/web/public/test/http_server/delayed_response_provider.mm b/ios/web/public/test/http_server/delayed_response_provider.mm index bf7ba92..83f34bae 100644 --- a/ios/web/public/test/http_server/delayed_response_provider.mm +++ b/ios/web/public/test/http_server/delayed_response_provider.mm
@@ -7,13 +7,15 @@ #import <Foundation/Foundation.h> #include "base/bind.h" -#import "base/ios/weak_nsobject.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" #include "net/test/embedded_test_server/http_response.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace web { // Delays |delay| seconds before sending a response to the client.
diff --git a/ios/web/public/test/http_server/error_page_response_provider.mm b/ios/web/public/test/http_server/error_page_response_provider.mm index c2ad683..b9331322 100644 --- a/ios/web/public/test/http_server/error_page_response_provider.mm +++ b/ios/web/public/test/http_server/error_page_response_provider.mm
@@ -8,6 +8,10 @@ #import "ios/web/public/test/http_server/http_server.h" #include "net/http/http_status_code.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + // static GURL ErrorPageResponseProvider::GetDnsFailureUrl() { return GURL("http://mock/bad");
diff --git a/ios/web/public/test/http_server/html_response_provider.mm b/ios/web/public/test/http_server/html_response_provider.mm index 702f48fd..1a17c816 100644 --- a/ios/web/public/test/http_server/html_response_provider.mm +++ b/ios/web/public/test/http_server/html_response_provider.mm
@@ -7,6 +7,10 @@ #import "ios/web/public/test/http_server/response_provider.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + HtmlResponseProvider::HtmlResponseProvider() : response_provider_impl_(new HtmlResponseProviderImpl()) {}
diff --git a/ios/web/public/test/http_server/html_response_provider_impl.mm b/ios/web/public/test/http_server/html_response_provider_impl.mm index 2b26e20..d4413cb 100644 --- a/ios/web/public/test/http_server/html_response_provider_impl.mm +++ b/ios/web/public/test/http_server/html_response_provider_impl.mm
@@ -9,6 +9,10 @@ #include "net/http/http_status_code.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { std::map<GURL, HtmlResponseProviderImpl::Response> BuildResponseMap( const std::map<GURL, std::string>& responses_body,
diff --git a/ios/web/public/test/http_server/http_auth_response_provider.mm b/ios/web/public/test/http_server/http_auth_response_provider.mm index 6205c07..8e32d12 100644 --- a/ios/web/public/test/http_server/http_auth_response_provider.mm +++ b/ios/web/public/test/http_server/http_auth_response_provider.mm
@@ -9,6 +9,10 @@ #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace web { HttpAuthResponseProvider::HttpAuthResponseProvider(const GURL& url,
diff --git a/ios/web/public/test/http_server/http_server.h b/ios/web/public/test/http_server/http_server.h index e843e3ff..32c4be8 100644 --- a/ios/web/public/test/http_server/http_server.h +++ b/ios/web/public/test/http_server/http_server.h
@@ -8,7 +8,6 @@ #include <memory> #include <vector> -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h"
diff --git a/ios/web/public/test/http_server/http_server.mm b/ios/web/public/test/http_server/http_server.mm index 8e30abc..6fafe35 100644 --- a/ios/web/public/test/http_server/http_server.mm +++ b/ios/web/public/test/http_server/http_server.mm
@@ -20,6 +20,10 @@ #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { // Converts a net::test_server::HttpRequest (received from the
diff --git a/ios/web/public/test/http_server/http_server_util.mm b/ios/web/public/test/http_server/http_server_util.mm index 2e54d4c..af41f8726 100644 --- a/ios/web/public/test/http_server/http_server_util.mm +++ b/ios/web/public/test/http_server/http_server_util.mm
@@ -9,6 +9,10 @@ #import "ios/web/public/test/http_server/html_response_provider.h" #import "ios/web/public/test/http_server/http_server.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace web { namespace test {
diff --git a/ios/web/public/test/http_server/response_provider.mm b/ios/web/public/test/http_server/response_provider.mm index 0c69529..6759ec6 100644 --- a/ios/web/public/test/http_server/response_provider.mm +++ b/ios/web/public/test/http_server/response_provider.mm
@@ -7,6 +7,10 @@ #include "base/strings/stringprintf.h" #include "net/http/http_response_headers.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace web { ResponseProvider::Request::Request(const GURL& url,
diff --git a/ios/web/public/test/http_server/string_response_provider.mm b/ios/web/public/test/http_server/string_response_provider.mm index 2e694e2..1862fe11 100644 --- a/ios/web/public/test/http_server/string_response_provider.mm +++ b/ios/web/public/test/http_server/string_response_provider.mm
@@ -4,6 +4,10 @@ #import "ios/web/public/test/http_server/string_response_provider.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace web { StringResponseProvider::StringResponseProvider(const std::string& response_body)
diff --git a/media/ffmpeg/ffmpeg_common_unittest.cc b/media/ffmpeg/ffmpeg_common_unittest.cc index dafac57..1459c5cd 100644 --- a/media/ffmpeg/ffmpeg_common_unittest.cc +++ b/media/ffmpeg/ffmpeg_common_unittest.cc
@@ -28,7 +28,7 @@ FFmpegCommonTest() { FFmpegGlue::InitializeFFmpeg(); } - ~FFmpegCommonTest() override{}; + ~FFmpegCommonTest() override {} }; uint8_t kExtraData[5] = {0x00, 0x01, 0x02, 0x03, 0x04};
diff --git a/media/filters/vp9_uncompressed_header_parser.cc b/media/filters/vp9_uncompressed_header_parser.cc index 0353493a..315a84f 100644 --- a/media/filters/vp9_uncompressed_header_parser.cc +++ b/media/filters/vp9_uncompressed_header_parser.cc
@@ -789,7 +789,7 @@ for (size_t i = 0; i < Vp9LoopFilterParams::kNumModeDeltas; i++) { loop_filter.update_mode_deltas[i] = reader_.ReadBool(); if (loop_filter.update_mode_deltas[i]) - loop_filter.mode_deltas[i] = reader_.ReadLiteral(6); + loop_filter.mode_deltas[i] = reader_.ReadSignedLiteral(6); } } }
diff --git a/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc b/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc index 67fd1fd..9a719159 100644 --- a/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc +++ b/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc
@@ -45,7 +45,7 @@ class GpuJpegDecodeAcceleratorTest : public ::testing::Test { public: GpuJpegDecodeAcceleratorTest() : io_thread_("io") {} - ~GpuJpegDecodeAcceleratorTest() override{}; + ~GpuJpegDecodeAcceleratorTest() override {} void SetUp() override { output_frame_memory_.CreateAndMapAnonymous(kOutputFrameSizeInBytes);
diff --git a/media/gpu/rendering_helper.cc b/media/gpu/rendering_helper.cc index 1031ed43..e6696ed 100644 --- a/media/gpu/rendering_helper.cc +++ b/media/gpu/rendering_helper.cc
@@ -131,7 +131,7 @@ void OnWindowStateChanged(ui::PlatformWindowState new_state) override {} - void OnLostCapture() override{}; + void OnLostCapture() override {} void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, float device_pixel_ratio) override { @@ -140,7 +140,7 @@ void OnAcceleratedWidgetDestroyed() override { NOTREACHED(); } - void OnActivationChanged(bool active) override{}; + void OnActivationChanged(bool active) override {} gfx::AcceleratedWidget accelerated_widget() const { return accelerated_widget_;
diff --git a/net/dns/mdns_client_impl.h b/net/dns/mdns_client_impl.h index f86de96..bd35e7c 100644 --- a/net/dns/mdns_client_impl.h +++ b/net/dns/mdns_client_impl.h
@@ -37,7 +37,7 @@ class MDnsSocketFactoryImpl : public MDnsSocketFactory { public: MDnsSocketFactoryImpl() {} - ~MDnsSocketFactoryImpl() override{}; + ~MDnsSocketFactoryImpl() override {} void CreateSockets( std::vector<std::unique_ptr<DatagramServerSocket>>* sockets) override;
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index ab10bcfb..9ac4300e 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -57,7 +57,8 @@ context.net_log, context.client_socket_factory ? context.client_socket_factory : ClientSocketFactory::GetDefaultFactory(), - context.socket_performance_watcher_factory, context.host_resolver, + context.socket_performance_watcher_factory, + context.network_quality_provider, context.host_resolver, context.cert_verifier, context.channel_id_service, context.transport_security_state, context.cert_transparency_verifier, context.ct_policy_enforcer, ssl_session_cache_shard, @@ -148,6 +149,7 @@ http_auth_handler_factory(nullptr), net_log(nullptr), socket_performance_watcher_factory(nullptr), + network_quality_provider(nullptr), quic_clock(nullptr), quic_random(nullptr), quic_crypto_client_stream_factory( @@ -354,6 +356,8 @@ dict->SetBoolean("do_not_fragment", params_.quic_do_not_fragment); dict->SetBoolean("estimate_initial_rtt", params_.quic_estimate_initial_rtt); dict->SetBoolean("force_hol_blocking", params_.quic_force_hol_blocking); + dict->SetBoolean("server_push_cancellation", + params_.enable_server_push_cancellation); return std::move(dict); }
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 1225535..1b118c9 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -55,6 +55,7 @@ class HttpResponseBodyDrainer; class HttpServerProperties; class NetLog; +class NetworkQualityProvider; class NetworkThrottleManager; class ProxyDelegate; class ProxyService; @@ -188,6 +189,7 @@ HttpServerProperties* http_server_properties; NetLog* net_log; SocketPerformanceWatcherFactory* socket_performance_watcher_factory; + NetworkQualityProvider* network_quality_provider; // Source of time for QUIC connections. QuicClock* quic_clock;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index b5eff6c9..0056e9f 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -733,8 +733,7 @@ CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool( HostResolver* /* host_resolver */, CertVerifier* /* cert_verifier */) - : HttpProxyClientSocketPool(0, 0, NULL, NULL, NULL) { -} + : HttpProxyClientSocketPool(0, 0, NULL, NULL, NULL, NULL) {} template <> CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc index b267302..54b2a1b 100644 --- a/net/http/http_proxy_client_socket_pool.cc +++ b/net/http/http_proxy_client_socket_pool.cc
@@ -33,6 +33,20 @@ namespace net { +namespace { + +// HttpProxyConnectJobs will time out after this many seconds. Note this is on +// top of the timeout for the transport socket. +// TODO(kundaji): Proxy connect timeout should be independent of platform and be +// based on proxy. Bug http://crbug.com/407446. +#if defined(OS_ANDROID) || defined(OS_IOS) +static const int kHttpProxyConnectJobTimeoutInSeconds = 10; +#else +static const int kHttpProxyConnectJobTimeoutInSeconds = 30; +#endif + +} // namespace + HttpProxySocketParams::HttpProxySocketParams( const scoped_refptr<TransportSocketParams>& transport_params, const scoped_refptr<SSLSocketParams>& ssl_params, @@ -66,16 +80,6 @@ HttpProxySocketParams::~HttpProxySocketParams() {} -// HttpProxyConnectJobs will time out after this many seconds. Note this is on -// top of the timeout for the transport socket. -// TODO(kundaji): Proxy connect timeout should be independent of platform and be -// based on proxy. Bug http://crbug.com/407446. -#if defined(OS_ANDROID) || defined(OS_IOS) -static const int kHttpProxyConnectJobTimeoutInSeconds = 10; -#else -static const int kHttpProxyConnectJobTimeoutInSeconds = 30; -#endif - HttpProxyConnectJob::HttpProxyConnectJob( const std::string& group_name, RequestPriority priority, @@ -150,29 +154,15 @@ return result; } -HttpProxyClientSocketPool:: -HttpProxyConnectJobFactory::HttpProxyConnectJobFactory( - TransportClientSocketPool* transport_pool, - SSLClientSocketPool* ssl_pool, - NetLog* net_log) +HttpProxyClientSocketPool::HttpProxyConnectJobFactory:: + HttpProxyConnectJobFactory(TransportClientSocketPool* transport_pool, + SSLClientSocketPool* ssl_pool, + NetworkQualityProvider* network_quality_provider, + NetLog* net_log) : transport_pool_(transport_pool), ssl_pool_(ssl_pool), - net_log_(net_log) { - base::TimeDelta max_pool_timeout = base::TimeDelta(); - -// TODO(kundaji): Proxy connect timeout should be independent of platform and be -// based on proxy. Bug http://crbug.com/407446. -#if (defined(OS_ANDROID) || defined(OS_IOS)) -#else - if (transport_pool_) - max_pool_timeout = transport_pool_->ConnectionTimeout(); - if (ssl_pool_) - max_pool_timeout = std::max(max_pool_timeout, - ssl_pool_->ConnectionTimeout()); -#endif - timeout_ = max_pool_timeout + - base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds); -} + network_quality_provider_(network_quality_provider), + net_log_(net_log) {} std::unique_ptr<ConnectJob> HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob( @@ -188,7 +178,23 @@ base::TimeDelta HttpProxyClientSocketPool::HttpProxyConnectJobFactory::ConnectionTimeout( ) const { - return timeout_; + // TODO(tbansal): https://crbug.com/704339. Use |network_quality_provider_| + // and field trial to determine the connection timeout. + ALLOW_UNUSED_LOCAL(network_quality_provider_); + + // Return the default proxy connection timeout. + base::TimeDelta max_pool_timeout = base::TimeDelta(); +#if (!defined(OS_ANDROID) && !defined(OS_IOS)) + if (transport_pool_) + max_pool_timeout = transport_pool_->ConnectionTimeout(); + if (ssl_pool_) { + max_pool_timeout = + std::max(max_pool_timeout, ssl_pool_->ConnectionTimeout()); + } +#endif // !defined(OS_ANDROID) && !defined(OS_IOS) + + return max_pool_timeout + + base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds); } HttpProxyClientSocketPool::HttpProxyClientSocketPool( @@ -196,6 +202,7 @@ int max_sockets_per_group, TransportClientSocketPool* transport_pool, SSLClientSocketPool* ssl_pool, + NetworkQualityProvider* network_quality_provider, NetLog* net_log) : transport_pool_(transport_pool), ssl_pool_(ssl_pool), @@ -204,7 +211,10 @@ max_sockets_per_group, ClientSocketPool::unused_idle_socket_timeout(), ClientSocketPool::used_idle_socket_timeout(), - new HttpProxyConnectJobFactory(transport_pool, ssl_pool, net_log)) { + new HttpProxyConnectJobFactory(transport_pool, + ssl_pool, + network_quality_provider, + net_log)) { // We should always have a |transport_pool_| except in unit tests. if (transport_pool_) base_.AddLowerLayeredPool(transport_pool_);
diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h index 8bea469..bf6dede8 100644 --- a/net/http/http_proxy_client_socket_pool.h +++ b/net/http/http_proxy_client_socket_pool.h
@@ -28,6 +28,7 @@ class HttpAuthHandlerFactory; class HttpProxyClientSocketWrapper; class NetLog; +class NetworkQualityProvider; class ProxyDelegate; class SSLClientSocketPool; class SSLSocketParams; @@ -143,6 +144,7 @@ int max_sockets_per_group, TransportClientSocketPool* transport_pool, SSLClientSocketPool* ssl_pool, + NetworkQualityProvider* network_quality_provider, NetLog* net_log); ~HttpProxyClientSocketPool() override; @@ -209,6 +211,7 @@ public: HttpProxyConnectJobFactory(TransportClientSocketPool* transport_pool, SSLClientSocketPool* ssl_pool, + NetworkQualityProvider* network_quality_provider, NetLog* net_log); // ClientSocketPoolBase::ConnectJobFactory methods. @@ -222,8 +225,8 @@ private: TransportClientSocketPool* const transport_pool_; SSLClientSocketPool* const ssl_pool_; + NetworkQualityProvider* network_quality_provider_; NetLog* net_log_; - base::TimeDelta timeout_; DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory); };
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index 651d171..e05b203 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -19,6 +19,7 @@ #include "net/http/http_proxy_client_socket.h" #include "net/http/http_response_headers.h" #include "net/log/net_log_with_source.h" +#include "net/nqe/network_quality_estimator_test_util.h" #include "net/socket/client_socket_handle.h" #include "net/socket/next_proto.h" #include "net/socket/socket_test_util.h" @@ -78,6 +79,7 @@ kMaxSocketsPerGroup, &transport_socket_pool_, &ssl_socket_pool_, + &estimator_, NULL) { session_ = CreateNetworkSession(); } @@ -197,6 +199,8 @@ private: SpdySessionDependencies session_deps_; + TestNetworkQualityEstimator estimator_; + MockTransportClientSocketPool transport_socket_pool_; MockHostResolver host_resolver_; std::unique_ptr<CertVerifier> cert_verifier_; @@ -722,6 +726,18 @@ } } +TEST_P(HttpProxyClientSocketPoolTest, ProxyPoolTimeout) { + ASSERT_LE(base::TimeDelta(), pool_.ConnectionTimeout()); + + // Test against a large value. + ASSERT_GE(base::TimeDelta::FromMinutes(10), pool_.ConnectionTimeout()); + +#if (defined(OS_ANDROID) || defined(OS_IOS)) + // On Android and iOS, the timeout is fixed to 10 seconds. + ASSERT_EQ(base::TimeDelta::FromSeconds(10), pool_.ConnectionTimeout()); +#endif +} + // It would be nice to also test the timeouts in HttpProxyClientSocketPool. } // namespace net
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc index 90186ff..e9a20f6 100644 --- a/net/http/http_stream_factory_impl_unittest.cc +++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -454,7 +454,7 @@ TransportSecurityState*, CTVerifier*, CTPolicyEnforcer*) - : HttpProxyClientSocketPool(0, 0, nullptr, nullptr, nullptr), + : HttpProxyClientSocketPool(0, 0, nullptr, nullptr, nullptr, nullptr), last_num_streams_(-1) {} template <>
diff --git a/net/log/file_net_log_observer.cc b/net/log/file_net_log_observer.cc index 721ae87..0c05f9e1 100644 --- a/net/log/file_net_log_observer.cc +++ b/net/log/file_net_log_observer.cc
@@ -265,10 +265,10 @@ FileNetLogObserver::~FileNetLogObserver() { if (net_log()) { // StopObserving was not called. + net_log()->DeprecatedRemoveObserver(this); file_task_runner_->PostTask( FROM_HERE, base::Bind(&FileNetLogObserver::FileWriter::DeleteAllFiles, base::Unretained(file_writer_))); - net_log()->DeprecatedRemoveObserver(this); } file_task_runner_->DeleteSoon(FROM_HERE, file_writer_); } @@ -280,13 +280,13 @@ void FileNetLogObserver::StopObserving(std::unique_ptr<base::Value> polled_data, const base::Closure& callback) { + net_log()->DeprecatedRemoveObserver(this); + file_task_runner_->PostTaskAndReply( FROM_HERE, base::Bind(&FileNetLogObserver::FileWriter::FlushThenStop, base::Unretained(file_writer_), write_queue_, base::Passed(&polled_data)), callback); - - net_log()->DeprecatedRemoveObserver(this); } void FileNetLogObserver::OnAddEntry(const NetLogEntry& entry) { @@ -437,6 +437,7 @@ write_queue->SwapQueue(&local_file_queue); std::string to_print; + CHECK(!event_files_.empty()); size_t file_size = ftell(event_files_[current_file_idx_].get()); size_t memory_freed = 0;
diff --git a/net/log/file_net_log_observer_unittest.cc b/net/log/file_net_log_observer_unittest.cc index 7ee076f..0cbf7d1 100644 --- a/net/log/file_net_log_observer_unittest.cc +++ b/net/log/file_net_log_observer_unittest.cc
@@ -792,6 +792,75 @@ } } +void AddEntriesViaNetLog(NetLog* net_log, int num_entries) { + for (int i = 0; i < num_entries; i++) { + net_log->AddGlobalEntry(NetLogEventType::PAC_JAVASCRIPT_ERROR); + } +} + +TEST_P(FileNetLogObserverTest, AddEventsFromMultipleThreadsWithStopObserving) { + const size_t kNumThreads = 10; + std::vector<std::unique_ptr<base::Thread>> threads(kNumThreads); + // Start all the threads. Waiting for them to start is to hopefuly improve + // the odds of hitting interesting races once events start being added. + for (size_t i = 0; i < threads.size(); ++i) { + threads[i] = base::MakeUnique<base::Thread>( + base::StringPrintf("WorkerThread%i", static_cast<int>(i))); + threads[i]->Start(); + threads[i]->WaitUntilThreadStarted(); + } + + CreateAndStartObserving(nullptr); + + const size_t kNumEventsAddedPerThread = 200; + + // Add events in parallel from all the threads. + for (size_t i = 0; i < kNumThreads; ++i) { + threads[i]->task_runner()->PostTask( + FROM_HERE, base::Bind(&AddEntriesViaNetLog, base::Unretained(&net_log_), + kNumEventsAddedPerThread)); + } + + // Stop observing. + TestClosure closure; + logger_->StopObserving(nullptr, closure.closure()); + closure.WaitForResult(); + + // Join all the threads. + threads.clear(); +} + +TEST_P(FileNetLogObserverTest, + AddEventsFromMultipleThreadsWithoutStopObserving) { + const size_t kNumThreads = 10; + std::vector<std::unique_ptr<base::Thread>> threads(kNumThreads); + // Start all the threads. Waiting for them to start is to hopefuly improve + // the odds of hitting interesting races once events start being added. + for (size_t i = 0; i < threads.size(); ++i) { + threads[i] = base::MakeUnique<base::Thread>( + base::StringPrintf("WorkerThread%i", static_cast<int>(i))); + threads[i]->Start(); + threads[i]->WaitUntilThreadStarted(); + } + + CreateAndStartObserving(nullptr); + + const size_t kNumEventsAddedPerThread = 200; + + // Add events in parallel from all the threads. + for (size_t i = 0; i < kNumThreads; ++i) { + threads[i]->task_runner()->PostTask( + FROM_HERE, base::Bind(&AddEntriesViaNetLog, base::Unretained(&net_log_), + kNumEventsAddedPerThread)); + } + + // Destroy logger. + logger_.reset(); + + // Join all the threads. + threads.clear(); +} + } // namespace } // namespace net
diff --git a/net/quic/core/crypto/crypto_protocol.h b/net/quic/core/crypto/crypto_protocol.h index d073226..d31ef0f1 100644 --- a/net/quic/core/crypto/crypto_protocol.h +++ b/net/quic/core/crypto/crypto_protocol.h
@@ -35,7 +35,8 @@ const QuicTag kCETV = TAG('C', 'E', 'T', 'V'); // Client encrypted tag-value // pairs const QuicTag kPRST = TAG('P', 'R', 'S', 'T'); // Public reset -const QuicTag kSCUP = TAG('S', 'C', 'U', 'P'); // Server config update. +const QuicTag kSCUP = TAG('S', 'C', 'U', 'P'); // Server config update +const QuicTag kALPN = TAG('A', 'L', 'P', 'N'); // Application-layer protocol // Key exchange methods const QuicTag kP256 = TAG('P', '2', '5', '6'); // ECDH, Curve P-256
diff --git a/net/quic/core/crypto/quic_crypto_client_config.cc b/net/quic/core/crypto/quic_crypto_client_config.cc index fcd630ac..460a618 100644 --- a/net/quic/core/crypto/quic_crypto_client_config.cc +++ b/net/quic/core/crypto/quic_crypto_client_config.cc
@@ -443,6 +443,10 @@ out->SetStringPiece(kUAID, user_agent_id_); } + if (!alpn_.empty()) { + out->SetStringPiece(kALPN, alpn_); + } + // Even though this is an inchoate CHLO, send the SCID so that // the STK can be validated by the server. const CryptoHandshakeMessage* scfg = cached->GetServerConfig(); @@ -541,10 +545,8 @@ // Key exchange: the client does more work than the server, so favor the // client's preference. size_t key_exchange_index; - if (!FindMutualQuicTag(aead, their_aeads.data(), their_aeads.size(), - &out_params->aead, nullptr) || - !FindMutualQuicTag(kexs, their_key_exchanges.data(), - their_key_exchanges.size(), &out_params->key_exchange, + if (!FindMutualQuicTag(aead, their_aeads, &out_params->aead, nullptr) || + !FindMutualQuicTag(kexs, their_key_exchanges, &out_params->key_exchange, &key_exchange_index)) { *error_details = "Unsupported AEAD or KEXS"; return QUIC_CRYPTO_NO_SUPPORT; @@ -559,8 +561,7 @@ case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND: break; case QUIC_NO_ERROR: - if (FindMutualQuicTag(tb_key_params, their_tbkps.data(), - their_tbkps.size(), + if (FindMutualQuicTag(tb_key_params, their_tbkps, &out_params->token_binding_key_param, nullptr)) { out->SetVector(kTBKP, QuicTagVector{out_params->token_binding_key_param});
diff --git a/net/quic/core/crypto/quic_crypto_client_config.h b/net/quic/core/crypto/quic_crypto_client_config.h index 682259d..160d1870 100644 --- a/net/quic/core/crypto/quic_crypto_client_config.h +++ b/net/quic/core/crypto/quic_crypto_client_config.h
@@ -343,6 +343,9 @@ user_agent_id_ = user_agent_id; } + // Saves the |alpn| that will be passed in QUIC's CHLO message. + void set_alpn(const std::string& alpn) { alpn_ = alpn; } + private: // Sets the members to reasonable, default values. void SetDefaults(); @@ -387,6 +390,9 @@ // The |user_agent_id_| passed in QUIC's CHLO message. std::string user_agent_id_; + // The |alpn_| passed in QUIC's CHLO message. + std::string alpn_; + DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); };
diff --git a/net/quic/core/crypto/quic_crypto_client_config_test.cc b/net/quic/core/crypto/quic_crypto_client_config_test.cc index 54bc6e1..7ab73aa 100644 --- a/net/quic/core/crypto/quic_crypto_client_config_test.cc +++ b/net/quic/core/crypto/quic_crypto_client_config_test.cc
@@ -30,7 +30,8 @@ class OneServerIdFilter : public QuicCryptoClientConfig::ServerIdFilter { public: - OneServerIdFilter(const QuicServerId* server_id) : server_id_(*server_id) {} + explicit OneServerIdFilter(const QuicServerId* server_id) + : server_id_(*server_id) {} bool Matches(const QuicServerId& server_id) const override { return server_id == server_id_; @@ -173,6 +174,8 @@ TEST_F(QuicCryptoClientConfigTest, InchoateChlo) { QuicCryptoClientConfig::CachedState state; QuicCryptoClientConfig config(crypto_test_utils::ProofVerifierForTesting()); + config.set_user_agent_id("quic-tester"); + config.set_alpn("hq"); QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params( new QuicCryptoNegotiatedParameters); CryptoHandshakeMessage msg; @@ -187,6 +190,12 @@ QuicStringPiece proof_nonce; EXPECT_TRUE(msg.GetStringPiece(kNONP, &proof_nonce)); EXPECT_EQ(string(32, 'r'), proof_nonce); + QuicStringPiece user_agent_id; + EXPECT_TRUE(msg.GetStringPiece(kUAID, &user_agent_id)); + EXPECT_EQ("quic-tester", user_agent_id); + QuicStringPiece alpn; + EXPECT_TRUE(msg.GetStringPiece(kALPN, &alpn)); + EXPECT_EQ("hq", alpn); } TEST_F(QuicCryptoClientConfigTest, PreferAesGcm) {
diff --git a/net/quic/core/crypto/quic_crypto_server_config.cc b/net/quic/core/crypto/quic_crypto_server_config.cc index 072085ea..02446b6 100644 --- a/net/quic/core/crypto/quic_crypto_server_config.cc +++ b/net/quic/core/crypto/quic_crypto_server_config.cc
@@ -797,11 +797,10 @@ } size_t key_exchange_index; - if (!FindMutualQuicTag(requested_config->aead, their_aeads.data(), - their_aeads.size(), ¶ms->aead, nullptr) || - !FindMutualQuicTag(requested_config->kexs, their_key_exchanges.data(), - their_key_exchanges.size(), ¶ms->key_exchange, - &key_exchange_index)) { + if (!FindMutualQuicTag(requested_config->aead, their_aeads, ¶ms->aead, + nullptr) || + !FindMutualQuicTag(requested_config->kexs, their_key_exchanges, + ¶ms->key_exchange, &key_exchange_index)) { helper.Fail(QUIC_CRYPTO_NO_SUPPORT, "Unsupported AEAD or KEXS"); return; } @@ -812,8 +811,7 @@ case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND: break; case QUIC_NO_ERROR: - if (FindMutualQuicTag(requested_config->tb_key_params, - their_tbkps.data(), their_tbkps.size(), + if (FindMutualQuicTag(requested_config->tb_key_params, their_tbkps, ¶ms->token_binding_key_param, nullptr)) { break; }
diff --git a/net/quic/core/quic_buffered_packet_store.cc b/net/quic/core/quic_buffered_packet_store.cc index c2b4a4e..0ed8087 100644 --- a/net/quic/core/quic_buffered_packet_store.cc +++ b/net/quic/core/quic_buffered_packet_store.cc
@@ -80,11 +80,14 @@ const QuicReceivedPacket& packet, QuicSocketAddress server_address, QuicSocketAddress client_address, - bool is_chlo) { + bool is_chlo, + const std::string& alpn) { QUIC_BUG_IF(!FLAGS_quic_allow_chlo_buffering) << "Shouldn't buffer packets if disabled via flag."; QUIC_BUG_IF(is_chlo && QuicContainsKey(connections_with_chlo_, connection_id)) << "Shouldn't buffer duplicated CHLO on connection " << connection_id; + QUIC_BUG_IF(!is_chlo && !alpn.empty()) + << "Shouldn't have an ALPN defined for a non-CHLO packet."; if (!QuicContainsKey(undecryptable_packets_, connection_id) && ShouldBufferPacket(is_chlo)) { @@ -125,6 +128,7 @@ // Add CHLO to the beginning of buffered packets so that it can be delivered // first later. queue.buffered_packets.push_front(std::move(new_entry)); + queue.alpn = alpn; connections_with_chlo_[connection_id] = false; // Dummy value. } else { // Buffer non-CHLO packets in arrival order. @@ -143,12 +147,12 @@ return !connections_with_chlo_.empty(); } -std::list<BufferedPacket> QuicBufferedPacketStore::DeliverPackets( +BufferedPacketList QuicBufferedPacketStore::DeliverPackets( QuicConnectionId connection_id) { - std::list<BufferedPacket> packets_to_deliver; + BufferedPacketList packets_to_deliver; auto it = undecryptable_packets_.find(connection_id); if (it != undecryptable_packets_.end()) { - packets_to_deliver = std::move(it->second.buffered_packets); + packets_to_deliver = std::move(it->second); undecryptable_packets_.erase(connection_id); } return packets_to_deliver; @@ -199,18 +203,18 @@ return is_store_full || reach_non_chlo_limit; } -std::list<BufferedPacket> -QuicBufferedPacketStore::DeliverPacketsForNextConnection( +BufferedPacketList QuicBufferedPacketStore::DeliverPacketsForNextConnection( QuicConnectionId* connection_id) { if (connections_with_chlo_.empty()) { // Returns empty list if no CHLO has been buffered. - return std::list<BufferedPacket>(); + return BufferedPacketList(); } *connection_id = connections_with_chlo_.front().first; connections_with_chlo_.pop_front(); - std::list<BufferedPacket> packets = DeliverPackets(*connection_id); - DCHECK(!packets.empty()) << "Try to deliver connectons without CHLO"; + BufferedPacketList packets = DeliverPackets(*connection_id); + DCHECK(!packets.buffered_packets.empty()) + << "Try to deliver connectons without CHLO"; return packets; }
diff --git a/net/quic/core/quic_buffered_packet_store.h b/net/quic/core/quic_buffered_packet_store.h index 8c4e42d3..f8254f73 100644 --- a/net/quic/core/quic_buffered_packet_store.h +++ b/net/quic/core/quic_buffered_packet_store.h
@@ -66,6 +66,8 @@ std::list<BufferedPacket> buffered_packets; QuicTime creation_time; + // The alpn from the CHLO, if one was found. + std::string alpn; }; typedef QuicLinkedHashMap<QuicConnectionId, BufferedPacketList> @@ -95,7 +97,8 @@ const QuicReceivedPacket& packet, QuicSocketAddress server_address, QuicSocketAddress client_address, - bool is_chlo); + bool is_chlo, + const std::string& alpn); // Returns true if there are any packets buffered for |connection_id|. bool HasBufferedPackets(QuicConnectionId connection_id) const; @@ -103,7 +106,7 @@ // Returns the list of buffered packets for |connection_id| and removes them // from the store. Returns an empty list if no early arrived packets for this // connection are present. - std::list<BufferedPacket> DeliverPackets(QuicConnectionId connection_id); + BufferedPacketList DeliverPackets(QuicConnectionId connection_id); // Discards packets buffered for |connection_id|, if any. void DiscardPackets(QuicConnectionId connection_id); @@ -120,7 +123,7 @@ // The returned list should at least has one packet(CHLO) if // store does have any connection to open. If no connection in the store has // received CHLO yet, empty list will be returned. - std::list<BufferedPacket> DeliverPacketsForNextConnection( + BufferedPacketList DeliverPacketsForNextConnection( QuicConnectionId* connection_id); // Is given connection already buffered in the store?
diff --git a/net/quic/core/quic_buffered_packet_store_test.cc b/net/quic/core/quic_buffered_packet_store_test.cc index 6ab09c57..935d7ac2 100644 --- a/net/quic/core/quic_buffered_packet_store_test.cc +++ b/net/quic/core/quic_buffered_packet_store_test.cc
@@ -71,17 +71,20 @@ TEST_F(QuicBufferedPacketStoreTest, SimpleEnqueueAndDeliverPacket) { QuicConnectionId connection_id = 1; store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); - std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id); + auto packets = store_.DeliverPackets(connection_id); + const std::list<BufferedPacket>& queue = packets.buffered_packets; ASSERT_EQ(1u, queue.size()); + // The alpn should be ignored for non-chlo packets. + ASSERT_EQ("", packets.alpn); // Check content of the only packet in the queue. EXPECT_EQ(packet_content_, queue.front().packet->AsStringPiece()); EXPECT_EQ(packet_time_, queue.front().packet->receipt_time()); EXPECT_EQ(client_address_, queue.front().client_address); EXPECT_EQ(server_address_, queue.front().server_address); // No more packets on connection 1 should remain in the store. - EXPECT_TRUE(store_.DeliverPackets(connection_id).empty()); + EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); } @@ -89,10 +92,11 @@ QuicSocketAddress addr_with_new_port(QuicIpAddress::Any4(), 256); QuicConnectionId connection_id = 1; store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); store_.EnqueuePacket(connection_id, packet_, server_address_, - addr_with_new_port, false); - std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id); + addr_with_new_port, false, ""); + std::list<BufferedPacket> queue = + store_.DeliverPackets(connection_id).buffered_packets; ASSERT_EQ(2u, queue.size()); // The address migration path should be preserved. EXPECT_EQ(client_address_, queue.front().client_address); @@ -105,15 +109,16 @@ for (QuicConnectionId connection_id = 1; connection_id <= num_connections; ++connection_id) { store_.EnqueuePacket(connection_id, packet_, server_address_, - client_address_, false); + client_address_, false, ""); store_.EnqueuePacket(connection_id, packet_, server_address_, - client_address_, false); + client_address_, false, ""); } // Deliver packets in reversed order. for (QuicConnectionId connection_id = num_connections; connection_id > 0; --connection_id) { - std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id); + std::list<BufferedPacket> queue = + store_.DeliverPackets(connection_id).buffered_packets; ASSERT_EQ(2u, queue.size()); } } @@ -129,12 +134,12 @@ // keep. EXPECT_EQ(QuicBufferedPacketStore::SUCCESS, store_.EnqueuePacket(connection_id, packet_, server_address_, - client_address_, true)); + client_address_, true, "")); } for (size_t i = 1; i <= num_packets; ++i) { // Only first |kDefaultMaxUndecryptablePackets packets| will be buffered. EnqueuePacketResult result = store_.EnqueuePacket( - connection_id, packet_, server_address_, client_address_, false); + connection_id, packet_, server_address_, client_address_, false, ""); if (i <= kDefaultMaxUndecryptablePackets) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { @@ -149,7 +154,7 @@ (FLAGS_quic_reloadable_flag_quic_limit_num_new_sessions_per_epoll_loop ? 1 : 0), - store_.DeliverPackets(connection_id).size()); + store_.DeliverPackets(connection_id).buffered_packets.size()); } TEST_F(QuicBufferedPacketStoreTest, ReachNonChloConnectionUpperLimit) { @@ -163,7 +168,7 @@ for (size_t connection_id = 1; connection_id <= kNumConnections; ++connection_id) { EnqueuePacketResult result = store_.EnqueuePacket( - connection_id, packet_, server_address_, client_address_, false); + connection_id, packet_, server_address_, client_address_, false, ""); if (connection_id <= (FLAGS_quic_reloadable_flag_quic_limit_num_new_sessions_per_epoll_loop ? kMaxConnectionsWithoutCHLO @@ -176,7 +181,8 @@ // Store only keeps early arrived packets upto |kNumConnections| connections. for (size_t connection_id = 1; connection_id <= kNumConnections; ++connection_id) { - std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id); + std::list<BufferedPacket> queue = + store_.DeliverPackets(connection_id).buffered_packets; if (connection_id <= (FLAGS_quic_reloadable_flag_quic_limit_num_new_sessions_per_epoll_loop ? kMaxConnectionsWithoutCHLO @@ -198,7 +204,7 @@ for (size_t connection_id = 1; connection_id <= num_chlos; ++connection_id) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(connection_id, packet_, server_address_, - client_address_, true)); + client_address_, true, "")); } // Send data packets on another |kMaxConnectionsWithoutCHLO| connections. @@ -206,7 +212,7 @@ for (size_t conn_id = num_chlos + 1; conn_id <= (kDefaultMaxConnectionsInStore + 1); ++conn_id) { EnqueuePacketResult result = store_.EnqueuePacket( - conn_id, packet_, server_address_, client_address_, true); + conn_id, packet_, server_address_, client_address_, true, ""); if (conn_id <= kDefaultMaxConnectionsInStore) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { @@ -222,14 +228,15 @@ ++conn_id) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(conn_id, packet_, server_address_, - client_address_, false)); + client_address_, false, "")); } // Buffer CHLOs on other connections till store is full. for (size_t i = kMaxConnectionsWithoutCHLO + 1; i <= kDefaultMaxConnectionsInStore + 1; ++i) { EnqueuePacketResult rs = store_.EnqueuePacket( - /*connection_id=*/i, packet_, server_address_, client_address_, true); + /*connection_id=*/i, packet_, server_address_, client_address_, true, + ""); if (i <= kDefaultMaxConnectionsInStore) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, rs); EXPECT_TRUE(store_.HasChloForConnection(/*connection_id=*/i)); @@ -245,7 +252,7 @@ // delivered at last. EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(/*connection_id=*/1, packet_, server_address_, - client_address_, true)); + client_address_, true, "")); EXPECT_TRUE(store_.HasChloForConnection(/*connection_id=*/1)); QuicConnectionId delivered_conn_id; @@ -254,14 +261,12 @@ ++i) { if (i < kDefaultMaxConnectionsInStore - kMaxConnectionsWithoutCHLO) { // Only CHLO is buffered. - EXPECT_EQ( - 1u, - store_.DeliverPacketsForNextConnection(&delivered_conn_id).size()); + EXPECT_EQ(1u, store_.DeliverPacketsForNextConnection(&delivered_conn_id) + .buffered_packets.size()); EXPECT_EQ(i + kMaxConnectionsWithoutCHLO + 1, delivered_conn_id); } else { - EXPECT_EQ( - 2u, - store_.DeliverPacketsForNextConnection(&delivered_conn_id).size()); + EXPECT_EQ(2u, store_.DeliverPacketsForNextConnection(&delivered_conn_id) + .buffered_packets.size()); EXPECT_EQ(1u, delivered_conn_id); } } @@ -272,7 +277,7 @@ FLAGS_quic_reloadable_flag_quic_limit_num_new_sessions_per_epoll_loop = false; QuicConnectionId connection_id = 1; store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); // Packet for another connection arrive 1ms later. clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); QuicConnectionId connection_id2 = 2; @@ -280,7 +285,7 @@ // connections. QuicSocketAddress another_client_address(QuicIpAddress::Any4(), 255); store_.EnqueuePacket(connection_id2, packet_, server_address_, - another_client_address, false); + another_client_address, false, ""); // Advance clock to the time when connection 1 expires. clock_.AdvanceTime( QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() - @@ -293,11 +298,12 @@ EXPECT_EQ(1u, visitor_.last_expired_packet_queue_.buffered_packets.size()); // Try to deliver packets, but packet queue has been removed so no // packets can be returned. - ASSERT_EQ(0u, store_.DeliverPackets(connection_id).size()); + ASSERT_EQ(0u, store_.DeliverPackets(connection_id).buffered_packets.size()); // Deliver packets on connection 2. And the queue for connection 2 should be // returned. - std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id2); + std::list<BufferedPacket> queue = + store_.DeliverPackets(connection_id2).buffered_packets; ASSERT_EQ(1u, queue.size()); // Packets in connection 2 should use another client address. EXPECT_EQ(another_client_address, queue.front().client_address); @@ -306,9 +312,9 @@ // for them to expire. QuicConnectionId connection_id3 = 3; store_.EnqueuePacket(connection_id3, packet_, server_address_, - client_address_, false); + client_address_, false, ""); store_.EnqueuePacket(connection_id3, packet_, server_address_, - client_address_, false); + client_address_, false, ""); clock_.AdvanceTime( QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() - clock_.ApproximateNow()); @@ -324,16 +330,16 @@ FLAGS_quic_reloadable_flag_quic_limit_num_new_sessions_per_epoll_loop = true; QuicConnectionId connection_id = 1; store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); if (FLAGS_quic_reloadable_flag_quic_limit_num_new_sessions_per_epoll_loop) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(connection_id, packet_, server_address_, - client_address_, true)); + client_address_, true, "")); } QuicConnectionId connection_id2 = 2; EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(connection_id2, packet_, server_address_, - client_address_, false)); + client_address_, false, "")); // CHLO on connection 3 arrives 1ms later. clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); @@ -342,7 +348,7 @@ // connections. QuicSocketAddress another_client_address(QuicIpAddress::Any4(), 255); store_.EnqueuePacket(connection_id3, packet_, server_address_, - another_client_address, true); + another_client_address, true, ""); // Advance clock to the time when connection 1 and 2 expires. clock_.AdvanceTime( @@ -359,10 +365,11 @@ // Try to deliver packets, but packet queue has been removed so no // packets can be returned. - ASSERT_EQ(0u, store_.DeliverPackets(connection_id).size()); - ASSERT_EQ(0u, store_.DeliverPackets(connection_id2).size()); + ASSERT_EQ(0u, store_.DeliverPackets(connection_id).buffered_packets.size()); + ASSERT_EQ(0u, store_.DeliverPackets(connection_id2).buffered_packets.size()); QuicConnectionId delivered_conn_id; - auto queue = store_.DeliverPacketsForNextConnection(&delivered_conn_id); + auto queue = store_.DeliverPacketsForNextConnection(&delivered_conn_id) + .buffered_packets; // Connection 3 is the next to be delivered as connection 1 already expired. EXPECT_EQ(connection_id3, delivered_conn_id); ASSERT_EQ(1u, queue.size()); @@ -373,9 +380,9 @@ // for them to expire. QuicConnectionId connection_id4 = 4; store_.EnqueuePacket(connection_id4, packet_, server_address_, - client_address_, false); + client_address_, false, ""); store_.EnqueuePacket(connection_id4, packet_, server_address_, - client_address_, false); + client_address_, false, ""); clock_.AdvanceTime( QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() - clock_.ApproximateNow()); @@ -390,9 +397,9 @@ // Enqueue some packets store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); @@ -400,13 +407,13 @@ store_.DiscardPackets(connection_id); // No packets on connection 1 should remain in the store - EXPECT_TRUE(store_.DeliverPackets(connection_id).empty()); + EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); // Check idempotency store_.DiscardPackets(connection_id); - EXPECT_TRUE(store_.DeliverPackets(connection_id).empty()); + EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); } @@ -416,11 +423,11 @@ // Enqueue some packets, which include a CHLO store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - true); + true, ""); store_.EnqueuePacket(connection_id, packet_, server_address_, client_address_, - false); + false, ""); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_TRUE(store_.HasChlosBuffered()); @@ -428,13 +435,13 @@ store_.DiscardPackets(connection_id); // No packets on connection 1 should remain in the store - EXPECT_TRUE(store_.DeliverPackets(connection_id).empty()); + EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); // Check idempotency store_.DiscardPackets(connection_id); - EXPECT_TRUE(store_.DeliverPackets(connection_id).empty()); + EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); } @@ -445,26 +452,32 @@ // Enqueue some packets for two connection IDs store_.EnqueuePacket(connection_id_1, packet_, server_address_, - client_address_, false); + client_address_, false, ""); store_.EnqueuePacket(connection_id_1, packet_, server_address_, - client_address_, false); + client_address_, false, ""); store_.EnqueuePacket(connection_id_2, packet_, server_address_, - client_address_, false); + client_address_, true, "h3"); EXPECT_TRUE(store_.HasBufferedPackets(connection_id_1)); EXPECT_TRUE(store_.HasBufferedPackets(connection_id_2)); - EXPECT_FALSE(store_.HasChlosBuffered()); + EXPECT_TRUE(store_.HasChlosBuffered()); // Discard the packets for connection 1 store_.DiscardPackets(connection_id_1); // No packets on connection 1 should remain in the store - EXPECT_TRUE(store_.DeliverPackets(connection_id_1).empty()); + EXPECT_TRUE(store_.DeliverPackets(connection_id_1).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id_1)); - EXPECT_FALSE(store_.HasChlosBuffered()); + EXPECT_TRUE(store_.HasChlosBuffered()); // Packets on connection 2 should remain EXPECT_TRUE(store_.HasBufferedPackets(connection_id_2)); - EXPECT_EQ(1u, store_.DeliverPackets(connection_id_2).size()); + auto packets = store_.DeliverPackets(connection_id_2); + EXPECT_EQ(1u, packets.buffered_packets.size()); + EXPECT_EQ("h3", packets.alpn); + EXPECT_TRUE(store_.HasChlosBuffered()); + + // Discard the packets for connection 2 + store_.DiscardPackets(connection_id_2); EXPECT_FALSE(store_.HasChlosBuffered()); }
diff --git a/net/quic/core/quic_crypto_client_stream.h b/net/quic/core/quic_crypto_client_stream.h index 2b7bd4a..76ca62ba 100644 --- a/net/quic/core/quic_crypto_client_stream.h +++ b/net/quic/core/quic_crypto_client_stream.h
@@ -28,7 +28,7 @@ public: explicit QuicCryptoClientStreamBase(QuicSession* session); - ~QuicCryptoClientStreamBase() override{}; + ~QuicCryptoClientStreamBase() override {} // Performs a crypto handshake with the server. Returns true if the connection // is still connected.
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h index 56c7860..8c2eb9c9 100644 --- a/net/quic/core/quic_flags_list.h +++ b/net/quic/core/quic_flags_list.h
@@ -129,9 +129,7 @@ // If true, QUIC BBR stores a max filtered number of bytes delivered at a rate // faster than the sending rate. -QUIC_FLAG(bool, - FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, - false) +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, true) // If true, allow cubic updates on every ack, rather than occasionally limiting // the frequency to once every 30ms. @@ -189,13 +187,13 @@ // received for a previously closed QUIC stream. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_final_offset_from_trailers, - false) + true) // If enabled, use refactored stream creation methods. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_refactor_stream_creation, false) // A second take on fixing QUIC BBR packet conservation. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation2, false) +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation2, true) // If true, GFEs generate and validate source address token using the actual // client IP for proxied session.
diff --git a/net/quic/core/quic_packet_creator.cc b/net/quic/core/quic_packet_creator.cc index 213249f..05508cb 100644 --- a/net/quic/core/quic_packet_creator.cc +++ b/net/quic/core/quic_packet_creator.cc
@@ -213,64 +213,11 @@ bool set_fin = fin && bytes_consumed == data_size; // Last frame. UniqueStreamBuffer buffer = NewStreamBuffer(buffer_allocator_, bytes_consumed); - CopyToBuffer(iov, iov_offset, bytes_consumed, buffer.get()); + QuicUtils::CopyToBuffer(iov, iov_offset, bytes_consumed, buffer.get()); *frame = QuicFrame(new QuicStreamFrame(id, set_fin, offset, bytes_consumed, std::move(buffer))); } -// static -void QuicPacketCreator::CopyToBuffer(QuicIOVector iov, - size_t iov_offset, - size_t length, - char* buffer) { - int iovnum = 0; - while (iovnum < iov.iov_count && iov_offset >= iov.iov[iovnum].iov_len) { - iov_offset -= iov.iov[iovnum].iov_len; - ++iovnum; - } - DCHECK_LE(iovnum, iov.iov_count); - DCHECK_LE(iov_offset, iov.iov[iovnum].iov_len); - if (iovnum >= iov.iov_count || length == 0) { - return; - } - - // Unroll the first iteration that handles iov_offset. - const size_t iov_available = iov.iov[iovnum].iov_len - iov_offset; - size_t copy_len = std::min(length, iov_available); - - // Try to prefetch the next iov if there is at least one more after the - // current. Otherwise, it looks like an irregular access that the hardware - // prefetcher won't speculatively prefetch. Only prefetch one iov because - // generally, the iov_offset is not 0, input iov consists of 2K buffers and - // the output buffer is ~1.4K. - if (copy_len == iov_available && iovnum + 1 < iov.iov_count) { - // TODO(ckrasic) - this is unused without prefetch() - // char* next_base = static_cast<char*>(iov.iov[iovnum + 1].iov_base); - // char* next_base = static_cast<char*>(iov.iov[iovnum + 1].iov_base); - // Prefetch 2 cachelines worth of data to get the prefetcher started; leave - // it to the hardware prefetcher after that. - // TODO(ckrasic) - investigate what to do about prefetch directives. - // prefetch(next_base, PREFETCH_HINT_T0); - if (iov.iov[iovnum + 1].iov_len >= 64) { - // TODO(ckrasic) - investigate what to do about prefetch directives. - // prefetch(next_base + CACHELINE_SIZE, PREFETCH_HINT_T0); - } - } - - const char* src = static_cast<char*>(iov.iov[iovnum].iov_base) + iov_offset; - while (true) { - memcpy(buffer, src, copy_len); - length -= copy_len; - buffer += copy_len; - if (length == 0 || ++iovnum >= iov.iov_count) { - break; - } - src = static_cast<char*>(iov.iov[iovnum].iov_base); - copy_len = std::min(length, iov.iov[iovnum].iov_len); - } - QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer."; -} - void QuicPacketCreator::ReserializeAllFrames( const QuicPendingRetransmission& retransmission, char* buffer, @@ -387,7 +334,7 @@ const bool set_fin = fin && (bytes_consumed == remaining_data_size); UniqueStreamBuffer stream_buffer = NewStreamBuffer(buffer_allocator_, bytes_consumed); - CopyToBuffer(iov, iov_offset, bytes_consumed, stream_buffer.get()); + QuicUtils::CopyToBuffer(iov, iov_offset, bytes_consumed, stream_buffer.get()); std::unique_ptr<QuicStreamFrame> frame(new QuicStreamFrame( id, set_fin, stream_offset, bytes_consumed, std::move(stream_buffer))); QUIC_DVLOG(1) << ENDPOINT << "Adding frame: " << *frame;
diff --git a/net/quic/core/quic_packet_creator.h b/net/quic/core/quic_packet_creator.h index 33b81d2..57c1615 100644 --- a/net/quic/core/quic_packet_creator.h +++ b/net/quic/core/quic_packet_creator.h
@@ -233,14 +233,6 @@ bool fin, QuicFrame* frame); - // Copies |length| bytes from iov starting at offset |iov_offset| into buffer. - // |iov| must be at least iov_offset+length total length and buffer must be - // at least |length| long. - static void CopyToBuffer(QuicIOVector iov, - size_t iov_offset, - size_t length, - char* buffer); - void FillPacketHeader(QuicPacketHeader* header); // Adds a |frame| if there is space and returns false and flushes all pending
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc index 95d91e4..cf8e15f 100644 --- a/net/quic/core/quic_stream.cc +++ b/net/quic/core/quic_stream.cc
@@ -82,7 +82,8 @@ } QuicStream::~QuicStream() { - QUIC_LOG_IF(WARNING, !IsWaitingForAcks()) + QUIC_LOG_IF(WARNING, session_ != nullptr && session_->use_stream_notifier() && + IsWaitingForAcks()) << "Stream destroyed while waiting for acks."; }
diff --git a/net/quic/core/quic_tag.cc b/net/quic/core/quic_tag.cc index 1bb9335..1df74e66 100644 --- a/net/quic/core/quic_tag.cc +++ b/net/quic/core/quic_tag.cc
@@ -11,19 +11,16 @@ namespace net { -bool FindMutualQuicTag(const QuicTagVector& our_tags_vector, - const QuicTag* their_tags, - size_t num_their_tags, +bool FindMutualQuicTag(const QuicTagVector& our_tags, + const QuicTagVector& their_tags, QuicTag* out_result, size_t* out_index) { - if (our_tags_vector.empty()) { - return false; - } - const size_t num_our_tags = our_tags_vector.size(); + const size_t num_our_tags = our_tags.size(); + const size_t num_their_tags = their_tags.size(); for (size_t i = 0; i < num_our_tags; i++) { for (size_t j = 0; j < num_their_tags; j++) { - if (our_tags_vector[i] == their_tags[j]) { - *out_result = our_tags_vector[i]; + if (our_tags[i] == their_tags[j]) { + *out_result = our_tags[i]; if (out_index != nullptr) { *out_index = j; }
diff --git a/net/quic/core/quic_tag.h b/net/quic/core/quic_tag.h index c2803cd..bbb029e1 100644 --- a/net/quic/core/quic_tag.h +++ b/net/quic/core/quic_tag.h
@@ -39,8 +39,7 @@ // If |out_index| is non-nullptr and a match is found then the index of that // match in |their_tags| is written to |out_index|. QUIC_EXPORT_PRIVATE bool FindMutualQuicTag(const QuicTagVector& our_tags, - const QuicTag* their_tags, - size_t num_their_tags, + const QuicTagVector& their_tags, QuicTag* out_result, size_t* out_index);
diff --git a/net/quic/core/quic_utils.cc b/net/quic/core/quic_utils.cc index 87f914f..62a4cac 100644 --- a/net/quic/core/quic_utils.cc +++ b/net/quic/core/quic_utils.cc
@@ -11,6 +11,7 @@ #include "base/containers/adapters.h" #include "base/logging.h" #include "net/quic/core/quic_constants.h" +#include "net/quic/platform/api/quic_bug_tracker.h" #include "net/quic/platform/api/quic_flags.h" using std::string; @@ -216,4 +217,57 @@ FLAGS_quic_restart_flag_quic_big_endian_connection_id_server); } +// static +void QuicUtils::CopyToBuffer(QuicIOVector iov, + size_t iov_offset, + size_t length, + char* buffer) { + int iovnum = 0; + while (iovnum < iov.iov_count && iov_offset >= iov.iov[iovnum].iov_len) { + iov_offset -= iov.iov[iovnum].iov_len; + ++iovnum; + } + DCHECK_LE(iovnum, iov.iov_count); + DCHECK_LE(iov_offset, iov.iov[iovnum].iov_len); + if (iovnum >= iov.iov_count || length == 0) { + return; + } + + // Unroll the first iteration that handles iov_offset. + const size_t iov_available = iov.iov[iovnum].iov_len - iov_offset; + size_t copy_len = std::min(length, iov_available); + + // Try to prefetch the next iov if there is at least one more after the + // current. Otherwise, it looks like an irregular access that the hardware + // prefetcher won't speculatively prefetch. Only prefetch one iov because + // generally, the iov_offset is not 0, input iov consists of 2K buffers and + // the output buffer is ~1.4K. + if (copy_len == iov_available && iovnum + 1 < iov.iov_count) { + // TODO(ckrasic) - this is unused without prefetch() + // char* next_base = static_cast<char*>(iov.iov[iovnum + 1].iov_base); + // char* next_base = static_cast<char*>(iov.iov[iovnum + 1].iov_base); + // Prefetch 2 cachelines worth of data to get the prefetcher started; leave + // it to the hardware prefetcher after that. + // TODO(ckrasic) - investigate what to do about prefetch directives. + // prefetch(next_base, PREFETCH_HINT_T0); + if (iov.iov[iovnum + 1].iov_len >= 64) { + // TODO(ckrasic) - investigate what to do about prefetch directives. + // prefetch(next_base + CACHELINE_SIZE, PREFETCH_HINT_T0); + } + } + + const char* src = static_cast<char*>(iov.iov[iovnum].iov_base) + iov_offset; + while (true) { + memcpy(buffer, src, copy_len); + length -= copy_len; + buffer += copy_len; + if (length == 0 || ++iovnum >= iov.iov_count) { + break; + } + src = static_cast<char*>(iov.iov[iovnum].iov_base); + copy_len = std::min(length, iov.iov[iovnum].iov_len); + } + QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer."; +} + } // namespace net
diff --git a/net/quic/core/quic_utils.h b/net/quic/core/quic_utils.h index 7395722..61bff04 100644 --- a/net/quic/core/quic_utils.h +++ b/net/quic/core/quic_utils.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "net/base/int128.h" #include "net/quic/core/quic_error_codes.h" +#include "net/quic/core/quic_iovector.h" #include "net/quic/core/quic_types.h" #include "net/quic/platform/api/quic_export.h" #include "net/quic/platform/api/quic_socket_address.h" @@ -65,6 +66,14 @@ // FLAGS_quic_restart_flag_quic_big_endian_connection_id_server. static bool IsConnectionIdWireFormatBigEndian(Perspective perspective); + // Copies |length| bytes from iov starting at offset |iov_offset| into buffer. + // |iov| must be at least iov_offset+length total length and buffer must be + // at least |length| long. + static void CopyToBuffer(QuicIOVector iov, + size_t iov_offset, + size_t length, + char* buffer); + private: DISALLOW_COPY_AND_ASSIGN(QuicUtils); };
diff --git a/net/quic/quartc/quartc_factory.h b/net/quic/quartc/quartc_factory.h index a37808a..4ba9260 100644 --- a/net/quic/quartc/quartc_factory.h +++ b/net/quic/quartc/quartc_factory.h
@@ -23,7 +23,7 @@ public QuicAlarmFactory, public QuicConnectionHelperInterface { public: - QuartcFactory(const QuartcFactoryConfig& factory_config); + explicit QuartcFactory(const QuartcFactoryConfig& factory_config); ~QuartcFactory() override; // QuartcFactoryInterface overrides.
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index 360f70a..7553d65 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h
@@ -477,8 +477,8 @@ MOCK_METHOD1(MaybeCreateIncomingDynamicStream, QuicStream*(QuicStreamId id)); MOCK_METHOD1(MaybeCreateOutgoingDynamicStream, QuicStream*(SpdyPriority priority)); - MOCK_METHOD1(ShouldCreateIncomingDynamicStream, bool(QuicStreamId id)); - MOCK_METHOD0(ShouldCreateOutgoingDynamicStream, bool()); + MOCK_METHOD1(ShouldCreateIncomingDynamicStream2, bool(QuicStreamId id)); + MOCK_METHOD0(ShouldCreateOutgoingDynamicStream2, bool()); MOCK_METHOD6( WritevData, QuicConsumedData(QuicStream* stream,
diff --git a/net/quic/test_tools/simulator/quic_endpoint.h b/net/quic/test_tools/simulator/quic_endpoint.h index f3cbf4d0..3199994 100644 --- a/net/quic/test_tools/simulator/quic_endpoint.h +++ b/net/quic/test_tools/simulator/quic_endpoint.h
@@ -158,7 +158,7 @@ // Sets the egress port for all the endpoints being multiplexed. void SetTxPort(ConstrainedPortInterface* port) override; - void Act() override{}; + void Act() override {} private: std::unordered_map<std::string, QuicEndpoint*> mapping_;
diff --git a/net/socket/client_socket_pool_manager_impl.cc b/net/socket/client_socket_pool_manager_impl.cc index 325b0ba..b9920a1 100644 --- a/net/socket/client_socket_pool_manager_impl.cc +++ b/net/socket/client_socket_pool_manager_impl.cc
@@ -44,6 +44,7 @@ NetLog* net_log, ClientSocketFactory* socket_factory, SocketPerformanceWatcherFactory* socket_performance_watcher_factory, + NetworkQualityProvider* network_quality_provider, HostResolver* host_resolver, CertVerifier* cert_verifier, ChannelIDService* channel_id_service, @@ -56,6 +57,7 @@ : net_log_(net_log), socket_factory_(socket_factory), socket_performance_watcher_factory_(socket_performance_watcher_factory), + network_quality_provider_(network_quality_provider), host_resolver_(host_resolver), cert_verifier_(cert_verifier), channel_id_service_(channel_id_service), @@ -301,7 +303,8 @@ http_proxy, base::MakeUnique<HttpProxyClientSocketPool>( sockets_per_proxy_server, sockets_per_group, tcp_http_ret.first->second.get(), - ssl_https_ret.first->second.get(), net_log_))); + ssl_https_ret.first->second.get(), + network_quality_provider_, net_log_))); return ret.first->second.get(); }
diff --git a/net/socket/client_socket_pool_manager_impl.h b/net/socket/client_socket_pool_manager_impl.h index 3fde346..d3a7af89 100644 --- a/net/socket/client_socket_pool_manager_impl.h +++ b/net/socket/client_socket_pool_manager_impl.h
@@ -33,6 +33,7 @@ class HttpProxyClientSocketPool; class HostResolver; class NetLog; +class NetworkQualityProvider; class SocketPerformanceWatcherFactory; class SOCKSClientSocketPool; class SSLClientSocketPool; @@ -47,6 +48,7 @@ NetLog* net_log, ClientSocketFactory* socket_factory, SocketPerformanceWatcherFactory* socket_performance_watcher_factory, + NetworkQualityProvider* network_quality_provider, HostResolver* host_resolver, CertVerifier* cert_verifier, ChannelIDService* channel_id_service, @@ -97,6 +99,7 @@ NetLog* const net_log_; ClientSocketFactory* const socket_factory_; SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; + NetworkQualityProvider* network_quality_provider_; HostResolver* const host_resolver_; CertVerifier* const cert_verifier_; ChannelIDService* const channel_id_service_;
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc index 7702979..8074680 100644 --- a/net/socket/ssl_client_socket_pool_unittest.cc +++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -127,6 +127,7 @@ kMaxSocketsPerGroup, &transport_socket_pool_, NULL, + NULL, NULL) { scoped_refptr<SSLConfigService> ssl_config_service( new SSLConfigServiceDefaults);
diff --git a/net/spdy/core/array_output_buffer.h b/net/spdy/core/array_output_buffer.h index 35ecfe86..13f7df4 100644 --- a/net/spdy/core/array_output_buffer.h +++ b/net/spdy/core/array_output_buffer.h
@@ -16,7 +16,7 @@ // of the output. ArrayOutputBuffer(char* buffer, int64_t size) : current_(buffer), begin_(buffer), capacity_(size) {} - ~ArrayOutputBuffer() override{}; + ~ArrayOutputBuffer() override {} ArrayOutputBuffer(const ArrayOutputBuffer&) = delete; ArrayOutputBuffer& operator=(const ArrayOutputBuffer&) = delete;
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc index 59b09424..f73e322 100644 --- a/net/tools/quic/end_to_end_test.cc +++ b/net/tools/quic/end_to_end_test.cc
@@ -2364,7 +2364,7 @@ public: ServerStreamThatDropsBodyFactory() {} - ~ServerStreamThatDropsBodyFactory() override{}; + ~ServerStreamThatDropsBodyFactory() override {} QuicSimpleServerStream* CreateStream( QuicStreamId id, @@ -2407,7 +2407,7 @@ explicit ServerStreamThatSendsHugeResponseFactory(int64_t body_bytes) : body_bytes_(body_bytes) {} - ~ServerStreamThatSendsHugeResponseFactory() override{}; + ~ServerStreamThatSendsHugeResponseFactory() override {} QuicSimpleServerStream* CreateStream( QuicStreamId id,
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc index fda85001..7566dad 100644 --- a/net/tools/quic/quic_dispatcher.cc +++ b/net/tools/quic/quic_dispatcher.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/macros.h" +#include "net/quic/core/crypto/crypto_protocol.h" #include "net/quic/core/crypto/quic_random.h" #include "net/quic/core/quic_utils.h" #include "net/quic/platform/api/quic_bug_tracker.h" @@ -150,9 +151,27 @@ QuicTimeWaitListManager* time_wait_list_manager_; }; +// Class which extracts the ALPN from a CHLO packet. +class ChloAlpnExtractor : public ChloExtractor::Delegate { + public: + void OnChlo(QuicVersion version, + QuicConnectionId connection_id, + const CryptoHandshakeMessage& chlo) override { + QuicStringPiece alpn_value; + if (chlo.GetStringPiece(kALPN, &alpn_value)) { + alpn_ = string(alpn_value); + } + } + + string&& ConsumeAlpn() { return std::move(alpn_); } + + private: + string alpn_; +}; + // Class which sits between the ChloExtractor and the StatelessRejector // to give the QuicDispatcher a chance to apply policy checks to the CHLO. -class ChloValidator : public ChloExtractor::Delegate { +class ChloValidator : public ChloAlpnExtractor { public: ChloValidator(QuicCryptoServerStream::Helper* helper, QuicSocketAddress self_address, @@ -166,6 +185,8 @@ void OnChlo(QuicVersion version, QuicConnectionId connection_id, const CryptoHandshakeMessage& chlo) override { + // Extract the ALPN + ChloAlpnExtractor::OnChlo(version, connection_id, chlo); if (helper_->CanAcceptClientHello(chlo, self_address_, &error_details_)) { can_accept_ = true; rejector_->OnChlo(version, connection_id, @@ -648,13 +669,14 @@ for (; new_sessions_allowed_per_event_loop_ > 0; --new_sessions_allowed_per_event_loop_) { QuicConnectionId connection_id; - std::list<BufferedPacket> packets = + BufferedPacketList packet_list = buffered_packets_.DeliverPacketsForNextConnection(&connection_id); + const std::list<BufferedPacket>& packets = packet_list.buffered_packets; if (packets.empty()) { return; } - QuicSession* session = - CreateQuicSession(connection_id, packets.front().client_address); + QuicSession* session = CreateQuicSession( + connection_id, packets.front().client_address, packet_list.alpn); QUIC_DLOG(INFO) << "Created new session for " << connection_id; session_map_.insert(std::make_pair(connection_id, QuicWrapUnique(session))); DeliverPacketsToSession(packets, session); @@ -706,7 +728,7 @@ } EnqueuePacketResult rs = buffered_packets_.EnqueuePacket( connection_id, *current_packet_, current_server_address_, - current_client_address_, /*is_chlo=*/false); + current_client_address_, /*is_chlo=*/false, /*alpn=*/""); if (rs != EnqueuePacketResult::SUCCESS) { OnBufferPacketFailure(rs, connection_id); } else if (!FLAGS_quic_reloadable_flag_quic_create_session_after_insertion && @@ -744,7 +766,7 @@ !buffered_packets_.HasBufferedPackets(current_connection_id_); EnqueuePacketResult rs = buffered_packets_.EnqueuePacket( current_connection_id_, *current_packet_, current_server_address_, - current_client_address_, /*is_chlo=*/true); + current_client_address_, /*is_chlo=*/true, current_alpn_); if (rs != EnqueuePacketResult::SUCCESS) { OnBufferPacketFailure(rs, current_connection_id_); } else if ( @@ -755,13 +777,13 @@ return; } // Creates a new session and process all buffered packets for this connection. - QuicSession* session = - CreateQuicSession(current_connection_id_, current_client_address_); + QuicSession* session = CreateQuicSession( + current_connection_id_, current_client_address_, current_alpn_); QUIC_DLOG(INFO) << "Created new session for " << current_connection_id_; session_map_.insert( std::make_pair(current_connection_id_, QuicWrapUnique(session))); std::list<BufferedPacket> packets = - buffered_packets_.DeliverPackets(current_connection_id_); + buffered_packets_.DeliverPackets(current_connection_id_).buffered_packets; // Check if CHLO is the first packet arrived on this connection. if (!FLAGS_quic_reloadable_flag_quic_create_session_after_insertion && packets.empty()) { @@ -847,13 +869,15 @@ !FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support || !ShouldAttemptCheapStatelessRejection()) { // Not use cheap stateless reject. + ChloAlpnExtractor alpn_extractor; if (FLAGS_quic_allow_chlo_buffering && !ChloExtractor::Extract(*current_packet_, GetSupportedVersions(), - nullptr)) { + &alpn_extractor)) { // Buffer non-CHLO packets. ProcessUnauthenticatedHeaderFate(kFateBuffer, connection_id); return; } + current_alpn_ = alpn_extractor.ConsumeAlpn(); ProcessUnauthenticatedHeaderFate(kFateProcess, connection_id); return; } @@ -869,6 +893,7 @@ ProcessUnauthenticatedHeaderFate(kFateBuffer, connection_id); return; } + current_alpn_ = validator.ConsumeAlpn(); if (!validator.can_accept()) { // This CHLO is prohibited by policy.
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h index 877e602f..bd739d4 100644 --- a/net/tools/quic/quic_dispatcher.h +++ b/net/tools/quic/quic_dispatcher.h
@@ -162,7 +162,8 @@ protected: virtual QuicSession* CreateQuicSession( QuicConnectionId connection_id, - const QuicSocketAddress& client_address) = 0; + const QuicSocketAddress& client_address, + QuicStringPiece alpn) = 0; // Called when a connection is rejected statelessly. virtual void OnConnectionRejectedStatelessly(); @@ -377,6 +378,8 @@ QuicSocketAddress current_client_address_; QuicSocketAddress current_server_address_; const QuicReceivedPacket* current_packet_; + // If |current_packet_| is a CHLO packet, the extracted alpn. + std::string current_alpn_; QuicConnectionId current_connection_id_; // Used to get the supported versions based on flag. Does not own.
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc index 9da4da09..751e306 100644 --- a/net/tools/quic/quic_dispatcher_test.cc +++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -10,6 +10,7 @@ #include "base/macros.h" #include "net/quic/core/crypto/crypto_handshake.h" +#include "net/quic/core/crypto/crypto_protocol.h" #include "net/quic/core/crypto/quic_crypto_server_config.h" #include "net/quic/core/crypto/quic_random.h" #include "net/quic/core/quic_crypto_stream.h" @@ -131,9 +132,10 @@ std::unique_ptr<QuicEpollAlarmFactory>( new QuicEpollAlarmFactory(eps))) {} - MOCK_METHOD2(CreateQuicSession, + MOCK_METHOD3(CreateQuicSession, QuicServerSessionBase*(QuicConnectionId connection_id, - const QuicSocketAddress& client_address)); + const QuicSocketAddress& client_address, + QuicStringPiece alpn)); MOCK_METHOD1(ShouldCreateOrBufferPacketForConnection, bool(QuicConnectionId connection_id)); @@ -317,6 +319,7 @@ string SerializeCHLO() { CryptoHandshakeMessage client_hello; client_hello.set_tag(kCHLO); + client_hello.SetStringPiece(kALPN, "hq"); return client_hello.GetSerialized(Perspective::IS_CLIENT) .AsStringPiece() .as_string(); @@ -343,7 +346,8 @@ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5); - EXPECT_CALL(*dispatcher_, CreateQuicSession(1, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(1, client_address, QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, 1, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -357,7 +361,8 @@ EXPECT_EQ(client_address, dispatcher_->current_client_address()); EXPECT_EQ(server_address_, dispatcher_->current_server_address()); - EXPECT_CALL(*dispatcher_, CreateQuicSession(2, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(2, client_address, QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, 2, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -381,7 +386,9 @@ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5); - EXPECT_CALL(*dispatcher_, CreateQuicSession(1, client_address)).Times(0); + EXPECT_CALL(*dispatcher_, + CreateQuicSession(1, client_address, QuicStringPiece("hq"))) + .Times(0); QuicVersion version = static_cast<QuicVersion>(QuicVersionMin() - 1); ProcessPacket(client_address, 1, true, version, SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER, 1); @@ -390,7 +397,8 @@ TEST_F(QuicDispatcherTest, Shutdown) { QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); - EXPECT_CALL(*dispatcher_, CreateQuicSession(_, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(_, client_address, QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, 1, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -415,7 +423,8 @@ // Create a new session. QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); QuicConnectionId connection_id = 1; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, connection_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -468,7 +477,8 @@ QuicConnectionId connection_id = 1; // Dispatcher forwards all packets for this connection_id to the time wait // list manager. - EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _)).Times(0); + EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, QuicStringPiece("hq"))) + .Times(0); EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, connection_id)) .Times(1); EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _)) @@ -483,7 +493,9 @@ server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5); // dispatcher_ should drop this packet. - EXPECT_CALL(*dispatcher_, CreateQuicSession(1, client_address)).Times(0); + EXPECT_CALL(*dispatcher_, + CreateQuicSession(1, client_address, QuicStringPiece("hq"))) + .Times(0); EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, _)).Times(0); EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _)) .Times(0); @@ -495,7 +507,8 @@ QuicConnectionId connection_id = 1; server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5); - EXPECT_CALL(*dispatcher_, CreateQuicSession(1, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(1, client_address, QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, 1, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -522,7 +535,8 @@ QuicConnectionId connection_id = 1; // Dispatcher forwards this packet for this connection_id to the time wait // list manager. - EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _)).Times(0); + EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, QuicStringPiece("hq"))) + .Times(0); EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, connection_id)) .Times(1); EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _)) @@ -544,13 +558,15 @@ server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5); QuicConnectionId connection_id = 1; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .Times(0); ProcessPacket(client_address, connection_id, true, static_cast<QuicVersion>(QuicVersionMin() - 1), SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER, 1); ++connection_id; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, connection_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -566,7 +582,8 @@ SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER, 1); ++connection_id; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, connection_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -584,7 +601,8 @@ // Turn off version 40. SetQuicFlag(&FLAGS_quic_enable_version_40, false); ++connection_id; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .Times(0); ProcessPacket(client_address, connection_id, true, QUIC_VERSION_40, SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID, @@ -593,7 +611,8 @@ // Turn on version 40. SetQuicFlag(&FLAGS_quic_enable_version_40, true); ++connection_id; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, connection_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -612,7 +631,8 @@ // Turn off version 39. FLAGS_quic_reloadable_flag_quic_enable_version_39 = false; ++connection_id; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .Times(0); ProcessPacket(client_address, connection_id, true, QUIC_VERSION_39, SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID, @@ -621,7 +641,8 @@ // Turn on version 39. FLAGS_quic_reloadable_flag_quic_enable_version_39 = true; ++connection_id; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, connection_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -766,7 +787,8 @@ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); QuicConnectionId connection_id = 1; - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("hq"))) .WillOnce(testing::Return( CreateSessionBasedOnTestParams(connection_id, client_address))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), @@ -817,10 +839,12 @@ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); QuicConnectionId connection_id = 1; if (GetParam().enable_stateless_rejects_via_flag) { - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(connection_id, client_address, _)) .Times(0); } else { - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("h2"))) .WillOnce(testing::Return( CreateSessionBasedOnTestParams(connection_id, client_address))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), @@ -837,6 +861,7 @@ {"KEXS", "C255"}, {"COPT", "SREJ"}, {"NONC", "1234567890123456789012"}, + {"ALPN", "h2"}, {"VER\0", "Q025"}}, kClientHelloMinimumSize); @@ -872,37 +897,39 @@ ProcessPacket(client_address, connection_id, true, "NOT DATA FOR A CHLO"); // Process the first packet for the connection. - CryptoHandshakeMessage client_hello = - crypto_test_utils::CreateCHLO({{"AEAD", "AESG"}, - {"KEXS", "C255"}, - {"NONC", "1234567890123456789012"}, - {"VER\0", "Q025"}}, - kClientHelloMinimumSize); + CryptoHandshakeMessage client_hello = + crypto_test_utils::CreateCHLO({{"AEAD", "AESG"}, + {"KEXS", "C255"}, + {"NONC", "1234567890123456789012"}, + {"ALPN", "h3"}, + {"VER\0", "Q025"}}, + kClientHelloMinimumSize); - // If stateless rejects are enabled then a connection will be created now - // and the buffered packet will be processed - EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) - .WillOnce(testing::Return( - CreateSessionBasedOnTestParams(connection_id, client_address))); - EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), - ProcessUdpPacket(_, client_address, _)) - .WillOnce(testing::WithArg<2>( - Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket, - base::Unretained(this), connection_id)))); - // Expect both packets to be passed to ProcessUdpPacket(). And one of them - // is already expected in CreateSessionBasedOnTestParams(). - EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), - ProcessUdpPacket(_, client_address, _)) - .WillOnce(testing::WithArg<2>( - Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket, - base::Unretained(this), connection_id)))) - .RetiresOnSaturation(); - ProcessPacket(client_address, connection_id, true, - client_hello.GetSerialized(Perspective::IS_CLIENT) - .AsStringPiece() - .as_string()); - EXPECT_FALSE( - time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)); + // If stateless rejects are enabled then a connection will be created now + // and the buffered packet will be processed + EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address, + QuicStringPiece("h3"))) + .WillOnce(testing::Return( + CreateSessionBasedOnTestParams(connection_id, client_address))); + EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), + ProcessUdpPacket(_, client_address, _)) + .WillOnce(testing::WithArg<2>( + Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket, + base::Unretained(this), connection_id)))); + // Expect both packets to be passed to ProcessUdpPacket(). And one of them + // is already expected in CreateSessionBasedOnTestParams(). + EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), + ProcessUdpPacket(_, client_address, _)) + .WillOnce(testing::WithArg<2>( + Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket, + base::Unretained(this), connection_id)))) + .RetiresOnSaturation(); + ProcessPacket(client_address, connection_id, true, + client_hello.GetSerialized(Perspective::IS_CLIENT) + .AsStringPiece() + .as_string()); + EXPECT_FALSE( + time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)); } // Verify the stopgap test: Packets with truncated connection IDs should be @@ -917,7 +944,8 @@ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); QuicConnectionId connection_id = 1; // Dispatcher drops this packet. - EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _)).Times(0); + EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, QuicStringPiece("hq"))) + .Times(0); EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, connection_id)) .Times(0); EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _)) @@ -957,7 +985,8 @@ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); - EXPECT_CALL(*dispatcher_, CreateQuicSession(_, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(_, client_address, QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, 1, client_address, &helper_, &alarm_factory_, &crypto_config_, @@ -969,7 +998,8 @@ EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(1)); ProcessPacket(client_address, 1, true, SerializeCHLO()); - EXPECT_CALL(*dispatcher_, CreateQuicSession(_, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(_, client_address, QuicStringPiece("hq"))) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, 2, client_address, &helper_, &alarm_factory_, &crypto_config_, @@ -1241,7 +1271,8 @@ data_connection_map_[conn_id].pop_back(); // When CHLO arrives, a new session should be created, and all packets // buffered should be delivered to the session. - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_address, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1309,7 +1340,8 @@ EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id)); } - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_address, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1343,7 +1375,8 @@ QuicConnectionId conn_id = 1; QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_address, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1364,7 +1397,8 @@ // When CHLO arrives, a new session should be created, and all packets // buffered should be delivered to the session. - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_address)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_address, QuicStringPiece())) .Times(1) // Only triggered by 1st CHLO. .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_address, &mock_helper_, @@ -1433,7 +1467,8 @@ ShouldCreateOrBufferPacketForConnection(conn_id)); } if (conn_id <= kMaxNumSessionsToCreate) { - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1462,7 +1497,8 @@ for (size_t conn_id = kMaxNumSessionsToCreate + 1; conn_id <= kMaxNumSessionsToCreate + kDefaultMaxConnectionsInStore; ++conn_id) { - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1473,7 +1509,8 @@ Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket, base::Unretained(this), conn_id)))); } - EXPECT_CALL(*dispatcher_, CreateQuicSession(kNumCHLOs, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(kNumCHLOs, client_addr_, QuicStringPiece())) .Times(0); while (store->HasChlosBuffered()) { @@ -1492,7 +1529,8 @@ ++conn_id) { // Last CHLO will be buffered. Others will create connection right away. if (conn_id <= kMaxNumSessionsToCreate) { - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1513,7 +1551,8 @@ size_t packets_buffered = 2; // Reset counter and process buffered CHLO. - EXPECT_CALL(*dispatcher_, CreateQuicSession(last_connection, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(last_connection, client_addr_, + QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, last_connection, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1534,7 +1573,8 @@ for (QuicConnectionId conn_id = 1; conn_id <= last_connection_id; ++conn_id) { // Last CHLO will be buffered. Others will create connection right away. if (conn_id <= kMaxNumSessionsToCreate) { - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1557,7 +1597,8 @@ } // Reset counter and process buffered CHLO. - EXPECT_CALL(*dispatcher_, CreateQuicSession(last_connection_id, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(last_connection_id, client_addr_, + QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, last_connection_id, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1591,7 +1632,8 @@ conn_id <= kDefaultMaxConnectionsInStore + kMaxNumSessionsToCreate; ++conn_id) { if (conn_id <= kMaxNumSessionsToCreate + 1) { - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece())) .WillOnce(testing::Return(CreateSession( dispatcher_.get(), config_, conn_id, client_addr_, &mock_helper_, &mock_alarm_factory_, &crypto_config_, @@ -1635,6 +1677,7 @@ chlo_ = crypto_test_utils::GenerateDefaultInchoateCHLO(clock_, version, &crypto_config_); chlo_.SetVector(net::kCOPT, net::QuicTagVector{net::kSREJ}); + chlo_.SetStringPiece(kALPN, "HTTP/1"); // Pass an inchoate CHLO. crypto_test_utils::GenerateFullCHLO( chlo_, &crypto_config_, server_addr_, client_addr_, version, clock_, @@ -1716,7 +1759,8 @@ EXPECT_CALL(check, Call(1)); EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_, + QuicStringPiece("HTTP/1"))) .WillOnce(testing::Return(GetSession(conn_id))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( GetSession(conn_id)->connection()), @@ -1766,7 +1810,8 @@ ProcessPacket(_, client_addr_, conn_id)); EXPECT_CALL(check, Call(2)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece("hq"))) .Times(0); EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, client_addr_, conn_id)); @@ -1801,7 +1846,8 @@ EXPECT_CALL(check, Call(1)); EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id_2)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_2, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_2, client_addr_, + QuicStringPiece("HTTP/1"))) .WillOnce(testing::Return(GetSession(conn_id_2))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( GetSession(conn_id_2)->connection()), @@ -1823,7 +1869,8 @@ ShouldCreateOrBufferPacketForConnection(conn_id_1)); EXPECT_CALL(check, Call(4)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_1, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_1, client_addr_, + QuicStringPiece("HTTP/1"))) .WillOnce(testing::Return(GetSession(conn_id_1))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( GetSession(conn_id_1)->connection()), @@ -1880,7 +1927,7 @@ InSequence s; EXPECT_CALL(check, Call(1)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_2, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_2, client_addr_, _)) .Times(0); EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(conn_id_2, _, true, _)); @@ -1953,7 +2000,8 @@ ShouldCreateOrBufferPacketForConnection(conn_id_1)); EXPECT_CALL(check, Call(2)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_1, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id_1, client_addr_, QuicStringPiece())) .Times(0); EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(conn_id_1, _, true, _)); @@ -1999,7 +2047,8 @@ EXPECT_CALL(check, Call(2)); EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, client_addr_, conn_id)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, + CreateQuicSession(conn_id, client_addr_, QuicStringPiece())) .Times(0); } @@ -2051,7 +2100,8 @@ EXPECT_CALL(check, Call(2)); EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id)); - EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_)) + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_, + QuicStringPiece("HTTP/1"))) .WillOnce(testing::Return(GetSession(conn_id))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( GetSession(conn_id)->connection()),
diff --git a/net/tools/quic/quic_simple_dispatcher.cc b/net/tools/quic/quic_simple_dispatcher.cc index e173624..8b8e59c8 100644 --- a/net/tools/quic/quic_simple_dispatcher.cc +++ b/net/tools/quic/quic_simple_dispatcher.cc
@@ -48,7 +48,8 @@ QuicServerSessionBase* QuicSimpleDispatcher::CreateQuicSession( QuicConnectionId connection_id, - const QuicSocketAddress& client_address) { + const QuicSocketAddress& client_address, + QuicStringPiece /*alpn*/) { // The QuicServerSessionBase takes ownership of |connection| below. QuicConnection* connection = new QuicConnection( connection_id, client_address, helper(), alarm_factory(),
diff --git a/net/tools/quic/quic_simple_dispatcher.h b/net/tools/quic/quic_simple_dispatcher.h index 41d24cf..04e1252 100644 --- a/net/tools/quic/quic_simple_dispatcher.h +++ b/net/tools/quic/quic_simple_dispatcher.h
@@ -31,7 +31,8 @@ protected: QuicServerSessionBase* CreateQuicSession( QuicConnectionId connection_id, - const QuicSocketAddress& client_address) override; + const QuicSocketAddress& client_address, + QuicStringPiece alpn) override; QuicHttpResponseCache* response_cache() { return response_cache_; }
diff --git a/net/tools/quic/quic_simple_server_stream_test.cc b/net/tools/quic/quic_simple_server_stream_test.cc index 93b06cf5..c1add55 100644 --- a/net/tools/quic/quic_simple_server_stream_test.cc +++ b/net/tools/quic/quic_simple_server_stream_test.cc
@@ -43,7 +43,7 @@ QuicHttpResponseCache* response_cache) : QuicSimpleServerStream(stream_id, session, response_cache) {} - ~QuicSimpleServerStreamPeer() override{}; + ~QuicSimpleServerStreamPeer() override {} using QuicSimpleServerStream::SendResponse; using QuicSimpleServerStream::SendErrorResponse;
diff --git a/net/tools/quic/test_tools/quic_test_server.cc b/net/tools/quic/test_tools/quic_test_server.cc index a99706f9..a2a497377 100644 --- a/net/tools/quic/test_tools/quic_test_server.cc +++ b/net/tools/quic/test_tools/quic_test_server.cc
@@ -95,13 +95,13 @@ stream_factory_(nullptr), crypto_stream_factory_(nullptr) {} - QuicServerSessionBase* CreateQuicSession( - QuicConnectionId id, - const QuicSocketAddress& client) override { + QuicServerSessionBase* CreateQuicSession(QuicConnectionId id, + const QuicSocketAddress& client, + QuicStringPiece alpn) override { QuicReaderMutexLock lock(&factory_lock_); if (session_factory_ == nullptr && stream_factory_ == nullptr && crypto_stream_factory_ == nullptr) { - return QuicSimpleDispatcher::CreateQuicSession(id, client); + return QuicSimpleDispatcher::CreateQuicSession(id, client, alpn); } QuicConnection* connection = new QuicConnection( id, client, helper(), alarm_factory(), CreatePerConnectionWriter(),
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc index 30558b6..4851b2f 100644 --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc
@@ -37,6 +37,7 @@ #include "net/http/transport_security_persister.h" #include "net/http/transport_security_state.h" #include "net/net_features.h" +#include "net/nqe/network_quality_estimator.h" #include "net/quic/chromium/quic_stream_factory.h" #include "net/ssl/channel_id_service.h" #include "net/ssl/default_channel_id_store.h" @@ -233,6 +234,8 @@ request_context->http_server_properties(); session_context->net_log = request_context->net_log(); session_context->channel_id_service = request_context->channel_id_service(); + session_context->network_quality_provider = + request_context->network_quality_estimator(); } void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { @@ -424,6 +427,7 @@ if (socket_performance_watcher_factory_) { network_session_context.socket_performance_watcher_factory = socket_performance_watcher_factory_; + DCHECK(network_session_context.network_quality_provider); } storage->set_http_network_session(base::MakeUnique<HttpNetworkSession>(
diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc index 04990a9a..21ae7cd5 100644 --- a/printing/backend/win_helper.cc +++ b/printing/backend/win_helper.cc
@@ -471,17 +471,6 @@ return ticket; } -bool IsPrinterRPCSOnly(const wchar_t* name, const wchar_t* port) { - int num_languages = - DeviceCapabilities(name, port, DC_PERSONALITY, NULL, NULL); - if (num_languages != 1) - return false; - std::vector<wchar_t> buf(33, 0); - DeviceCapabilities(name, port, DC_PERSONALITY, buf.data(), NULL); - static constexpr wchar_t kRPCSLanguage[] = L"RPCS"; - return wcscmp(buf.data(), kRPCSLanguage) == 0; -} - bool PrinterHasValidPaperSize(const wchar_t* name, const wchar_t* port) { return DeviceCapabilities(name, port, DC_PAPERSIZE, nullptr, nullptr) > 0; } @@ -507,14 +496,10 @@ const wchar_t* name = info_5.get()->pPrinterName; const wchar_t* port = info_5.get()->pPortName; - // Check for RPCS drivers on Windows 8+ as DocumentProperties will crash if - // called on one of these printers. See crbug.com/679160. - // Also check that valid paper sizes exist; some old drivers return no paper - // sizes and crash in DocumentProperties if used with Win10. See + // Check that valid paper sizes exist; some old drivers return no paper sizes + // and crash in DocumentProperties if used with Win10. See crbug.com/679160, // crbug.com/724595 - if ((base::win::GetVersion() >= base::win::VERSION_WIN8 && - IsPrinterRPCSOnly(name, port)) || - !PrinterHasValidPaperSize(name, port)) { + if (!PrinterHasValidPaperSize(name, port)) { return nullptr; }
diff --git a/remoting/host/touch_injector_win_unittest.cc b/remoting/host/touch_injector_win_unittest.cc index 4e0fc17..5b0c75ba 100644 --- a/remoting/host/touch_injector_win_unittest.cc +++ b/remoting/host/touch_injector_win_unittest.cc
@@ -76,7 +76,7 @@ public: TouchInjectorWinDelegateMock() : TouchInjectorWinDelegate(nullptr, nullptr, nullptr) {} - ~TouchInjectorWinDelegateMock() override {}; + ~TouchInjectorWinDelegateMock() override {} MOCK_METHOD2(InitializeTouchInjection, BOOL(UINT32 max_count, DWORD dw_mode)); MOCK_METHOD2(InjectTouchInput,
diff --git a/remoting/test/protocol_perftest.cc b/remoting/test/protocol_perftest.cc index 4b3a55fd..1491273 100644 --- a/remoting/test/protocol_perftest.cc +++ b/remoting/test/protocol_perftest.cc
@@ -91,7 +91,7 @@ ~FakeCursorShapeStub() override {} // protocol::CursorShapeStub interface. - void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override{}; + void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override {} }; } // namespace
diff --git a/sandbox/win/src/ipc_unittest.cc b/sandbox/win/src/ipc_unittest.cc index c41720d..a29de46 100644 --- a/sandbox/win/src/ipc_unittest.cc +++ b/sandbox/win/src/ipc_unittest.cc
@@ -564,7 +564,7 @@ }; UnitTestIPCDispatcher(); - ~UnitTestIPCDispatcher() override{}; + ~UnitTestIPCDispatcher() override {} bool SetupService(InterceptionManager* manager, int service) override { return true;
diff --git a/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java b/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java index 3c6e2faef..9095806 100644 --- a/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java +++ b/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java
@@ -38,6 +38,8 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -45,6 +47,7 @@ */ public class NfcImpl implements Nfc { private static final String TAG = "NfcImpl"; + private static final String ANY_PATH = "/*"; private final int mHostId; @@ -580,10 +583,8 @@ return false; } - // Filter by NfcMessage.url - if (options.url != null && !options.url.isEmpty() && !options.url.equals(message.url)) { - return false; - } + // Filter by WebNfc watch Id. + if (!matchesWebNfcId(message.url, options.url)) return false; // Matches any record / media type. if ((options.mediaType == null || options.mediaType.isEmpty()) @@ -617,6 +618,33 @@ } /** + * WebNfc Id match algorithm. + * https://w3c.github.io/web-nfc/#url-pattern-match-algorithm + */ + private boolean matchesWebNfcId(String id, String pattern) { + if (id != null && !id.isEmpty() && pattern != null && !pattern.isEmpty()) { + try { + URL id_url = new URL(id); + URL pattern_url = new URL(pattern); + + if (!id_url.getProtocol().equals(pattern_url.getProtocol())) return false; + if (!id_url.getHost().endsWith("." + pattern_url.getHost()) + && !id_url.getHost().equals(pattern_url.getHost())) { + return false; + } + if (pattern_url.getPath().equals(ANY_PATH)) return true; + if (id_url.getPath().startsWith(pattern_url.getPath())) return true; + return false; + + } catch (MalformedURLException e) { + return false; + } + } + + return true; + } + + /** * Called by ReaderCallbackHandler when NFC tag is in proximity. */ public void onTagDiscovered(Tag tag) {
diff --git a/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java b/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java index f74b119..abea064 100644 --- a/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java +++ b/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java
@@ -154,7 +154,7 @@ try { doNothing().when(mNfcTagHandler).connect(); doNothing().when(mNfcTagHandler).write(any(NdefMessage.class)); - doReturn(createUrlWebNFCNdefMessage()).when(mNfcTagHandler).read(); + doReturn(createUrlWebNFCNdefMessage(TEST_URL)).when(mNfcTagHandler).read(); doNothing().when(mNfcTagHandler).close(); } catch (IOException | FormatException e) { } @@ -280,7 +280,7 @@ @Feature({"NFCTest"}) public void testMojoToNdefConversion() throws InvalidNfcMessageException { // Test URL record conversion. - NdefMessage urlNdefMessage = createUrlWebNFCNdefMessage(); + NdefMessage urlNdefMessage = createUrlWebNFCNdefMessage(TEST_URL); assertEquals(2, urlNdefMessage.getRecords().length); assertEquals(NdefRecord.TNF_WELL_KNOWN, urlNdefMessage.getRecords()[0].getTnf()); assertEquals(TEST_URL, urlNdefMessage.getRecords()[0].toUri().toString()); @@ -454,12 +454,12 @@ */ @Test @Feature({"NFCTest"}) - public void testlWatchMatching() { + public void testWatchMatching() { TestNfcImpl nfc = new TestNfcImpl(mContext, mDelegate); mDelegate.invokeCallback(); nfc.setClient(mNfcClient); - // Should match by WebNFC Id. + // Should match by WebNFC Id (exact match). NfcWatchOptions options1 = createNfcWatchOptions(); options1.mode = NfcWatchMode.WEBNFC_ONLY; options1.url = TEST_URL; @@ -877,6 +877,152 @@ } /** + * Test that Nfc.watch() WebNFC Id pattern matching works correctly. + */ + @Test + @Feature({"NFCTest"}) + public void testWatchPatternMatching() throws IOException, FormatException { + TestNfcImpl nfc = new TestNfcImpl(mContext, mDelegate); + mDelegate.invokeCallback(); + nfc.setClient(mNfcClient); + + // Should match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "https://test.com/*"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + int watchId1 = mWatchCaptor.getValue().intValue(); + + // Should match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "https://test.com/contact/42"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + int watchId2 = mWatchCaptor.getValue().intValue(); + + // Should match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "https://subdomain.test.com/*"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + int watchId3 = mWatchCaptor.getValue().intValue(); + + // Should match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "https://subdomain.test.com/contact"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + int watchId4 = mWatchCaptor.getValue().intValue(); + + // Should not match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "https://www.test.com/*"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + + // Should not match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "http://test.com/*"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + + // Should not match. + { + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "invalid pattern url"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + } + + doReturn(createUrlWebNFCNdefMessage("https://subdomain.test.com/contact/42")) + .when(mNfcTagHandler) + .read(); + nfc.processPendingOperationsForTesting(mNfcTagHandler); + + // None of the watches should match NFCMessage with this WebNFC Id. + doReturn(createUrlWebNFCNdefMessage("https://notest.com/foo")).when(mNfcTagHandler).read(); + nfc.processPendingOperationsForTesting(mNfcTagHandler); + + // Check that client was notified and watch with correct id was triggered. + verify(mNfcClient, times(1)) + .onWatch(mOnWatchCallbackCaptor.capture(), any(NfcMessage.class)); + assertEquals(4, mOnWatchCallbackCaptor.getValue().length); + assertEquals(watchId1, mOnWatchCallbackCaptor.getValue()[0]); + assertEquals(watchId2, mOnWatchCallbackCaptor.getValue()[1]); + assertEquals(watchId3, mOnWatchCallbackCaptor.getValue()[2]); + assertEquals(watchId4, mOnWatchCallbackCaptor.getValue()[3]); + } + + /** + * Test that Nfc.watch() WebNFC Id pattern matching works correctly for invalid WebNFC Ids. + */ + @Test + @Feature({"NFCTest"}) + public void testWatchPatternMatchingInvalidId() throws IOException, FormatException { + TestNfcImpl nfc = new TestNfcImpl(mContext, mDelegate); + mDelegate.invokeCallback(); + nfc.setClient(mNfcClient); + + // Should not match when invalid WebNFC Id is received. + NfcWatchOptions options = createNfcWatchOptions(); + options.mode = NfcWatchMode.WEBNFC_ONLY; + options.url = "https://test.com/*"; + WatchResponse mockWatchCallback = mock(WatchResponse.class); + nfc.watch(options, mockWatchCallback); + verify(mockWatchCallback).call(mWatchCaptor.capture(), mErrorCaptor.capture()); + assertNull(mErrorCaptor.getValue()); + + doReturn(createUrlWebNFCNdefMessage("http://subdomain.test.com/contact/42")) + .when(mNfcTagHandler) + .read(); + nfc.processPendingOperationsForTesting(mNfcTagHandler); + + doReturn(createUrlWebNFCNdefMessage("ftp://subdomain.test.com/contact/42")) + .when(mNfcTagHandler) + .read(); + nfc.processPendingOperationsForTesting(mNfcTagHandler); + + doReturn(createUrlWebNFCNdefMessage("invalid url")).when(mNfcTagHandler).read(); + nfc.processPendingOperationsForTesting(mNfcTagHandler); + + verify(mNfcClient, times(0)) + .onWatch(mOnWatchCallbackCaptor.capture(), any(NfcMessage.class)); + } + + /** * Creates NfcPushOptions with default values. */ private NfcPushOptions createNfcPushOptions() { @@ -928,12 +1074,12 @@ return message; } - private NdefMessage createUrlWebNFCNdefMessage() { + private NdefMessage createUrlWebNFCNdefMessage(String webNfcId) { NfcRecord urlNfcRecord = new NfcRecord(); urlNfcRecord.recordType = NfcRecordType.URL; urlNfcRecord.mediaType = TEXT_MIME; urlNfcRecord.data = TEST_URL.getBytes(); - NfcMessage urlNfcMessage = createNfcMessage(TEST_URL, urlNfcRecord); + NfcMessage urlNfcMessage = createNfcMessage(webNfcId, urlNfcRecord); try { return NfcTypeConverter.toNdefMessage(urlNfcMessage); } catch (InvalidNfcMessageException e) {
diff --git a/services/preferences/tracked/registry_hash_store_contents_win.cc b/services/preferences/tracked/registry_hash_store_contents_win.cc index 76ee57f..4b80458 100644 --- a/services/preferences/tracked/registry_hash_store_contents_win.cc +++ b/services/preferences/tracked/registry_hash_store_contents_win.cc
@@ -105,7 +105,9 @@ if (key.Open(HKEY_CURRENT_USER, preference_key_name_.c_str(), KEY_SET_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { LONG result = key.DeleteKey(L""); - DCHECK(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND) << result; + DCHECK(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND || + result == ERROR_ACCESS_DENIED || result == ERROR_KEY_DELETED) + << result; } }
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 06f89d2..e3ce448 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -1576,101 +1576,1226 @@ "KitKat Tablet Tester": { "gtest_tests": [ { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "android_webview_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 900, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "android_webview_unittests" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "base_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "breakpad_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "breakpad_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "capture_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "capture_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "cc_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "cc_unittests" }, { - "test": "components_browsertests" - }, - { - "test": "components_unittests" - }, - { - "test": "content_browsertests" - }, - { - "test": "content_unittests" - }, - { - "test": "device_unittests" - }, - { - "test": "events_unittests" - }, - { - "test": "gfx_unittests" - }, - { - "test": "gl_tests" - }, - { - "test": "gl_unittests" - }, - { - "test": "gpu_ipc_service_unittests" - }, - { - "test": "gpu_unittests" - }, - { - "test": "ipc_tests" - }, - { - "test": "latency_unittests" - }, - { - "test": "media_unittests" - }, - { - "test": "net_unittests" - }, - { - "test": "sandbox_linux_unittests" - }, - { - "test": "sql_unittests" - }, - { - "test": "storage_unittests" - }, - { - "test": "ui_android_unittests" - }, - { - "test": "ui_base_unittests" - }, - { - "test": "ui_touch_selection_unittests" - }, - { - "test": "unit_tests" - }, - { - "test": "vr_common_unittests" - } - ], - "instrumentation_tests": [ - { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 10 + }, "test": "chrome_public_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, "test": "chrome_sync_shell_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 360, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, + "test": "components_browsertests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, + "test": "components_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 8 + }, + "test": "content_browsertests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 6 + }, "test": "content_shell_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 3 + }, + "test": "content_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "device_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "device_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "events_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "events_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gfx_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 180, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gfx_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gl_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gl_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_ipc_service_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gpu_ipc_service_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 450, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gpu_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ipc_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ipc_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "latency_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "latency_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "media_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "media_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 3 + }, + "test": "net_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sandbox_linux_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "sandbox_linux_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sql_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "sql_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "storage_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "storage_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_android_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_android_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_base_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_touch_selection_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_touch_selection_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 4 + }, + "test": "unit_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "vr_common_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "vr_common_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "KTU84Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 6 + }, "test": "webview_instrumentation_test_apk" } ] @@ -3081,101 +4206,1235 @@ "Lollipop Tablet Tester": { "gtest_tests": [ { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "android_webview_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 900, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "android_webview_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "base_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "breakpad_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "breakpad_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "capture_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "capture_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "cc_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "cc_unittests" }, { - "test": "components_browsertests" - }, - { - "test": "components_unittests" - }, - { - "test": "content_browsertests" - }, - { - "test": "content_unittests" - }, - { - "test": "device_unittests" - }, - { - "test": "events_unittests" - }, - { - "test": "gfx_unittests" - }, - { - "test": "gl_tests" - }, - { - "test": "gl_unittests" - }, - { - "test": "gpu_ipc_service_unittests" - }, - { - "test": "gpu_unittests" - }, - { - "test": "ipc_tests" - }, - { - "test": "media_blink_unittests" - }, - { - "test": "media_unittests" - }, - { - "test": "net_unittests" - }, - { - "test": "sandbox_linux_unittests" - }, - { - "test": "sql_unittests" - }, - { - "test": "storage_unittests" - }, - { - "test": "ui_android_unittests" - }, - { - "test": "ui_base_unittests" - }, - { - "test": "ui_touch_selection_unittests" - }, - { - "test": "unit_tests" - }, - { - "test": "vr_common_unittests" - } - ], - "instrumentation_tests": [ - { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 10 + }, "test": "chrome_public_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, "test": "chrome_sync_shell_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 360, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, + "test": "components_browsertests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, + "test": "components_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 8 + }, + "test": "content_browsertests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 6 + }, "test": "content_shell_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 3 + }, + "test": "content_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "device_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "device_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "events_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "events_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gfx_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 180, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gfx_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gl_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gl_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_ipc_service_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gpu_ipc_service_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 450, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gpu_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ipc_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ipc_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "media_blink_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": "10800", + "hard_timeout": "300", + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "media_blink_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "media_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "media_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 3 + }, + "test": "net_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sandbox_linux_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "sandbox_linux_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sql_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "sql_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "storage_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "storage_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_android_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_android_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_base_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_touch_selection_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_touch_selection_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 4 + }, + "test": "unit_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "vr_common_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "vr_common_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY49B", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 6 + }, "test": "webview_instrumentation_test_apk" } ] @@ -4911,101 +7170,1235 @@ "Marshmallow Tablet Tester": { "gtest_tests": [ { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "android_webview_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 900, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "android_webview_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "base_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "breakpad_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "breakpad_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "capture_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "capture_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "cc_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, "test": "cc_unittests" }, { - "test": "components_browsertests" - }, - { - "test": "components_unittests" - }, - { - "test": "content_browsertests" - }, - { - "test": "content_unittests" - }, - { - "test": "device_unittests" - }, - { - "test": "events_unittests" - }, - { - "test": "gfx_unittests" - }, - { - "test": "gl_tests" - }, - { - "test": "gl_unittests" - }, - { - "test": "gpu_ipc_service_unittests" - }, - { - "test": "gpu_unittests" - }, - { - "test": "ipc_tests" - }, - { - "test": "media_blink_unittests" - }, - { - "test": "media_unittests" - }, - { - "test": "net_unittests" - }, - { - "test": "sandbox_linux_unittests" - }, - { - "test": "sql_unittests" - }, - { - "test": "storage_unittests" - }, - { - "test": "ui_android_unittests" - }, - { - "test": "ui_base_unittests" - }, - { - "test": "ui_touch_selection_unittests" - }, - { - "test": "unit_tests" - }, - { - "test": "vr_common_unittests" - } - ], - "instrumentation_tests": [ - { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 10 + }, "test": "chrome_public_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, "test": "chrome_sync_shell_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 360, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, + "test": "components_browsertests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 2 + }, + "test": "components_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 8 + }, + "test": "content_browsertests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 6 + }, "test": "content_shell_test_apk" }, { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 3 + }, + "test": "content_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "device_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "device_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "events_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "events_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gfx_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 180, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gfx_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gl_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gl_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_ipc_service_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gpu_ipc_service_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 450, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "gpu_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ipc_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ipc_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "media_blink_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": "10800", + "hard_timeout": "300", + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "media_blink_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "media_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "media_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1200, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 3 + }, + "test": "net_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sandbox_linux_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "sandbox_linux_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sql_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 60, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "sql_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "storage_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "storage_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_android_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_android_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_base_unittests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_touch_selection_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 120, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "ui_touch_selection_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 600, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 4 + }, + "test": "unit_tests" + }, + { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "vr_common_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 300, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "vr_common_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "MRA58Z", + "device_type": "flo" + } + ], + "expiration": 10800, + "hard_timeout": 1800, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ], + "shards": 6 + }, "test": "webview_instrumentation_test_apk" } ]
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index e0e086b..4f12f78 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -11788,7 +11788,7 @@ "os": "Mac-10.12" } ], - "shards": 1 + "shards": 8 } } ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index e1edb76..d038aa80 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -1769,13 +1769,26 @@ Bug(none) transforms/transformed-caret.html [ Pass Failure ] Bug(none) transforms/transformed-focused-text-input.html [ Failure ] +crbug.com/644358 compositing/force-compositing-mode/overflow-hidden-iframe-layer.html [ Failure ] crbug.com/644358 compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer-late-composite.html [ Failure ] crbug.com/644358 compositing/iframes/connect-compositing-iframe-delayed.html [ Failure ] crbug.com/644358 compositing/iframes/connect-compositing-iframe.html [ Failure ] crbug.com/644358 compositing/iframes/enter-compositing-iframe.html [ Failure ] +crbug.com/644358 compositing/iframes/repaint-after-losing-scrollbars.html [ Failure ] crbug.com/644358 compositing/squashing/squashed-layer-loses-graphicslayer.html [ Failure ] crbug.com/644358 fast/canvas/canvas-composite-video-shadow.html [ Failure ] -crbug.com/644358 paint/invalidation/video-paint-invalidation.html [ Crash ] +crbug.com/644358 fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html [ Failure ] +crbug.com/644358 fast/forms/relayout-shifts-inner-editor.html [ Failure ] +crbug.com/644358 images/color-profile-munsell-adobe-to-srgb.html [ Failure ] +crbug.com/644358 images/color-profile-munsell-srgb-to-srgb.html [ Failure ] +crbug.com/644358 paint/invalidation/justify-items-overflow-change.html [ Failure ] +crbug.com/644358 paint/invalidation/justify-self-overflow-change.html [ Failure ] +crbug.com/644358 paint/invalidation/multi-subsequence-scrolled.html [ Failure ] +crbug.com/644358 paint/invalidation/repaint-subsequence-on-ancestor-clip-change.html [ Failure ] +crbug.com/644358 paint/invalidation/svg/overflow-repaint.html [ Failure ] +crbug.com/644358 paint/invalidation/svg/svg-percent-scale-block.html [ Failure ] +crbug.com/644358 paint/invalidation/svg/svg-percent-scale-vonly.html [ Failure ] +crbug.com/644358 paint/invalidation/svg/svg-percent-scale.html [ Failure ] crbug.com/644358 paint/invalidation/table-collapsed-border.html [ Crash ] crbug.com/644358 paint/invalidation/table-cell-collapsed-border.html [ Crash ] crbug.com/644358 paint/invalidation/table/cached-change-cell-border-color.html [ Crash ] @@ -1786,6 +1799,16 @@ crbug.com/644358 paint/invalidation/table/cached-change-table-border-color.html [ Crash ] crbug.com/644358 paint/invalidation/table/cached-change-tbody-border-color.html [ Crash ] crbug.com/644358 paint/invalidation/table/collapsed-border-current-color.html [ Crash ] +crbug.com/644358 paint/invalidation/table/table-section-visual-overflow.html [ Failure ] +crbug.com/644358 paint/invalidation/video-paint-invalidation.html [ Crash ] +crbug.com/644358 svg/animations/animateMotion_changingPath.html [ Failure ] +crbug.com/644358 svg/custom/object-current-scale.html [ Failure ] +crbug.com/644358 svg/dynamic-updates/SVGTextElement-dom-transform-attr.html [ Failure ] +crbug.com/644358 svg/dynamic-updates/SVGTextElement-svgdom-transform-prop.html [ Failure ] +crbug.com/644358 svg/dynamic-updates/SVGUseElement-svgdom-href1-prop.html [ Failure ] +crbug.com/644358 svg/dynamic-updates/SVGUseElement-dom-href1-attr.html [ Failure ] +crbug.com/644358 svg/transforms/change-transform-to-none-shape.html [ Failure ] +crbug.com/644358 svg/transforms/change-transform-to-none-text.html [ Failure ] Bug(none) compositing/layer-creation/main-thread-scrolling-for-non-composited-fixed-position-if-overflow-hidden.html [ Failure ] Bug(none) compositing/layer-creation/main-thread-scrolling-for-non-composited-fixed-position.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index 4c49082..0f02144 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -63,6 +63,8 @@ crbug.com/24182 media/track/track-cues-enter-exit.html [ Slow ] crbug.com/24182 media/controls/controls-cast-do-not-fade-out.html [ Slow ] crbug.com/24182 virtual/new-remote-playback-pipeline/media/controls/controls-cast-do-not-fade-out.html [ Slow ] +crbug.com/24182 media/controls/controls-cast-overlay-slow-fade.html [ Slow ] +crbug.com/24182 virtual/new-remote-playback-pipeline/media/controls/controls-cast-overlay-slow-fade.html [ Slow ] crbug.com/24182 svg/filters/big-sized-filter.svg [ Slow ] crbug.com/24182 tables/mozilla/other/slashlogo.html [ Slow ] crbug.com/24182 virtual/gpu/fast/canvas/canvas-blend-image.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 058af07..59db9a8 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -38,7 +38,6 @@ # End whitlelisted paint invalidation tests crbug.com/596780 virtual/spv2/compositing/framesets/composited-frame-alignment.html [ Pass ] crbug.com/596780 virtual/spv2/compositing/geometry/outline-change.html [ Pass ] -crbug.com/600618 virtual/spv2/svg/custom/object-current-scale.html [ Pass ] # Re-add this once it rebaselines. # crbug.com/600618 virtual/spv2/svg/custom/object-sizing-explicit-height.xhtml [ Pass ] @@ -1378,7 +1377,7 @@ crbug.com/472330 fast/writing-mode/box-shadow-vertical-lr.html [ Failure ] crbug.com/472330 fast/writing-mode/box-shadow-vertical-rl.html [ Failure ] -crbug.com/700795 [ Mac ] inspector/animation/animation-transition-setTiming-crash.html [ Timeout Pass ] +crbug.com/700795 inspector/animation/animation-transition-setTiming-crash.html [ Timeout Pass ] # These are the failing tests because Chrome hasn't implemented according to the spec. crbug.com/645988 external/wpt/uievents/order-of-events/focus-events/focus-manual.html [ Failure ] @@ -1717,9 +1716,12 @@ crbug.com/600248 external/wpt/web-animations/interfaces/Animation/oncancel.html [ Pass Failure ] crbug.com/600248 external/wpt/web-animations/interfaces/Animation/onfinish.html [ Failure ] +crbug.com/600248 external/wpt/web-animations/interfaces/Animation/finish.html [ Pass Failure ] crbug.com/600248 external/wpt/web-animations/timing-model/animations/updating-the-finished-state.html [ Timeout ] crbug.com/600248 external/wpt/web-animations/animation-model/animation-types/interpolation-per-property.html [ Timeout ] crbug.com/600248 external/wpt/web-animations/animation-model/animation-types/addition-per-property.html [ Timeout ] +crbug.com/600248 external/wpt/web-animations/timing-model/animations/current-time.html [ Failure ] +crbug.com/600248 external/wpt/web-animations/timing-model/animations/set-the-animation-start-time.html [ Failure ] crbug.com/611658 [ Win7 ] fast/forms/text/text-font-height-mismatch.html [ Failure ] crbug.com/611658 [ Win ] fast/text/emphasis-combined-text.html [ Failure ] @@ -1796,8 +1798,6 @@ # Failing because of module-related implementation/test issues. crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-2.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-1.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-2.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-3.html [ Failure ] @@ -2859,9 +2859,17 @@ crbug.com/731018 [ Mac ] sensor/orientation-sensor.html [ Failure Pass ] crbug.com/731035 [ Win ] virtual/new-remote-playback-pipeline/media/controls/video-controls-overflow-menu-hide-on-click-panel.html [ Failure Pass ] +crbug.com/731035 [ Win ] virtual/new-remote-playback-pipeline/media/controls/controls-cast-overlay-slow-fade.html [ Failure Pass ] # More flaky tests on Mac crbug.com/731111 [ Mac ] http/tests/media/progress-events-generated-correctly.html [ Failure Pass Timeout ] crbug.com/731111 [ Mac ] http/tests/media/video-load-metadata-decode-error.html [ Failure Pass Timeout ] crbug.com/731111 [ Mac ] virtual/mojo-loading/http/tests/media/progress-events-generated-correctly.html [ Failure Pass Timeout ] crbug.com/731111 [ Mac ] virtual/mojo-loading/http/tests/media/video-load-metadata-decode-error.html [ Failure Pass Timeout ] + +# Sheriff failures 2017-06-09 +crbug.com/731518 [ Win Linux ] webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html [ Failure Pass ] + +crbug.com/731509 [ Win ] css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html [ Failure Pass Timeout ] + +crbug.com/731535 [ Win ] fast/dom/Window/window-resize-contents.html [ Failure Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/dom/interfaces-expected.txt deleted file mode 100644 index abb6980..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/interfaces-expected.txt +++ /dev/null
@@ -1,1574 +0,0 @@ -This is a testharness.js-based test. -Found 1570 tests; 1568 PASS, 2 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS Test driver -PASS Event interface: existence and properties of interface object -PASS Event interface object length -PASS Event interface object name -PASS Event interface: existence and properties of interface prototype object -PASS Event interface: existence and properties of interface prototype object's "constructor" property -PASS Event interface: attribute type -PASS Event interface: attribute target -PASS Event interface: attribute currentTarget -PASS Event interface: constant NONE on interface object -PASS Event interface: constant NONE on interface prototype object -PASS Event interface: constant CAPTURING_PHASE on interface object -PASS Event interface: constant CAPTURING_PHASE on interface prototype object -PASS Event interface: constant AT_TARGET on interface object -PASS Event interface: constant AT_TARGET on interface prototype object -PASS Event interface: constant BUBBLING_PHASE on interface object -PASS Event interface: constant BUBBLING_PHASE on interface prototype object -PASS Event interface: attribute eventPhase -PASS Event interface: operation stopPropagation() -PASS Event interface: operation stopImmediatePropagation() -PASS Event interface: attribute bubbles -PASS Event interface: attribute cancelable -PASS Event interface: operation preventDefault() -PASS Event interface: attribute defaultPrevented -PASS Event interface: attribute timeStamp -PASS Event interface: operation initEvent(DOMString,boolean,boolean) -PASS Event interface: document.createEvent("Event") must inherit property "type" with the proper type (0) -PASS Event interface: document.createEvent("Event") must inherit property "target" with the proper type (1) -PASS Event interface: document.createEvent("Event") must inherit property "currentTarget" with the proper type (2) -PASS Event interface: document.createEvent("Event") must inherit property "NONE" with the proper type (3) -PASS Event interface: document.createEvent("Event") must inherit property "CAPTURING_PHASE" with the proper type (4) -PASS Event interface: document.createEvent("Event") must inherit property "AT_TARGET" with the proper type (5) -PASS Event interface: document.createEvent("Event") must inherit property "BUBBLING_PHASE" with the proper type (6) -PASS Event interface: document.createEvent("Event") must inherit property "eventPhase" with the proper type (7) -PASS Event interface: document.createEvent("Event") must inherit property "stopPropagation" with the proper type (8) -PASS Event interface: document.createEvent("Event") must inherit property "stopImmediatePropagation" with the proper type (9) -PASS Event interface: document.createEvent("Event") must inherit property "bubbles" with the proper type (10) -PASS Event interface: document.createEvent("Event") must inherit property "cancelable" with the proper type (11) -PASS Event interface: document.createEvent("Event") must inherit property "preventDefault" with the proper type (12) -PASS Event interface: document.createEvent("Event") must inherit property "defaultPrevented" with the proper type (13) -PASS Event interface: document.createEvent("Event") must have own property "isTrusted" -PASS Event interface: document.createEvent("Event") must inherit property "timeStamp" with the proper type (15) -PASS Event interface: document.createEvent("Event") must inherit property "initEvent" with the proper type (16) -PASS Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError -PASS Event interface: new Event("foo") must inherit property "type" with the proper type (0) -PASS Event interface: new Event("foo") must inherit property "target" with the proper type (1) -PASS Event interface: new Event("foo") must inherit property "currentTarget" with the proper type (2) -PASS Event interface: new Event("foo") must inherit property "NONE" with the proper type (3) -PASS Event interface: new Event("foo") must inherit property "CAPTURING_PHASE" with the proper type (4) -PASS Event interface: new Event("foo") must inherit property "AT_TARGET" with the proper type (5) -PASS Event interface: new Event("foo") must inherit property "BUBBLING_PHASE" with the proper type (6) -PASS Event interface: new Event("foo") must inherit property "eventPhase" with the proper type (7) -PASS Event interface: new Event("foo") must inherit property "stopPropagation" with the proper type (8) -PASS Event interface: new Event("foo") must inherit property "stopImmediatePropagation" with the proper type (9) -PASS Event interface: new Event("foo") must inherit property "bubbles" with the proper type (10) -PASS Event interface: new Event("foo") must inherit property "cancelable" with the proper type (11) -PASS Event interface: new Event("foo") must inherit property "preventDefault" with the proper type (12) -PASS Event interface: new Event("foo") must inherit property "defaultPrevented" with the proper type (13) -PASS Event interface: new Event("foo") must have own property "isTrusted" -PASS Event interface: new Event("foo") must inherit property "timeStamp" with the proper type (15) -PASS Event interface: new Event("foo") must inherit property "initEvent" with the proper type (16) -PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError -PASS CustomEvent interface: existence and properties of interface object -PASS CustomEvent interface object length -PASS CustomEvent interface object name -PASS CustomEvent interface: existence and properties of interface prototype object -PASS CustomEvent interface: existence and properties of interface prototype object's "constructor" property -PASS CustomEvent interface: attribute detail -PASS CustomEvent interface: operation initCustomEvent(DOMString,boolean,boolean,any) -PASS CustomEvent interface: new CustomEvent("foo") must inherit property "detail" with the proper type (0) -PASS CustomEvent interface: new CustomEvent("foo") must inherit property "initCustomEvent" with the proper type (1) -PASS CustomEvent interface: calling initCustomEvent(DOMString,boolean,boolean,any) on new CustomEvent("foo") with too few arguments must throw TypeError -PASS Event interface: new CustomEvent("foo") must inherit property "type" with the proper type (0) -PASS Event interface: new CustomEvent("foo") must inherit property "target" with the proper type (1) -PASS Event interface: new CustomEvent("foo") must inherit property "currentTarget" with the proper type (2) -PASS Event interface: new CustomEvent("foo") must inherit property "NONE" with the proper type (3) -PASS Event interface: new CustomEvent("foo") must inherit property "CAPTURING_PHASE" with the proper type (4) -PASS Event interface: new CustomEvent("foo") must inherit property "AT_TARGET" with the proper type (5) -PASS Event interface: new CustomEvent("foo") must inherit property "BUBBLING_PHASE" with the proper type (6) -PASS Event interface: new CustomEvent("foo") must inherit property "eventPhase" with the proper type (7) -PASS Event interface: new CustomEvent("foo") must inherit property "stopPropagation" with the proper type (8) -PASS Event interface: new CustomEvent("foo") must inherit property "stopImmediatePropagation" with the proper type (9) -PASS Event interface: new CustomEvent("foo") must inherit property "bubbles" with the proper type (10) -PASS Event interface: new CustomEvent("foo") must inherit property "cancelable" with the proper type (11) -PASS Event interface: new CustomEvent("foo") must inherit property "preventDefault" with the proper type (12) -PASS Event interface: new CustomEvent("foo") must inherit property "defaultPrevented" with the proper type (13) -PASS Event interface: new CustomEvent("foo") must have own property "isTrusted" -PASS Event interface: new CustomEvent("foo") must inherit property "timeStamp" with the proper type (15) -PASS Event interface: new CustomEvent("foo") must inherit property "initEvent" with the proper type (16) -PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError -PASS EventTarget interface: existence and properties of interface object -PASS EventTarget interface object length -PASS EventTarget interface object name -PASS EventTarget interface: existence and properties of interface prototype object -PASS EventTarget interface: existence and properties of interface prototype object's "constructor" property -PASS EventTarget interface: operation addEventListener(DOMString,EventListener,[object Object],[object Object]) -PASS EventTarget interface: operation removeEventListener(DOMString,EventListener,[object Object],[object Object]) -PASS EventTarget interface: operation dispatchEvent(Event) -PASS EventListener interface: existence and properties of interface object -PASS EventListener interface: existence and properties of interface prototype object -PASS EventListener interface: existence and properties of interface prototype object's "constructor" property -PASS EventListener interface: operation handleEvent(Event) -PASS NodeList interface: existence and properties of interface object -PASS NodeList interface object length -PASS NodeList interface object name -PASS NodeList interface: existence and properties of interface prototype object -PASS NodeList interface: existence and properties of interface prototype object's "constructor" property -PASS NodeList interface: operation item(unsigned long) -PASS NodeList interface: attribute length -PASS NodeList interface: document.querySelectorAll("script") must inherit property "item" with the proper type (0) -PASS NodeList interface: calling item(unsigned long) on document.querySelectorAll("script") with too few arguments must throw TypeError -PASS NodeList interface: document.querySelectorAll("script") must inherit property "length" with the proper type (1) -PASS HTMLCollection interface: existence and properties of interface object -PASS HTMLCollection interface object length -PASS HTMLCollection interface object name -PASS HTMLCollection interface: existence and properties of interface prototype object -PASS HTMLCollection interface: existence and properties of interface prototype object's "constructor" property -PASS HTMLCollection interface: attribute length -PASS HTMLCollection interface: operation item(unsigned long) -PASS HTMLCollection interface: operation namedItem(DOMString) -PASS HTMLCollection interface: document.body.children must inherit property "length" with the proper type (0) -PASS HTMLCollection interface: document.body.children must inherit property "item" with the proper type (1) -PASS HTMLCollection interface: calling item(unsigned long) on document.body.children with too few arguments must throw TypeError -PASS HTMLCollection interface: document.body.children must inherit property "namedItem" with the proper type (2) -PASS HTMLCollection interface: calling namedItem(DOMString) on document.body.children with too few arguments must throw TypeError -PASS MutationObserver interface: existence and properties of interface object -PASS MutationObserver interface object length -PASS MutationObserver interface object name -PASS MutationObserver interface: existence and properties of interface prototype object -PASS MutationObserver interface: existence and properties of interface prototype object's "constructor" property -PASS MutationObserver interface: operation observe(Node,MutationObserverInit) -PASS MutationObserver interface: operation disconnect() -PASS MutationObserver interface: operation takeRecords() -PASS MutationRecord interface: existence and properties of interface object -PASS MutationRecord interface object length -PASS MutationRecord interface object name -PASS MutationRecord interface: existence and properties of interface prototype object -PASS MutationRecord interface: existence and properties of interface prototype object's "constructor" property -PASS MutationRecord interface: attribute type -PASS MutationRecord interface: attribute target -PASS MutationRecord interface: attribute addedNodes -PASS MutationRecord interface: attribute removedNodes -PASS MutationRecord interface: attribute previousSibling -PASS MutationRecord interface: attribute nextSibling -PASS MutationRecord interface: attribute attributeName -PASS MutationRecord interface: attribute attributeNamespace -PASS MutationRecord interface: attribute oldValue -PASS Node interface: existence and properties of interface object -PASS Node interface object length -PASS Node interface object name -PASS Node interface: existence and properties of interface prototype object -PASS Node interface: existence and properties of interface prototype object's "constructor" property -PASS Node interface: constant ELEMENT_NODE on interface object -PASS Node interface: constant ELEMENT_NODE on interface prototype object -PASS Node interface: constant ATTRIBUTE_NODE on interface object -PASS Node interface: constant ATTRIBUTE_NODE on interface prototype object -PASS Node interface: constant TEXT_NODE on interface object -PASS Node interface: constant TEXT_NODE on interface prototype object -PASS Node interface: constant CDATA_SECTION_NODE on interface object -PASS Node interface: constant CDATA_SECTION_NODE on interface prototype object -PASS Node interface: constant ENTITY_REFERENCE_NODE on interface object -PASS Node interface: constant ENTITY_REFERENCE_NODE on interface prototype object -PASS Node interface: constant ENTITY_NODE on interface object -PASS Node interface: constant ENTITY_NODE on interface prototype object -PASS Node interface: constant PROCESSING_INSTRUCTION_NODE on interface object -PASS Node interface: constant PROCESSING_INSTRUCTION_NODE on interface prototype object -PASS Node interface: constant COMMENT_NODE on interface object -PASS Node interface: constant COMMENT_NODE on interface prototype object -PASS Node interface: constant DOCUMENT_NODE on interface object -PASS Node interface: constant DOCUMENT_NODE on interface prototype object -PASS Node interface: constant DOCUMENT_TYPE_NODE on interface object -PASS Node interface: constant DOCUMENT_TYPE_NODE on interface prototype object -PASS Node interface: constant DOCUMENT_FRAGMENT_NODE on interface object -PASS Node interface: constant DOCUMENT_FRAGMENT_NODE on interface prototype object -PASS Node interface: constant NOTATION_NODE on interface object -PASS Node interface: constant NOTATION_NODE on interface prototype object -PASS Node interface: attribute nodeType -PASS Node interface: attribute nodeName -PASS Node interface: attribute baseURI -PASS Node interface: attribute isConnected -PASS Node interface: attribute ownerDocument -PASS Node interface: operation getRootNode(GetRootNodeOptions) -PASS Node interface: attribute parentNode -PASS Node interface: attribute parentElement -PASS Node interface: operation hasChildNodes() -PASS Node interface: attribute childNodes -PASS Node interface: attribute firstChild -PASS Node interface: attribute lastChild -PASS Node interface: attribute previousSibling -PASS Node interface: attribute nextSibling -PASS Node interface: attribute nodeValue -PASS Node interface: attribute textContent -PASS Node interface: operation normalize() -PASS Node interface: operation cloneNode(boolean) -PASS Node interface: operation isEqualNode(Node) -PASS Node interface: operation isSameNode(Node) -PASS Node interface: constant DOCUMENT_POSITION_DISCONNECTED on interface object -PASS Node interface: constant DOCUMENT_POSITION_DISCONNECTED on interface prototype object -PASS Node interface: constant DOCUMENT_POSITION_PRECEDING on interface object -PASS Node interface: constant DOCUMENT_POSITION_PRECEDING on interface prototype object -PASS Node interface: constant DOCUMENT_POSITION_FOLLOWING on interface object -PASS Node interface: constant DOCUMENT_POSITION_FOLLOWING on interface prototype object -PASS Node interface: constant DOCUMENT_POSITION_CONTAINS on interface object -PASS Node interface: constant DOCUMENT_POSITION_CONTAINS on interface prototype object -PASS Node interface: constant DOCUMENT_POSITION_CONTAINED_BY on interface object -PASS Node interface: constant DOCUMENT_POSITION_CONTAINED_BY on interface prototype object -PASS Node interface: constant DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC on interface object -PASS Node interface: constant DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC on interface prototype object -PASS Node interface: operation compareDocumentPosition(Node) -PASS Node interface: operation contains(Node) -PASS Node interface: operation lookupPrefix(DOMString) -PASS Node interface: operation lookupNamespaceURI(DOMString) -PASS Node interface: operation isDefaultNamespace(DOMString) -PASS Node interface: operation insertBefore(Node,Node) -PASS Node interface: operation appendChild(Node) -PASS Node interface: operation replaceChild(Node,Node) -PASS Node interface: operation removeChild(Node) -PASS Document interface: existence and properties of interface object -PASS Document interface object length -PASS Document interface object name -PASS Document interface: existence and properties of interface prototype object -PASS Document interface: existence and properties of interface prototype object's "constructor" property -PASS Document interface: attribute implementation -PASS Document interface: attribute URL -PASS Document interface: attribute documentURI -PASS Document interface: attribute origin -PASS Document interface: attribute compatMode -PASS Document interface: attribute characterSet -PASS Document interface: attribute charset -PASS Document interface: attribute inputEncoding -PASS Document interface: attribute contentType -PASS Document interface: attribute doctype -PASS Document interface: attribute documentElement -PASS Document interface: operation getElementsByTagName(DOMString) -PASS Document interface: operation getElementsByTagNameNS(DOMString,DOMString) -PASS Document interface: operation getElementsByClassName(DOMString) -PASS Document interface: operation createElement(DOMString,ElementCreationOptions) -PASS Document interface: operation createElementNS(DOMString,DOMString,ElementCreationOptions) -PASS Document interface: operation createDocumentFragment() -PASS Document interface: operation createTextNode(DOMString) -PASS Document interface: operation createCDATASection(DOMString) -PASS Document interface: operation createComment(DOMString) -PASS Document interface: operation createProcessingInstruction(DOMString,DOMString) -PASS Document interface: operation importNode(Node,boolean) -PASS Document interface: operation adoptNode(Node) -PASS Document interface: operation createAttribute(DOMString) -PASS Document interface: operation createAttributeNS(DOMString,DOMString) -PASS Document interface: operation createEvent(DOMString) -PASS Document interface: operation createRange() -PASS Document interface: operation createNodeIterator(Node,unsigned long,NodeFilter) -PASS Document interface: operation createTreeWalker(Node,unsigned long,NodeFilter) -PASS Document interface: operation getElementById(DOMString) -PASS Document interface: attribute children -PASS Document interface: attribute firstElementChild -PASS Document interface: attribute lastElementChild -PASS Document interface: attribute childElementCount -PASS Document interface: operation prepend([object Object],[object Object]) -PASS Document interface: operation append([object Object],[object Object]) -PASS Document interface: operation querySelector(DOMString) -PASS Document interface: operation querySelectorAll(DOMString) -PASS Document interface: new Document() must inherit property "implementation" with the proper type (0) -PASS Document interface: new Document() must inherit property "URL" with the proper type (1) -PASS Document interface: new Document() must inherit property "documentURI" with the proper type (2) -PASS Document interface: new Document() must inherit property "origin" with the proper type (3) -PASS Document interface: new Document() must inherit property "compatMode" with the proper type (4) -PASS Document interface: new Document() must inherit property "characterSet" with the proper type (5) -PASS Document interface: new Document() must inherit property "charset" with the proper type (6) -PASS Document interface: new Document() must inherit property "inputEncoding" with the proper type (7) -PASS Document interface: new Document() must inherit property "contentType" with the proper type (8) -PASS Document interface: new Document() must inherit property "doctype" with the proper type (9) -PASS Document interface: new Document() must inherit property "documentElement" with the proper type (10) -PASS Document interface: new Document() must inherit property "getElementsByTagName" with the proper type (11) -PASS Document interface: calling getElementsByTagName(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "getElementsByTagNameNS" with the proper type (12) -PASS Document interface: calling getElementsByTagNameNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "getElementsByClassName" with the proper type (13) -PASS Document interface: calling getElementsByClassName(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createElement" with the proper type (14) -PASS Document interface: calling createElement(DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createElementNS" with the proper type (15) -PASS Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createDocumentFragment" with the proper type (16) -PASS Document interface: new Document() must inherit property "createTextNode" with the proper type (17) -PASS Document interface: calling createTextNode(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createCDATASection" with the proper type (18) -PASS Document interface: calling createCDATASection(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createComment" with the proper type (19) -PASS Document interface: calling createComment(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createProcessingInstruction" with the proper type (20) -PASS Document interface: calling createProcessingInstruction(DOMString,DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "importNode" with the proper type (21) -PASS Document interface: calling importNode(Node,boolean) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "adoptNode" with the proper type (22) -PASS Document interface: calling adoptNode(Node) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createAttribute" with the proper type (23) -PASS Document interface: calling createAttribute(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (24) -PASS Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createEvent" with the proper type (25) -PASS Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createRange" with the proper type (26) -PASS Document interface: new Document() must inherit property "createNodeIterator" with the proper type (27) -PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "createTreeWalker" with the proper type (28) -PASS Document interface: calling createTreeWalker(Node,unsigned long,NodeFilter) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "getElementById" with the proper type (29) -PASS Document interface: calling getElementById(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "children" with the proper type (30) -PASS Document interface: new Document() must inherit property "firstElementChild" with the proper type (31) -PASS Document interface: new Document() must inherit property "lastElementChild" with the proper type (32) -PASS Document interface: new Document() must inherit property "childElementCount" with the proper type (33) -PASS Document interface: new Document() must inherit property "prepend" with the proper type (34) -PASS Document interface: calling prepend([object Object],[object Object]) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "append" with the proper type (35) -PASS Document interface: calling append([object Object],[object Object]) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "querySelector" with the proper type (36) -PASS Document interface: calling querySelector(DOMString) on new Document() with too few arguments must throw TypeError -PASS Document interface: new Document() must inherit property "querySelectorAll" with the proper type (37) -PASS Document interface: calling querySelectorAll(DOMString) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: new Document() must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: new Document() must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: new Document() must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: new Document() must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: new Document() must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: new Document() must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: new Document() must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: new Document() must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: new Document() must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: new Document() must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: new Document() must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: new Document() must inherit property "nodeType" with the proper type (12) -PASS Node interface: new Document() must inherit property "nodeName" with the proper type (13) -PASS Node interface: new Document() must inherit property "baseURI" with the proper type (14) -PASS Node interface: new Document() must inherit property "isConnected" with the proper type (15) -PASS Node interface: new Document() must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: new Document() must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "parentNode" with the proper type (18) -PASS Node interface: new Document() must inherit property "parentElement" with the proper type (19) -PASS Node interface: new Document() must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: new Document() must inherit property "childNodes" with the proper type (21) -PASS Node interface: new Document() must inherit property "firstChild" with the proper type (22) -PASS Node interface: new Document() must inherit property "lastChild" with the proper type (23) -PASS Node interface: new Document() must inherit property "previousSibling" with the proper type (24) -PASS Node interface: new Document() must inherit property "nextSibling" with the proper type (25) -PASS Node interface: new Document() must inherit property "nodeValue" with the proper type (26) -PASS Node interface: new Document() must inherit property "textContent" with the proper type (27) -PASS Node interface: new Document() must inherit property "normalize" with the proper type (28) -PASS Node interface: new Document() must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: new Document() must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: new Document() must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: new Document() must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: new Document() must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: new Document() must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: new Document() must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on new Document() with too few arguments must throw TypeError -PASS Node interface: new Document() must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on new Document() with too few arguments must throw TypeError -PASS EventTarget interface: new Document() must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on new Document() with too few arguments must throw TypeError -PASS EventTarget interface: new Document() must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on new Document() with too few arguments must throw TypeError -PASS EventTarget interface: new Document() must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on new Document() with too few arguments must throw TypeError -PASS XMLDocument interface: existence and properties of interface object -PASS XMLDocument interface object length -PASS XMLDocument interface object name -PASS XMLDocument interface: existence and properties of interface prototype object -PASS XMLDocument interface: existence and properties of interface prototype object's "constructor" property -PASS Document interface: xmlDoc must inherit property "implementation" with the proper type (0) -PASS Document interface: xmlDoc must inherit property "URL" with the proper type (1) -PASS Document interface: xmlDoc must inherit property "documentURI" with the proper type (2) -PASS Document interface: xmlDoc must inherit property "origin" with the proper type (3) -PASS Document interface: xmlDoc must inherit property "compatMode" with the proper type (4) -PASS Document interface: xmlDoc must inherit property "characterSet" with the proper type (5) -PASS Document interface: xmlDoc must inherit property "charset" with the proper type (6) -PASS Document interface: xmlDoc must inherit property "inputEncoding" with the proper type (7) -PASS Document interface: xmlDoc must inherit property "contentType" with the proper type (8) -PASS Document interface: xmlDoc must inherit property "doctype" with the proper type (9) -PASS Document interface: xmlDoc must inherit property "documentElement" with the proper type (10) -PASS Document interface: xmlDoc must inherit property "getElementsByTagName" with the proper type (11) -PASS Document interface: calling getElementsByTagName(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "getElementsByTagNameNS" with the proper type (12) -PASS Document interface: calling getElementsByTagNameNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "getElementsByClassName" with the proper type (13) -PASS Document interface: calling getElementsByClassName(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createElement" with the proper type (14) -PASS Document interface: calling createElement(DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createElementNS" with the proper type (15) -PASS Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createDocumentFragment" with the proper type (16) -PASS Document interface: xmlDoc must inherit property "createTextNode" with the proper type (17) -PASS Document interface: calling createTextNode(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createCDATASection" with the proper type (18) -PASS Document interface: calling createCDATASection(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createComment" with the proper type (19) -PASS Document interface: calling createComment(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createProcessingInstruction" with the proper type (20) -PASS Document interface: calling createProcessingInstruction(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "importNode" with the proper type (21) -PASS Document interface: calling importNode(Node,boolean) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "adoptNode" with the proper type (22) -PASS Document interface: calling adoptNode(Node) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createAttribute" with the proper type (23) -PASS Document interface: calling createAttribute(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createAttributeNS" with the proper type (24) -PASS Document interface: calling createAttributeNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createEvent" with the proper type (25) -PASS Document interface: calling createEvent(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createRange" with the proper type (26) -PASS Document interface: xmlDoc must inherit property "createNodeIterator" with the proper type (27) -PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "createTreeWalker" with the proper type (28) -PASS Document interface: calling createTreeWalker(Node,unsigned long,NodeFilter) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "getElementById" with the proper type (29) -PASS Document interface: calling getElementById(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "children" with the proper type (30) -PASS Document interface: xmlDoc must inherit property "firstElementChild" with the proper type (31) -PASS Document interface: xmlDoc must inherit property "lastElementChild" with the proper type (32) -PASS Document interface: xmlDoc must inherit property "childElementCount" with the proper type (33) -PASS Document interface: xmlDoc must inherit property "prepend" with the proper type (34) -PASS Document interface: calling prepend([object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "append" with the proper type (35) -PASS Document interface: calling append([object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "querySelector" with the proper type (36) -PASS Document interface: calling querySelector(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Document interface: xmlDoc must inherit property "querySelectorAll" with the proper type (37) -PASS Document interface: calling querySelectorAll(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: xmlDoc must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: xmlDoc must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: xmlDoc must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: xmlDoc must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: xmlDoc must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: xmlDoc must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: xmlDoc must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: xmlDoc must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: xmlDoc must inherit property "nodeType" with the proper type (12) -PASS Node interface: xmlDoc must inherit property "nodeName" with the proper type (13) -PASS Node interface: xmlDoc must inherit property "baseURI" with the proper type (14) -PASS Node interface: xmlDoc must inherit property "isConnected" with the proper type (15) -PASS Node interface: xmlDoc must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: xmlDoc must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "parentNode" with the proper type (18) -PASS Node interface: xmlDoc must inherit property "parentElement" with the proper type (19) -PASS Node interface: xmlDoc must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: xmlDoc must inherit property "childNodes" with the proper type (21) -PASS Node interface: xmlDoc must inherit property "firstChild" with the proper type (22) -PASS Node interface: xmlDoc must inherit property "lastChild" with the proper type (23) -PASS Node interface: xmlDoc must inherit property "previousSibling" with the proper type (24) -PASS Node interface: xmlDoc must inherit property "nextSibling" with the proper type (25) -PASS Node interface: xmlDoc must inherit property "nodeValue" with the proper type (26) -PASS Node interface: xmlDoc must inherit property "textContent" with the proper type (27) -PASS Node interface: xmlDoc must inherit property "normalize" with the proper type (28) -PASS Node interface: xmlDoc must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: xmlDoc must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: xmlDoc must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on xmlDoc with too few arguments must throw TypeError -PASS Node interface: xmlDoc must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on xmlDoc with too few arguments must throw TypeError -PASS EventTarget interface: xmlDoc must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError -PASS EventTarget interface: xmlDoc must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError -PASS EventTarget interface: xmlDoc must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on xmlDoc with too few arguments must throw TypeError -PASS DOMImplementation interface: existence and properties of interface object -PASS DOMImplementation interface object length -PASS DOMImplementation interface object name -PASS DOMImplementation interface: existence and properties of interface prototype object -PASS DOMImplementation interface: existence and properties of interface prototype object's "constructor" property -PASS DOMImplementation interface: operation createDocumentType(DOMString,DOMString,DOMString) -PASS DOMImplementation interface: operation createDocument(DOMString,DOMString,DocumentType) -PASS DOMImplementation interface: operation createHTMLDocument(DOMString) -PASS DOMImplementation interface: operation hasFeature() -PASS DOMImplementation interface: document.implementation must inherit property "createDocumentType" with the proper type (0) -PASS DOMImplementation interface: calling createDocumentType(DOMString,DOMString,DOMString) on document.implementation with too few arguments must throw TypeError -PASS DOMImplementation interface: document.implementation must inherit property "createDocument" with the proper type (1) -PASS DOMImplementation interface: calling createDocument(DOMString,DOMString,DocumentType) on document.implementation with too few arguments must throw TypeError -PASS DOMImplementation interface: document.implementation must inherit property "createHTMLDocument" with the proper type (2) -PASS DOMImplementation interface: calling createHTMLDocument(DOMString) on document.implementation with too few arguments must throw TypeError -PASS DOMImplementation interface: document.implementation must inherit property "hasFeature" with the proper type (3) -PASS DocumentType interface: existence and properties of interface object -PASS DocumentType interface object length -PASS DocumentType interface object name -PASS DocumentType interface: existence and properties of interface prototype object -PASS DocumentType interface: existence and properties of interface prototype object's "constructor" property -PASS DocumentType interface: attribute name -PASS DocumentType interface: attribute publicId -PASS DocumentType interface: attribute systemId -PASS DocumentType interface: operation before([object Object],[object Object]) -PASS DocumentType interface: operation after([object Object],[object Object]) -PASS DocumentType interface: operation replaceWith([object Object],[object Object]) -PASS DocumentType interface: operation remove() -PASS DocumentType interface: document.doctype must inherit property "name" with the proper type (0) -PASS DocumentType interface: document.doctype must inherit property "publicId" with the proper type (1) -PASS DocumentType interface: document.doctype must inherit property "systemId" with the proper type (2) -PASS DocumentType interface: document.doctype must inherit property "before" with the proper type (3) -PASS DocumentType interface: calling before([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError -PASS DocumentType interface: document.doctype must inherit property "after" with the proper type (4) -PASS DocumentType interface: calling after([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError -PASS DocumentType interface: document.doctype must inherit property "replaceWith" with the proper type (5) -PASS DocumentType interface: calling replaceWith([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError -PASS DocumentType interface: document.doctype must inherit property "remove" with the proper type (6) -PASS Node interface: document.doctype must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: document.doctype must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: document.doctype must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: document.doctype must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: document.doctype must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: document.doctype must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: document.doctype must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: document.doctype must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: document.doctype must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: document.doctype must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: document.doctype must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: document.doctype must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: document.doctype must inherit property "nodeType" with the proper type (12) -PASS Node interface: document.doctype must inherit property "nodeName" with the proper type (13) -PASS Node interface: document.doctype must inherit property "baseURI" with the proper type (14) -PASS Node interface: document.doctype must inherit property "isConnected" with the proper type (15) -PASS Node interface: document.doctype must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: document.doctype must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "parentNode" with the proper type (18) -PASS Node interface: document.doctype must inherit property "parentElement" with the proper type (19) -PASS Node interface: document.doctype must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: document.doctype must inherit property "childNodes" with the proper type (21) -PASS Node interface: document.doctype must inherit property "firstChild" with the proper type (22) -PASS Node interface: document.doctype must inherit property "lastChild" with the proper type (23) -PASS Node interface: document.doctype must inherit property "previousSibling" with the proper type (24) -PASS Node interface: document.doctype must inherit property "nextSibling" with the proper type (25) -PASS Node interface: document.doctype must inherit property "nodeValue" with the proper type (26) -PASS Node interface: document.doctype must inherit property "textContent" with the proper type (27) -PASS Node interface: document.doctype must inherit property "normalize" with the proper type (28) -PASS Node interface: document.doctype must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: document.doctype must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: document.doctype must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: document.doctype must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: document.doctype must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: document.doctype must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: document.doctype must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on document.doctype with too few arguments must throw TypeError -PASS Node interface: document.doctype must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on document.doctype with too few arguments must throw TypeError -PASS EventTarget interface: document.doctype must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.doctype with too few arguments must throw TypeError -PASS EventTarget interface: document.doctype must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.doctype with too few arguments must throw TypeError -PASS EventTarget interface: document.doctype must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on document.doctype with too few arguments must throw TypeError -PASS DocumentFragment interface: existence and properties of interface object -PASS DocumentFragment interface object length -PASS DocumentFragment interface object name -PASS DocumentFragment interface: existence and properties of interface prototype object -PASS DocumentFragment interface: existence and properties of interface prototype object's "constructor" property -PASS DocumentFragment interface: operation getElementById(DOMString) -PASS DocumentFragment interface: attribute children -PASS DocumentFragment interface: attribute firstElementChild -PASS DocumentFragment interface: attribute lastElementChild -PASS DocumentFragment interface: attribute childElementCount -PASS DocumentFragment interface: operation prepend([object Object],[object Object]) -PASS DocumentFragment interface: operation append([object Object],[object Object]) -PASS DocumentFragment interface: operation querySelector(DOMString) -PASS DocumentFragment interface: operation querySelectorAll(DOMString) -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "getElementById" with the proper type (0) -PASS DocumentFragment interface: calling getElementById(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "children" with the proper type (1) -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "firstElementChild" with the proper type (2) -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "lastElementChild" with the proper type (3) -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "childElementCount" with the proper type (4) -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "prepend" with the proper type (5) -PASS DocumentFragment interface: calling prepend([object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "append" with the proper type (6) -PASS DocumentFragment interface: calling append([object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "querySelector" with the proper type (7) -PASS DocumentFragment interface: calling querySelector(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS DocumentFragment interface: document.createDocumentFragment() must inherit property "querySelectorAll" with the proper type (8) -PASS DocumentFragment interface: calling querySelectorAll(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: document.createDocumentFragment() must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: document.createDocumentFragment() must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: document.createDocumentFragment() must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: document.createDocumentFragment() must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: document.createDocumentFragment() must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: document.createDocumentFragment() must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: document.createDocumentFragment() must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: document.createDocumentFragment() must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: document.createDocumentFragment() must inherit property "nodeType" with the proper type (12) -PASS Node interface: document.createDocumentFragment() must inherit property "nodeName" with the proper type (13) -PASS Node interface: document.createDocumentFragment() must inherit property "baseURI" with the proper type (14) -PASS Node interface: document.createDocumentFragment() must inherit property "isConnected" with the proper type (15) -PASS Node interface: document.createDocumentFragment() must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: document.createDocumentFragment() must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "parentNode" with the proper type (18) -PASS Node interface: document.createDocumentFragment() must inherit property "parentElement" with the proper type (19) -PASS Node interface: document.createDocumentFragment() must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: document.createDocumentFragment() must inherit property "childNodes" with the proper type (21) -PASS Node interface: document.createDocumentFragment() must inherit property "firstChild" with the proper type (22) -PASS Node interface: document.createDocumentFragment() must inherit property "lastChild" with the proper type (23) -PASS Node interface: document.createDocumentFragment() must inherit property "previousSibling" with the proper type (24) -PASS Node interface: document.createDocumentFragment() must inherit property "nextSibling" with the proper type (25) -PASS Node interface: document.createDocumentFragment() must inherit property "nodeValue" with the proper type (26) -PASS Node interface: document.createDocumentFragment() must inherit property "textContent" with the proper type (27) -PASS Node interface: document.createDocumentFragment() must inherit property "normalize" with the proper type (28) -PASS Node interface: document.createDocumentFragment() must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: document.createDocumentFragment() must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: document.createDocumentFragment() must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS Node interface: document.createDocumentFragment() must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS EventTarget interface: document.createDocumentFragment() must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS EventTarget interface: document.createDocumentFragment() must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS EventTarget interface: document.createDocumentFragment() must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on document.createDocumentFragment() with too few arguments must throw TypeError -PASS ShadowRoot interface: existence and properties of interface object -PASS ShadowRoot interface object length -PASS ShadowRoot interface object name -PASS ShadowRoot interface: existence and properties of interface prototype object -PASS ShadowRoot interface: existence and properties of interface prototype object's "constructor" property -PASS ShadowRoot interface: attribute mode -PASS ShadowRoot interface: attribute host -PASS Element interface: existence and properties of interface object -PASS Element interface object length -PASS Element interface object name -PASS Element interface: existence and properties of interface prototype object -PASS Element interface: existence and properties of interface prototype object's "constructor" property -PASS Element interface: attribute namespaceURI -PASS Element interface: attribute prefix -PASS Element interface: attribute localName -PASS Element interface: attribute tagName -PASS Element interface: attribute id -PASS Element interface: attribute className -PASS Element interface: attribute classList -PASS Element interface: attribute slot -PASS Element interface: operation hasAttributes() -PASS Element interface: attribute attributes -FAIL Element interface: operation getAttributeNames() assert_own_property: interface prototype object missing non-static operation expected property "getAttributeNames" missing -PASS Element interface: operation getAttribute(DOMString) -PASS Element interface: operation getAttributeNS(DOMString,DOMString) -PASS Element interface: operation setAttribute(DOMString,DOMString) -PASS Element interface: operation setAttributeNS(DOMString,DOMString,DOMString) -PASS Element interface: operation removeAttribute(DOMString) -PASS Element interface: operation removeAttributeNS(DOMString,DOMString) -PASS Element interface: operation hasAttribute(DOMString) -PASS Element interface: operation hasAttributeNS(DOMString,DOMString) -PASS Element interface: operation getAttributeNode(DOMString) -PASS Element interface: operation getAttributeNodeNS(DOMString,DOMString) -PASS Element interface: operation setAttributeNode(Attr) -PASS Element interface: operation setAttributeNodeNS(Attr) -PASS Element interface: operation removeAttributeNode(Attr) -PASS Element interface: operation attachShadow(ShadowRootInit) -PASS Element interface: attribute shadowRoot -PASS Element interface: operation closest(DOMString) -PASS Element interface: operation matches(DOMString) -PASS Element interface: operation webkitMatchesSelector(DOMString) -PASS Element interface: operation getElementsByTagName(DOMString) -PASS Element interface: operation getElementsByTagNameNS(DOMString,DOMString) -PASS Element interface: operation getElementsByClassName(DOMString) -PASS Element interface: operation insertAdjacentElement(DOMString,Element) -PASS Element interface: operation insertAdjacentText(DOMString,DOMString) -PASS Element interface: attribute children -PASS Element interface: attribute firstElementChild -PASS Element interface: attribute lastElementChild -PASS Element interface: attribute childElementCount -PASS Element interface: operation prepend([object Object],[object Object]) -PASS Element interface: operation append([object Object],[object Object]) -PASS Element interface: operation querySelector(DOMString) -PASS Element interface: operation querySelectorAll(DOMString) -PASS Element interface: attribute previousElementSibling -PASS Element interface: attribute nextElementSibling -PASS Element interface: operation before([object Object],[object Object]) -PASS Element interface: operation after([object Object],[object Object]) -PASS Element interface: operation replaceWith([object Object],[object Object]) -PASS Element interface: operation remove() -PASS Element interface: attribute assignedSlot -PASS Element interface: element must inherit property "namespaceURI" with the proper type (0) -PASS Element interface: element must inherit property "prefix" with the proper type (1) -PASS Element interface: element must inherit property "localName" with the proper type (2) -PASS Element interface: element must inherit property "tagName" with the proper type (3) -PASS Element interface: element must inherit property "id" with the proper type (4) -PASS Element interface: element must inherit property "className" with the proper type (5) -PASS Element interface: element must inherit property "classList" with the proper type (6) -PASS Element interface: element must inherit property "slot" with the proper type (7) -PASS Element interface: element must inherit property "hasAttributes" with the proper type (8) -PASS Element interface: element must inherit property "attributes" with the proper type (9) -FAIL Element interface: element must inherit property "getAttributeNames" with the proper type (10) assert_inherits: property "getAttributeNames" not found in prototype chain -PASS Element interface: element must inherit property "getAttribute" with the proper type (11) -PASS Element interface: calling getAttribute(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "getAttributeNS" with the proper type (12) -PASS Element interface: calling getAttributeNS(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "setAttribute" with the proper type (13) -PASS Element interface: calling setAttribute(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "setAttributeNS" with the proper type (14) -PASS Element interface: calling setAttributeNS(DOMString,DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "removeAttribute" with the proper type (15) -PASS Element interface: calling removeAttribute(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "removeAttributeNS" with the proper type (16) -PASS Element interface: calling removeAttributeNS(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "hasAttribute" with the proper type (17) -PASS Element interface: calling hasAttribute(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "hasAttributeNS" with the proper type (18) -PASS Element interface: calling hasAttributeNS(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "getAttributeNode" with the proper type (19) -PASS Element interface: calling getAttributeNode(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "getAttributeNodeNS" with the proper type (20) -PASS Element interface: calling getAttributeNodeNS(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "setAttributeNode" with the proper type (21) -PASS Element interface: calling setAttributeNode(Attr) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "setAttributeNodeNS" with the proper type (22) -PASS Element interface: calling setAttributeNodeNS(Attr) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "removeAttributeNode" with the proper type (23) -PASS Element interface: calling removeAttributeNode(Attr) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "attachShadow" with the proper type (24) -PASS Element interface: calling attachShadow(ShadowRootInit) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "shadowRoot" with the proper type (25) -PASS Element interface: element must inherit property "closest" with the proper type (26) -PASS Element interface: calling closest(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "matches" with the proper type (27) -PASS Element interface: calling matches(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "webkitMatchesSelector" with the proper type (28) -PASS Element interface: calling webkitMatchesSelector(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "getElementsByTagName" with the proper type (29) -PASS Element interface: calling getElementsByTagName(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "getElementsByTagNameNS" with the proper type (30) -PASS Element interface: calling getElementsByTagNameNS(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "getElementsByClassName" with the proper type (31) -PASS Element interface: calling getElementsByClassName(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "insertAdjacentElement" with the proper type (32) -PASS Element interface: calling insertAdjacentElement(DOMString,Element) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "insertAdjacentText" with the proper type (33) -PASS Element interface: calling insertAdjacentText(DOMString,DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "children" with the proper type (34) -PASS Element interface: element must inherit property "firstElementChild" with the proper type (35) -PASS Element interface: element must inherit property "lastElementChild" with the proper type (36) -PASS Element interface: element must inherit property "childElementCount" with the proper type (37) -PASS Element interface: element must inherit property "prepend" with the proper type (38) -PASS Element interface: calling prepend([object Object],[object Object]) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "append" with the proper type (39) -PASS Element interface: calling append([object Object],[object Object]) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "querySelector" with the proper type (40) -PASS Element interface: calling querySelector(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "querySelectorAll" with the proper type (41) -PASS Element interface: calling querySelectorAll(DOMString) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "previousElementSibling" with the proper type (42) -PASS Element interface: element must inherit property "nextElementSibling" with the proper type (43) -PASS Element interface: element must inherit property "before" with the proper type (44) -PASS Element interface: calling before([object Object],[object Object]) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "after" with the proper type (45) -PASS Element interface: calling after([object Object],[object Object]) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "replaceWith" with the proper type (46) -PASS Element interface: calling replaceWith([object Object],[object Object]) on element with too few arguments must throw TypeError -PASS Element interface: element must inherit property "remove" with the proper type (47) -PASS Element interface: element must inherit property "assignedSlot" with the proper type (48) -PASS Node interface: element must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: element must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: element must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: element must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: element must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: element must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: element must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: element must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: element must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: element must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: element must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: element must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: element must inherit property "nodeType" with the proper type (12) -PASS Node interface: element must inherit property "nodeName" with the proper type (13) -PASS Node interface: element must inherit property "baseURI" with the proper type (14) -PASS Node interface: element must inherit property "isConnected" with the proper type (15) -PASS Node interface: element must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: element must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "parentNode" with the proper type (18) -PASS Node interface: element must inherit property "parentElement" with the proper type (19) -PASS Node interface: element must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: element must inherit property "childNodes" with the proper type (21) -PASS Node interface: element must inherit property "firstChild" with the proper type (22) -PASS Node interface: element must inherit property "lastChild" with the proper type (23) -PASS Node interface: element must inherit property "previousSibling" with the proper type (24) -PASS Node interface: element must inherit property "nextSibling" with the proper type (25) -PASS Node interface: element must inherit property "nodeValue" with the proper type (26) -PASS Node interface: element must inherit property "textContent" with the proper type (27) -PASS Node interface: element must inherit property "normalize" with the proper type (28) -PASS Node interface: element must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: element must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: element must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: element must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: element must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: element must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: element must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on element with too few arguments must throw TypeError -PASS Node interface: element must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on element with too few arguments must throw TypeError -PASS EventTarget interface: element must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on element with too few arguments must throw TypeError -PASS EventTarget interface: element must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on element with too few arguments must throw TypeError -PASS EventTarget interface: element must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on element with too few arguments must throw TypeError -PASS NamedNodeMap interface: existence and properties of interface object -PASS NamedNodeMap interface object length -PASS NamedNodeMap interface object name -PASS NamedNodeMap interface: existence and properties of interface prototype object -PASS NamedNodeMap interface: existence and properties of interface prototype object's "constructor" property -PASS NamedNodeMap interface: attribute length -PASS NamedNodeMap interface: operation item(unsigned long) -PASS NamedNodeMap interface: operation getNamedItem(DOMString) -PASS NamedNodeMap interface: operation getNamedItemNS(DOMString,DOMString) -PASS NamedNodeMap interface: operation setNamedItem(Attr) -PASS NamedNodeMap interface: operation setNamedItemNS(Attr) -PASS NamedNodeMap interface: operation removeNamedItem(DOMString) -PASS NamedNodeMap interface: operation removeNamedItemNS(DOMString,DOMString) -PASS Attr interface: existence and properties of interface object -PASS Attr interface object length -PASS Attr interface object name -PASS Attr interface: existence and properties of interface prototype object -PASS Attr interface: existence and properties of interface prototype object's "constructor" property -PASS Attr interface: attribute namespaceURI -PASS Attr interface: attribute prefix -PASS Attr interface: attribute localName -PASS Attr interface: attribute name -PASS Attr interface: attribute value -PASS Attr interface: attribute ownerElement -PASS Attr interface: attribute specified -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "namespaceURI" with the proper type (0) -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "prefix" with the proper type (1) -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "localName" with the proper type (2) -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "name" with the proper type (3) -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "value" with the proper type (4) -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "ownerElement" with the proper type (5) -PASS Attr interface: document.querySelector("[id]").attributes[0] must inherit property "specified" with the proper type (6) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "nodeType" with the proper type (12) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "nodeName" with the proper type (13) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "baseURI" with the proper type (14) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "isConnected" with the proper type (15) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "parentNode" with the proper type (18) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "parentElement" with the proper type (19) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "childNodes" with the proper type (21) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "firstChild" with the proper type (22) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "lastChild" with the proper type (23) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "previousSibling" with the proper type (24) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "nextSibling" with the proper type (25) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "nodeValue" with the proper type (26) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "textContent" with the proper type (27) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "normalize" with the proper type (28) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS Node interface: document.querySelector("[id]").attributes[0] must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS EventTarget interface: document.querySelector("[id]").attributes[0] must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS EventTarget interface: document.querySelector("[id]").attributes[0] must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS EventTarget interface: document.querySelector("[id]").attributes[0] must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on document.querySelector("[id]").attributes[0] with too few arguments must throw TypeError -PASS CharacterData interface: existence and properties of interface object -PASS CharacterData interface object length -PASS CharacterData interface object name -PASS CharacterData interface: existence and properties of interface prototype object -PASS CharacterData interface: existence and properties of interface prototype object's "constructor" property -PASS CharacterData interface: attribute data -PASS CharacterData interface: attribute length -PASS CharacterData interface: operation substringData(unsigned long,unsigned long) -PASS CharacterData interface: operation appendData(DOMString) -PASS CharacterData interface: operation insertData(unsigned long,DOMString) -PASS CharacterData interface: operation deleteData(unsigned long,unsigned long) -PASS CharacterData interface: operation replaceData(unsigned long,unsigned long,DOMString) -PASS CharacterData interface: attribute previousElementSibling -PASS CharacterData interface: attribute nextElementSibling -PASS CharacterData interface: operation before([object Object],[object Object]) -PASS CharacterData interface: operation after([object Object],[object Object]) -PASS CharacterData interface: operation replaceWith([object Object],[object Object]) -PASS CharacterData interface: operation remove() -PASS Text interface: existence and properties of interface object -PASS Text interface object length -PASS Text interface object name -PASS Text interface: existence and properties of interface prototype object -PASS Text interface: existence and properties of interface prototype object's "constructor" property -PASS Text interface: operation splitText(unsigned long) -PASS Text interface: attribute wholeText -PASS Text interface: attribute assignedSlot -PASS Text interface: document.createTextNode("abc") must inherit property "splitText" with the proper type (0) -PASS Text interface: calling splitText(unsigned long) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Text interface: document.createTextNode("abc") must inherit property "wholeText" with the proper type (1) -PASS Text interface: document.createTextNode("abc") must inherit property "assignedSlot" with the proper type (2) -PASS CharacterData interface: document.createTextNode("abc") must inherit property "data" with the proper type (0) -PASS CharacterData interface: document.createTextNode("abc") must inherit property "length" with the proper type (1) -PASS CharacterData interface: document.createTextNode("abc") must inherit property "substringData" with the proper type (2) -PASS CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "appendData" with the proper type (3) -PASS CharacterData interface: calling appendData(DOMString) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "insertData" with the proper type (4) -PASS CharacterData interface: calling insertData(unsigned long,DOMString) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "deleteData" with the proper type (5) -PASS CharacterData interface: calling deleteData(unsigned long,unsigned long) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "replaceData" with the proper type (6) -PASS CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "previousElementSibling" with the proper type (7) -PASS CharacterData interface: document.createTextNode("abc") must inherit property "nextElementSibling" with the proper type (8) -PASS CharacterData interface: document.createTextNode("abc") must inherit property "before" with the proper type (9) -PASS CharacterData interface: calling before([object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "after" with the proper type (10) -PASS CharacterData interface: calling after([object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "replaceWith" with the proper type (11) -PASS CharacterData interface: calling replaceWith([object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createTextNode("abc") must inherit property "remove" with the proper type (12) -PASS Node interface: document.createTextNode("abc") must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: document.createTextNode("abc") must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: document.createTextNode("abc") must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: document.createTextNode("abc") must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: document.createTextNode("abc") must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: document.createTextNode("abc") must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: document.createTextNode("abc") must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: document.createTextNode("abc") must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: document.createTextNode("abc") must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: document.createTextNode("abc") must inherit property "nodeType" with the proper type (12) -PASS Node interface: document.createTextNode("abc") must inherit property "nodeName" with the proper type (13) -PASS Node interface: document.createTextNode("abc") must inherit property "baseURI" with the proper type (14) -PASS Node interface: document.createTextNode("abc") must inherit property "isConnected" with the proper type (15) -PASS Node interface: document.createTextNode("abc") must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: document.createTextNode("abc") must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "parentNode" with the proper type (18) -PASS Node interface: document.createTextNode("abc") must inherit property "parentElement" with the proper type (19) -PASS Node interface: document.createTextNode("abc") must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: document.createTextNode("abc") must inherit property "childNodes" with the proper type (21) -PASS Node interface: document.createTextNode("abc") must inherit property "firstChild" with the proper type (22) -PASS Node interface: document.createTextNode("abc") must inherit property "lastChild" with the proper type (23) -PASS Node interface: document.createTextNode("abc") must inherit property "previousSibling" with the proper type (24) -PASS Node interface: document.createTextNode("abc") must inherit property "nextSibling" with the proper type (25) -PASS Node interface: document.createTextNode("abc") must inherit property "nodeValue" with the proper type (26) -PASS Node interface: document.createTextNode("abc") must inherit property "textContent" with the proper type (27) -PASS Node interface: document.createTextNode("abc") must inherit property "normalize" with the proper type (28) -PASS Node interface: document.createTextNode("abc") must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: document.createTextNode("abc") must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: document.createTextNode("abc") must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS Node interface: document.createTextNode("abc") must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS EventTarget interface: document.createTextNode("abc") must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS EventTarget interface: document.createTextNode("abc") must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS EventTarget interface: document.createTextNode("abc") must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on document.createTextNode("abc") with too few arguments must throw TypeError -PASS CDATASection interface: existence and properties of interface object -PASS CDATASection interface object length -PASS CDATASection interface object name -PASS CDATASection interface: existence and properties of interface prototype object -PASS CDATASection interface: existence and properties of interface prototype object's "constructor" property -PASS ProcessingInstruction interface: existence and properties of interface object -PASS ProcessingInstruction interface object length -PASS ProcessingInstruction interface object name -PASS ProcessingInstruction interface: existence and properties of interface prototype object -PASS ProcessingInstruction interface: existence and properties of interface prototype object's "constructor" property -PASS ProcessingInstruction interface: attribute target -PASS ProcessingInstruction interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "target" with the proper type (0) -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "data" with the proper type (0) -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "length" with the proper type (1) -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "substringData" with the proper type (2) -PASS CharacterData interface: calling substringData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "appendData" with the proper type (3) -PASS CharacterData interface: calling appendData(DOMString) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "insertData" with the proper type (4) -PASS CharacterData interface: calling insertData(unsigned long,DOMString) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "deleteData" with the proper type (5) -PASS CharacterData interface: calling deleteData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "replaceData" with the proper type (6) -PASS CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "previousElementSibling" with the proper type (7) -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "nextElementSibling" with the proper type (8) -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "before" with the proper type (9) -PASS CharacterData interface: calling before([object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "after" with the proper type (10) -PASS CharacterData interface: calling after([object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "replaceWith" with the proper type (11) -PASS CharacterData interface: calling replaceWith([object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "remove" with the proper type (12) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "nodeType" with the proper type (12) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "nodeName" with the proper type (13) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "baseURI" with the proper type (14) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "isConnected" with the proper type (15) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "parentNode" with the proper type (18) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "parentElement" with the proper type (19) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "childNodes" with the proper type (21) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "firstChild" with the proper type (22) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "lastChild" with the proper type (23) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "previousSibling" with the proper type (24) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "nextSibling" with the proper type (25) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "nodeValue" with the proper type (26) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "textContent" with the proper type (27) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "normalize" with the proper type (28) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS EventTarget interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS EventTarget interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS EventTarget interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError -PASS Comment interface: existence and properties of interface object -PASS Comment interface object length -PASS Comment interface object name -PASS Comment interface: existence and properties of interface prototype object -PASS Comment interface: existence and properties of interface prototype object's "constructor" property -PASS CharacterData interface: document.createComment("abc") must inherit property "data" with the proper type (0) -PASS CharacterData interface: document.createComment("abc") must inherit property "length" with the proper type (1) -PASS CharacterData interface: document.createComment("abc") must inherit property "substringData" with the proper type (2) -PASS CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "appendData" with the proper type (3) -PASS CharacterData interface: calling appendData(DOMString) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "insertData" with the proper type (4) -PASS CharacterData interface: calling insertData(unsigned long,DOMString) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "deleteData" with the proper type (5) -PASS CharacterData interface: calling deleteData(unsigned long,unsigned long) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "replaceData" with the proper type (6) -PASS CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "previousElementSibling" with the proper type (7) -PASS CharacterData interface: document.createComment("abc") must inherit property "nextElementSibling" with the proper type (8) -PASS CharacterData interface: document.createComment("abc") must inherit property "before" with the proper type (9) -PASS CharacterData interface: calling before([object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "after" with the proper type (10) -PASS CharacterData interface: calling after([object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "replaceWith" with the proper type (11) -PASS CharacterData interface: calling replaceWith([object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError -PASS CharacterData interface: document.createComment("abc") must inherit property "remove" with the proper type (12) -PASS Node interface: document.createComment("abc") must inherit property "ELEMENT_NODE" with the proper type (0) -PASS Node interface: document.createComment("abc") must inherit property "ATTRIBUTE_NODE" with the proper type (1) -PASS Node interface: document.createComment("abc") must inherit property "TEXT_NODE" with the proper type (2) -PASS Node interface: document.createComment("abc") must inherit property "CDATA_SECTION_NODE" with the proper type (3) -PASS Node interface: document.createComment("abc") must inherit property "ENTITY_REFERENCE_NODE" with the proper type (4) -PASS Node interface: document.createComment("abc") must inherit property "ENTITY_NODE" with the proper type (5) -PASS Node interface: document.createComment("abc") must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type (6) -PASS Node interface: document.createComment("abc") must inherit property "COMMENT_NODE" with the proper type (7) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_NODE" with the proper type (8) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_TYPE_NODE" with the proper type (9) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type (10) -PASS Node interface: document.createComment("abc") must inherit property "NOTATION_NODE" with the proper type (11) -PASS Node interface: document.createComment("abc") must inherit property "nodeType" with the proper type (12) -PASS Node interface: document.createComment("abc") must inherit property "nodeName" with the proper type (13) -PASS Node interface: document.createComment("abc") must inherit property "baseURI" with the proper type (14) -PASS Node interface: document.createComment("abc") must inherit property "isConnected" with the proper type (15) -PASS Node interface: document.createComment("abc") must inherit property "ownerDocument" with the proper type (16) -PASS Node interface: document.createComment("abc") must inherit property "getRootNode" with the proper type (17) -PASS Node interface: calling getRootNode(GetRootNodeOptions) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "parentNode" with the proper type (18) -PASS Node interface: document.createComment("abc") must inherit property "parentElement" with the proper type (19) -PASS Node interface: document.createComment("abc") must inherit property "hasChildNodes" with the proper type (20) -PASS Node interface: document.createComment("abc") must inherit property "childNodes" with the proper type (21) -PASS Node interface: document.createComment("abc") must inherit property "firstChild" with the proper type (22) -PASS Node interface: document.createComment("abc") must inherit property "lastChild" with the proper type (23) -PASS Node interface: document.createComment("abc") must inherit property "previousSibling" with the proper type (24) -PASS Node interface: document.createComment("abc") must inherit property "nextSibling" with the proper type (25) -PASS Node interface: document.createComment("abc") must inherit property "nodeValue" with the proper type (26) -PASS Node interface: document.createComment("abc") must inherit property "textContent" with the proper type (27) -PASS Node interface: document.createComment("abc") must inherit property "normalize" with the proper type (28) -PASS Node interface: document.createComment("abc") must inherit property "cloneNode" with the proper type (29) -PASS Node interface: calling cloneNode(boolean) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "isEqualNode" with the proper type (30) -PASS Node interface: calling isEqualNode(Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "isSameNode" with the proper type (31) -PASS Node interface: calling isSameNode(Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type (32) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type (33) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type (34) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type (35) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type (36) -PASS Node interface: document.createComment("abc") must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type (37) -PASS Node interface: document.createComment("abc") must inherit property "compareDocumentPosition" with the proper type (38) -PASS Node interface: calling compareDocumentPosition(Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "contains" with the proper type (39) -PASS Node interface: calling contains(Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "lookupPrefix" with the proper type (40) -PASS Node interface: calling lookupPrefix(DOMString) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "lookupNamespaceURI" with the proper type (41) -PASS Node interface: calling lookupNamespaceURI(DOMString) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "isDefaultNamespace" with the proper type (42) -PASS Node interface: calling isDefaultNamespace(DOMString) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "insertBefore" with the proper type (43) -PASS Node interface: calling insertBefore(Node,Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "appendChild" with the proper type (44) -PASS Node interface: calling appendChild(Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "replaceChild" with the proper type (45) -PASS Node interface: calling replaceChild(Node,Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS Node interface: document.createComment("abc") must inherit property "removeChild" with the proper type (46) -PASS Node interface: calling removeChild(Node) on document.createComment("abc") with too few arguments must throw TypeError -PASS EventTarget interface: document.createComment("abc") must inherit property "addEventListener" with the proper type (0) -PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError -PASS EventTarget interface: document.createComment("abc") must inherit property "removeEventListener" with the proper type (1) -PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError -PASS EventTarget interface: document.createComment("abc") must inherit property "dispatchEvent" with the proper type (2) -PASS EventTarget interface: calling dispatchEvent(Event) on document.createComment("abc") with too few arguments must throw TypeError -PASS Range interface: existence and properties of interface object -PASS Range interface object length -PASS Range interface object name -PASS Range interface: existence and properties of interface prototype object -PASS Range interface: existence and properties of interface prototype object's "constructor" property -PASS Range interface: attribute startContainer -PASS Range interface: attribute startOffset -PASS Range interface: attribute endContainer -PASS Range interface: attribute endOffset -PASS Range interface: attribute collapsed -PASS Range interface: attribute commonAncestorContainer -PASS Range interface: operation setStart(Node,unsigned long) -PASS Range interface: operation setEnd(Node,unsigned long) -PASS Range interface: operation setStartBefore(Node) -PASS Range interface: operation setStartAfter(Node) -PASS Range interface: operation setEndBefore(Node) -PASS Range interface: operation setEndAfter(Node) -PASS Range interface: operation collapse(boolean) -PASS Range interface: operation selectNode(Node) -PASS Range interface: operation selectNodeContents(Node) -PASS Range interface: constant START_TO_START on interface object -PASS Range interface: constant START_TO_START on interface prototype object -PASS Range interface: constant START_TO_END on interface object -PASS Range interface: constant START_TO_END on interface prototype object -PASS Range interface: constant END_TO_END on interface object -PASS Range interface: constant END_TO_END on interface prototype object -PASS Range interface: constant END_TO_START on interface object -PASS Range interface: constant END_TO_START on interface prototype object -PASS Range interface: operation compareBoundaryPoints(unsigned short,Range) -PASS Range interface: operation deleteContents() -PASS Range interface: operation extractContents() -PASS Range interface: operation cloneContents() -PASS Range interface: operation insertNode(Node) -PASS Range interface: operation surroundContents(Node) -PASS Range interface: operation cloneRange() -PASS Range interface: operation detach() -PASS Range interface: operation isPointInRange(Node,unsigned long) -PASS Range interface: operation comparePoint(Node,unsigned long) -PASS Range interface: operation intersectsNode(Node) -PASS Range interface: stringifier -PASS Range interface: document.createRange() must inherit property "startContainer" with the proper type (0) -PASS Range interface: document.createRange() must inherit property "startOffset" with the proper type (1) -PASS Range interface: document.createRange() must inherit property "endContainer" with the proper type (2) -PASS Range interface: document.createRange() must inherit property "endOffset" with the proper type (3) -PASS Range interface: document.createRange() must inherit property "collapsed" with the proper type (4) -PASS Range interface: document.createRange() must inherit property "commonAncestorContainer" with the proper type (5) -PASS Range interface: document.createRange() must inherit property "setStart" with the proper type (6) -PASS Range interface: calling setStart(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "setEnd" with the proper type (7) -PASS Range interface: calling setEnd(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "setStartBefore" with the proper type (8) -PASS Range interface: calling setStartBefore(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "setStartAfter" with the proper type (9) -PASS Range interface: calling setStartAfter(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "setEndBefore" with the proper type (10) -PASS Range interface: calling setEndBefore(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "setEndAfter" with the proper type (11) -PASS Range interface: calling setEndAfter(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "collapse" with the proper type (12) -PASS Range interface: calling collapse(boolean) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "selectNode" with the proper type (13) -PASS Range interface: calling selectNode(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "selectNodeContents" with the proper type (14) -PASS Range interface: calling selectNodeContents(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "START_TO_START" with the proper type (15) -PASS Range interface: document.createRange() must inherit property "START_TO_END" with the proper type (16) -PASS Range interface: document.createRange() must inherit property "END_TO_END" with the proper type (17) -PASS Range interface: document.createRange() must inherit property "END_TO_START" with the proper type (18) -PASS Range interface: document.createRange() must inherit property "compareBoundaryPoints" with the proper type (19) -PASS Range interface: calling compareBoundaryPoints(unsigned short,Range) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "deleteContents" with the proper type (20) -PASS Range interface: document.createRange() must inherit property "extractContents" with the proper type (21) -PASS Range interface: document.createRange() must inherit property "cloneContents" with the proper type (22) -PASS Range interface: document.createRange() must inherit property "insertNode" with the proper type (23) -PASS Range interface: calling insertNode(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "surroundContents" with the proper type (24) -PASS Range interface: calling surroundContents(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "cloneRange" with the proper type (25) -PASS Range interface: document.createRange() must inherit property "detach" with the proper type (26) -PASS Range interface: document.createRange() must inherit property "isPointInRange" with the proper type (27) -PASS Range interface: calling isPointInRange(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "comparePoint" with the proper type (28) -PASS Range interface: calling comparePoint(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: document.createRange() must inherit property "intersectsNode" with the proper type (29) -PASS Range interface: calling intersectsNode(Node) on document.createRange() with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "startContainer" with the proper type (0) -PASS Range interface: detachedRange must inherit property "startOffset" with the proper type (1) -PASS Range interface: detachedRange must inherit property "endContainer" with the proper type (2) -PASS Range interface: detachedRange must inherit property "endOffset" with the proper type (3) -PASS Range interface: detachedRange must inherit property "collapsed" with the proper type (4) -PASS Range interface: detachedRange must inherit property "commonAncestorContainer" with the proper type (5) -PASS Range interface: detachedRange must inherit property "setStart" with the proper type (6) -PASS Range interface: calling setStart(Node,unsigned long) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "setEnd" with the proper type (7) -PASS Range interface: calling setEnd(Node,unsigned long) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "setStartBefore" with the proper type (8) -PASS Range interface: calling setStartBefore(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "setStartAfter" with the proper type (9) -PASS Range interface: calling setStartAfter(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "setEndBefore" with the proper type (10) -PASS Range interface: calling setEndBefore(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "setEndAfter" with the proper type (11) -PASS Range interface: calling setEndAfter(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "collapse" with the proper type (12) -PASS Range interface: calling collapse(boolean) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "selectNode" with the proper type (13) -PASS Range interface: calling selectNode(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "selectNodeContents" with the proper type (14) -PASS Range interface: calling selectNodeContents(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "START_TO_START" with the proper type (15) -PASS Range interface: detachedRange must inherit property "START_TO_END" with the proper type (16) -PASS Range interface: detachedRange must inherit property "END_TO_END" with the proper type (17) -PASS Range interface: detachedRange must inherit property "END_TO_START" with the proper type (18) -PASS Range interface: detachedRange must inherit property "compareBoundaryPoints" with the proper type (19) -PASS Range interface: calling compareBoundaryPoints(unsigned short,Range) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "deleteContents" with the proper type (20) -PASS Range interface: detachedRange must inherit property "extractContents" with the proper type (21) -PASS Range interface: detachedRange must inherit property "cloneContents" with the proper type (22) -PASS Range interface: detachedRange must inherit property "insertNode" with the proper type (23) -PASS Range interface: calling insertNode(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "surroundContents" with the proper type (24) -PASS Range interface: calling surroundContents(Node) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "cloneRange" with the proper type (25) -PASS Range interface: detachedRange must inherit property "detach" with the proper type (26) -PASS Range interface: detachedRange must inherit property "isPointInRange" with the proper type (27) -PASS Range interface: calling isPointInRange(Node,unsigned long) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "comparePoint" with the proper type (28) -PASS Range interface: calling comparePoint(Node,unsigned long) on detachedRange with too few arguments must throw TypeError -PASS Range interface: detachedRange must inherit property "intersectsNode" with the proper type (29) -PASS Range interface: calling intersectsNode(Node) on detachedRange with too few arguments must throw TypeError -PASS NodeIterator interface: existence and properties of interface object -PASS NodeIterator interface object length -PASS NodeIterator interface object name -PASS NodeIterator interface: existence and properties of interface prototype object -PASS NodeIterator interface: existence and properties of interface prototype object's "constructor" property -PASS NodeIterator interface: attribute root -PASS NodeIterator interface: attribute referenceNode -PASS NodeIterator interface: attribute pointerBeforeReferenceNode -PASS NodeIterator interface: attribute whatToShow -PASS NodeIterator interface: attribute filter -PASS NodeIterator interface: operation nextNode() -PASS NodeIterator interface: operation previousNode() -PASS NodeIterator interface: operation detach() -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "root" with the proper type (0) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "referenceNode" with the proper type (1) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "pointerBeforeReferenceNode" with the proper type (2) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "whatToShow" with the proper type (3) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "filter" with the proper type (4) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "nextNode" with the proper type (5) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "previousNode" with the proper type (6) -PASS NodeIterator interface: document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "detach" with the proper type (7) -PASS TreeWalker interface: existence and properties of interface object -PASS TreeWalker interface object length -PASS TreeWalker interface object name -PASS TreeWalker interface: existence and properties of interface prototype object -PASS TreeWalker interface: existence and properties of interface prototype object's "constructor" property -PASS TreeWalker interface: attribute root -PASS TreeWalker interface: attribute whatToShow -PASS TreeWalker interface: attribute filter -PASS TreeWalker interface: attribute currentNode -PASS TreeWalker interface: operation parentNode() -PASS TreeWalker interface: operation firstChild() -PASS TreeWalker interface: operation lastChild() -PASS TreeWalker interface: operation previousSibling() -PASS TreeWalker interface: operation nextSibling() -PASS TreeWalker interface: operation previousNode() -PASS TreeWalker interface: operation nextNode() -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "root" with the proper type (0) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "whatToShow" with the proper type (1) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "filter" with the proper type (2) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "currentNode" with the proper type (3) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "parentNode" with the proper type (4) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "firstChild" with the proper type (5) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "lastChild" with the proper type (6) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "previousSibling" with the proper type (7) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "nextSibling" with the proper type (8) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "previousNode" with the proper type (9) -PASS TreeWalker interface: document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false) must inherit property "nextNode" with the proper type (10) -PASS NodeFilter interface: existence and properties of interface object -PASS NodeFilter interface object name -PASS NodeFilter interface: existence and properties of interface prototype object -PASS NodeFilter interface: existence and properties of interface prototype object's "constructor" property -PASS NodeFilter interface: constant FILTER_ACCEPT on interface object -PASS NodeFilter interface: constant FILTER_ACCEPT on interface prototype object -PASS NodeFilter interface: constant FILTER_REJECT on interface object -PASS NodeFilter interface: constant FILTER_REJECT on interface prototype object -PASS NodeFilter interface: constant FILTER_SKIP on interface object -PASS NodeFilter interface: constant FILTER_SKIP on interface prototype object -PASS NodeFilter interface: constant SHOW_ALL on interface object -PASS NodeFilter interface: constant SHOW_ALL on interface prototype object -PASS NodeFilter interface: constant SHOW_ELEMENT on interface object -PASS NodeFilter interface: constant SHOW_ELEMENT on interface prototype object -PASS NodeFilter interface: constant SHOW_ATTRIBUTE on interface object -PASS NodeFilter interface: constant SHOW_ATTRIBUTE on interface prototype object -PASS NodeFilter interface: constant SHOW_TEXT on interface object -PASS NodeFilter interface: constant SHOW_TEXT on interface prototype object -PASS NodeFilter interface: constant SHOW_CDATA_SECTION on interface object -PASS NodeFilter interface: constant SHOW_CDATA_SECTION on interface prototype object -PASS NodeFilter interface: constant SHOW_ENTITY_REFERENCE on interface object -PASS NodeFilter interface: constant SHOW_ENTITY_REFERENCE on interface prototype object -PASS NodeFilter interface: constant SHOW_ENTITY on interface object -PASS NodeFilter interface: constant SHOW_ENTITY on interface prototype object -PASS NodeFilter interface: constant SHOW_PROCESSING_INSTRUCTION on interface object -PASS NodeFilter interface: constant SHOW_PROCESSING_INSTRUCTION on interface prototype object -PASS NodeFilter interface: constant SHOW_COMMENT on interface object -PASS NodeFilter interface: constant SHOW_COMMENT on interface prototype object -PASS NodeFilter interface: constant SHOW_DOCUMENT on interface object -PASS NodeFilter interface: constant SHOW_DOCUMENT on interface prototype object -PASS NodeFilter interface: constant SHOW_DOCUMENT_TYPE on interface object -PASS NodeFilter interface: constant SHOW_DOCUMENT_TYPE on interface prototype object -PASS NodeFilter interface: constant SHOW_DOCUMENT_FRAGMENT on interface object -PASS NodeFilter interface: constant SHOW_DOCUMENT_FRAGMENT on interface prototype object -PASS NodeFilter interface: constant SHOW_NOTATION on interface object -PASS NodeFilter interface: constant SHOW_NOTATION on interface prototype object -PASS NodeFilter interface: operation acceptNode(Node) -PASS DOMTokenList interface: existence and properties of interface object -PASS DOMTokenList interface object length -PASS DOMTokenList interface object name -PASS DOMTokenList interface: existence and properties of interface prototype object -PASS DOMTokenList interface: existence and properties of interface prototype object's "constructor" property -PASS DOMTokenList interface: attribute length -PASS DOMTokenList interface: operation item(unsigned long) -PASS DOMTokenList interface: operation contains(DOMString) -PASS DOMTokenList interface: operation add(DOMString) -PASS DOMTokenList interface: operation remove(DOMString) -PASS DOMTokenList interface: operation toggle(DOMString,boolean) -PASS DOMTokenList interface: operation replace(DOMString,DOMString) -PASS DOMTokenList interface: operation supports(DOMString) -PASS DOMTokenList interface: attribute value -PASS DOMTokenList interface: stringifier -PASS DOMTokenList interface: document.body.classList must inherit property "length" with the proper type (0) -PASS DOMTokenList interface: document.body.classList must inherit property "item" with the proper type (1) -PASS DOMTokenList interface: calling item(unsigned long) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "contains" with the proper type (2) -PASS DOMTokenList interface: calling contains(DOMString) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "add" with the proper type (3) -PASS DOMTokenList interface: calling add(DOMString) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "remove" with the proper type (4) -PASS DOMTokenList interface: calling remove(DOMString) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "toggle" with the proper type (5) -PASS DOMTokenList interface: calling toggle(DOMString,boolean) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "replace" with the proper type (6) -PASS DOMTokenList interface: calling replace(DOMString,DOMString) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "supports" with the proper type (7) -PASS DOMTokenList interface: calling supports(DOMString) on document.body.classList with too few arguments must throw TypeError -PASS DOMTokenList interface: document.body.classList must inherit property "value" with the proper type (8) -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/attributes-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/attributes-expected.txt index 44dbebf8..bac09bd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/attributes-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/attributes-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 58 tests; 50 PASS, 8 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 58 tests; 51 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown. (setAttribute) PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown, even if the attribute is already present. (setAttribute) PASS setAttribute should lowercase its name argument (upper case attribute) @@ -50,7 +50,7 @@ PASS setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute PASS setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute (outer shell) PASS setAttributeNode called with an Attr that has the same name as an existing one should not change attribute order -FAIL getAttributeNames tests el.getAttributeNames is not a function +PASS getAttributeNames tests FAIL Own property correctness with basic attributes assert_array_equals: lengths differ, expected 2 got 0 FAIL Own property correctness with non-namespaced attribute before same-name namespaced one assert_array_equals: lengths differ, expected 3 got 0 FAIL Own property correctness with namespaced attribute before same-name non-namespaced one assert_array_equals: lengths differ, expected 3 got 0
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/traversal/TreeWalker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/dom/traversal/TreeWalker-expected.txt deleted file mode 100644 index 69c492bb..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/traversal/TreeWalker-expected.txt +++ /dev/null
@@ -1,745 +0,0 @@ -This is a testharness.js-based test. -Found 740 tests; 735 PASS, 5 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS document.createTreeWalker(paras[0], 0, null) -PASS document.createTreeWalker(paras[0], 0, (function(node) { return true })) -PASS document.createTreeWalker(paras[0], 0, (function(node) { return false })) -PASS document.createTreeWalker(paras[0], 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0], 0xFFFFFFFF, null) -PASS document.createTreeWalker(paras[0], 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(paras[0], 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(paras[0], 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[0], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0].firstChild, 0, null) -PASS document.createTreeWalker(paras[0].firstChild, 0, (function(node) { return true })) -PASS document.createTreeWalker(paras[0].firstChild, 0, (function(node) { return false })) -PASS document.createTreeWalker(paras[0].firstChild, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0].firstChild, 0xFFFFFFFF, null) -PASS document.createTreeWalker(paras[0].firstChild, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(paras[0].firstChild, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(paras[0].firstChild, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[0].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1].firstChild, 0, null) -PASS document.createTreeWalker(paras[1].firstChild, 0, (function(node) { return true })) -PASS document.createTreeWalker(paras[1].firstChild, 0, (function(node) { return false })) -PASS document.createTreeWalker(paras[1].firstChild, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1].firstChild, 0xFFFFFFFF, null) -PASS document.createTreeWalker(paras[1].firstChild, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(paras[1].firstChild, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(paras[1].firstChild, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[1].firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1, 0, null) -PASS document.createTreeWalker(foreignPara1, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignPara1, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1.firstChild, 0, null) -PASS document.createTreeWalker(foreignPara1.firstChild, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1.firstChild, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1.firstChild, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1.firstChild, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignPara1.firstChild, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1.firstChild, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1.firstChild, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1, 0, null) -PASS document.createTreeWalker(detachedPara1, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedPara1, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1.firstChild, 0, null) -PASS document.createTreeWalker(detachedPara1.firstChild, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1.firstChild, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1.firstChild, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1.firstChild, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedPara1.firstChild, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1.firstChild, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1.firstChild, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara1.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(document, 0, null) -PASS document.createTreeWalker(document, 0, (function(node) { return true })) -PASS document.createTreeWalker(document, 0, (function(node) { return false })) -PASS document.createTreeWalker(document, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(document, 0xFFFFFFFF, null) -PASS document.createTreeWalker(document, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(document, 0xFFFFFFFF, (function(node) { return false })) -FAIL document.createTreeWalker(document, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) assert_equals: .nextSibling() expected Text node "TreeWalker tests" but got null -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedDiv, 0, null) -PASS document.createTreeWalker(detachedDiv, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedDiv, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedDiv, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedDiv, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedDiv, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedDiv, 0xFFFFFFFF, (function(node) { return false })) -FAIL document.createTreeWalker(detachedDiv, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) assert_equals: .nextSibling() expected Text node "Wxyzabcd" but got null -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoc, 0, null) -PASS document.createTreeWalker(foreignDoc, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoc, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoc, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoc, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignDoc, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoc, 0xFFFFFFFF, (function(node) { return false })) -FAIL document.createTreeWalker(foreignDoc, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) assert_equals: .nextSibling() expected Text node "" but got Comment node <!--"Commenter" and "commentator" mean different things. I'v...--> -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara2, 0, null) -PASS document.createTreeWalker(foreignPara2, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara2, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara2, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara2, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignPara2, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara2, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara2, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoc, 0, null) -PASS document.createTreeWalker(xmlDoc, 0, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoc, 0, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoc, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoc, 0xFFFFFFFF, null) -PASS document.createTreeWalker(xmlDoc, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoc, 0xFFFFFFFF, (function(node) { return false })) -FAIL document.createTreeWalker(xmlDoc, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) assert_equals: .nextSibling() expected Text node "do re mi fa so la ti" but got Comment node <!--I maliciously created a comment that will break incautiou...--> -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoc, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlElement, 0, null) -PASS document.createTreeWalker(xmlElement, 0, (function(node) { return true })) -PASS document.createTreeWalker(xmlElement, 0, (function(node) { return false })) -PASS document.createTreeWalker(xmlElement, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlElement, 0xFFFFFFFF, null) -PASS document.createTreeWalker(xmlElement, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(xmlElement, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(xmlElement, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedTextNode, 0, null) -PASS document.createTreeWalker(detachedTextNode, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedTextNode, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedTextNode, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedTextNode, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedTextNode, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedTextNode, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedTextNode, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignTextNode, 0, null) -PASS document.createTreeWalker(foreignTextNode, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignTextNode, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignTextNode, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignTextNode, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignTextNode, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignTextNode, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignTextNode, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(processingInstruction, 0, null) -PASS document.createTreeWalker(processingInstruction, 0, (function(node) { return true })) -PASS document.createTreeWalker(processingInstruction, 0, (function(node) { return false })) -PASS document.createTreeWalker(processingInstruction, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(processingInstruction, 0xFFFFFFFF, null) -PASS document.createTreeWalker(processingInstruction, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(processingInstruction, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(processingInstruction, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(processingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedProcessingInstruction, 0, null) -PASS document.createTreeWalker(detachedProcessingInstruction, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedProcessingInstruction, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedProcessingInstruction, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedProcessingInstruction, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedProcessingInstruction, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedProcessingInstruction, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedProcessingInstruction, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedProcessingInstruction, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(comment, 0, null) -PASS document.createTreeWalker(comment, 0, (function(node) { return true })) -PASS document.createTreeWalker(comment, 0, (function(node) { return false })) -PASS document.createTreeWalker(comment, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(comment, 0xFFFFFFFF, null) -PASS document.createTreeWalker(comment, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(comment, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(comment, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(comment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedComment, 0, null) -PASS document.createTreeWalker(detachedComment, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedComment, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedComment, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedComment, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedComment, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedComment, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedComment, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(docfrag, 0, null) -PASS document.createTreeWalker(docfrag, 0, (function(node) { return true })) -PASS document.createTreeWalker(docfrag, 0, (function(node) { return false })) -PASS document.createTreeWalker(docfrag, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(docfrag, 0xFFFFFFFF, null) -PASS document.createTreeWalker(docfrag, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(docfrag, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(docfrag, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(docfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(doctype, 0, null) -PASS document.createTreeWalker(doctype, 0, (function(node) { return true })) -PASS document.createTreeWalker(doctype, 0, (function(node) { return false })) -PASS document.createTreeWalker(doctype, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(doctype, 0xFFFFFFFF, null) -PASS document.createTreeWalker(doctype, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(doctype, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(doctype, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(doctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoctype, 0, null) -PASS document.createTreeWalker(foreignDoctype, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoctype, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoctype, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoctype, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignDoctype, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoctype, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoctype, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1], 0, null) -PASS document.createTreeWalker(paras[1], 0, (function(node) { return true })) -PASS document.createTreeWalker(paras[1], 0, (function(node) { return false })) -PASS document.createTreeWalker(paras[1], 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1], 0xFFFFFFFF, null) -PASS document.createTreeWalker(paras[1], 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(paras[1], 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(paras[1], 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(paras[1], NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2, 0, null) -PASS document.createTreeWalker(detachedPara2, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedPara2, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2.firstChild, 0, null) -PASS document.createTreeWalker(detachedPara2.firstChild, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2.firstChild, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2.firstChild, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2.firstChild, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedPara2.firstChild, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2.firstChild, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2.firstChild, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedPara2.firstChild, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(testDiv, 0, null) -PASS document.createTreeWalker(testDiv, 0, (function(node) { return true })) -PASS document.createTreeWalker(testDiv, 0, (function(node) { return false })) -PASS document.createTreeWalker(testDiv, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(testDiv, 0xFFFFFFFF, null) -PASS document.createTreeWalker(testDiv, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(testDiv, 0xFFFFFFFF, (function(node) { return false })) -FAIL document.createTreeWalker(testDiv, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) assert_equals: .nextSibling() expected Text node "Ijklmnop -" but got Comment node <!--Alphabet soup?--> -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(testDiv, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlElement, 0, null) -PASS document.createTreeWalker(detachedXmlElement, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlElement, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlElement, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlElement, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedXmlElement, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlElement, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlElement, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignTextNode, 0, null) -PASS document.createTreeWalker(detachedForeignTextNode, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignTextNode, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignTextNode, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignTextNode, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedForeignTextNode, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignTextNode, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignTextNode, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlTextNode, 0, null) -PASS document.createTreeWalker(xmlTextNode, 0, (function(node) { return true })) -PASS document.createTreeWalker(xmlTextNode, 0, (function(node) { return false })) -PASS document.createTreeWalker(xmlTextNode, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlTextNode, 0xFFFFFFFF, null) -PASS document.createTreeWalker(xmlTextNode, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(xmlTextNode, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(xmlTextNode, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlTextNode, 0, null) -PASS document.createTreeWalker(detachedXmlTextNode, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlTextNode, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlTextNode, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlTextNode, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedXmlTextNode, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlTextNode, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlTextNode, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlTextNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlComment, 0, null) -PASS document.createTreeWalker(xmlComment, 0, (function(node) { return true })) -PASS document.createTreeWalker(xmlComment, 0, (function(node) { return false })) -PASS document.createTreeWalker(xmlComment, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlComment, 0xFFFFFFFF, null) -PASS document.createTreeWalker(xmlComment, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(xmlComment, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(xmlComment, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignComment, 0, null) -PASS document.createTreeWalker(foreignComment, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignComment, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignComment, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignComment, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignComment, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignComment, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignComment, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignComment, 0, null) -PASS document.createTreeWalker(detachedForeignComment, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignComment, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignComment, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignComment, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedForeignComment, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignComment, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignComment, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedForeignComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlComment, 0, null) -PASS document.createTreeWalker(detachedXmlComment, 0, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlComment, 0, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlComment, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlComment, 0xFFFFFFFF, null) -PASS document.createTreeWalker(detachedXmlComment, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlComment, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlComment, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(detachedXmlComment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDocfrag, 0, null) -PASS document.createTreeWalker(foreignDocfrag, 0, (function(node) { return true })) -PASS document.createTreeWalker(foreignDocfrag, 0, (function(node) { return false })) -PASS document.createTreeWalker(foreignDocfrag, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDocfrag, 0xFFFFFFFF, null) -PASS document.createTreeWalker(foreignDocfrag, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(foreignDocfrag, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(foreignDocfrag, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(foreignDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDocfrag, 0, null) -PASS document.createTreeWalker(xmlDocfrag, 0, (function(node) { return true })) -PASS document.createTreeWalker(xmlDocfrag, 0, (function(node) { return false })) -PASS document.createTreeWalker(xmlDocfrag, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDocfrag, 0xFFFFFFFF, null) -PASS document.createTreeWalker(xmlDocfrag, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(xmlDocfrag, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(xmlDocfrag, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlDocfrag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoctype, 0, null) -PASS document.createTreeWalker(xmlDoctype, 0, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoctype, 0, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoctype, 0, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoctype, 0xFFFFFFFF, null) -PASS document.createTreeWalker(xmlDoctype, 0xFFFFFFFF, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoctype, 0xFFFFFFFF, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoctype, 0xFFFFFFFF, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT, null) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ATTRIBUTE, null) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ATTRIBUTE, (function(node) { return node.nodeName[0] == '#' })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, null) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return true })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return false })) -PASS document.createTreeWalker(xmlDoctype, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_DOCUMENT, (function(node) { return node.nodeName[0] == '#' })) -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt index 1db9b848a..ad97731 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
@@ -19,7 +19,7 @@ PASS [[Delete]] Should throw on cross-origin objects 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 PASS [[Enumerate]] should return an empty iterator -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 861 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 863 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/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods-expected.txt deleted file mode 100644 index 72af55d..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -This is a testharness.js-based test. -PASS createCaption method creates new caption if existing caption is not in html namespace -PASS createCaption method returns the first caption element child of the table -PASS createCaption method creates a new caption and inserts it as the first node of the table element -PASS createCaption will not create new caption if one exists -PASS createCaption will not copy table's prefix -PASS deleteCaption method removes the first caption element child of the table element -PASS deleteCaption method not remove caption that is not in html namespace -PASS Setting caption rethrows exception -PASS Assigning a caption to table.caption -FAIL Assigning null to table.caption Failed to set the 'caption' property on 'HTMLTableElement': The new child element is null. -PASS Assigning a non-caption to table.caption -PASS Assigning a foreign caption to table.caption -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/tHead-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/tHead-expected.txt index f25d16f..3406ad3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/tHead-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/tHead-expected.txt
@@ -1,5 +1,7 @@ This is a testharness.js-based test. -FAIL tHead tests Failed to set the 'tHead' property on 'HTMLTableElement': The new child element is null. +FAIL tHead tests assert_throws: function "function (){ + t.tHead = document.createElement("tbody"); + }" did not throw PASS tHead tests 1 PASS tHead tests 2 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-expected.txt index 7943c84..95662906 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-expected.txt
@@ -1,7 +1,7 @@ This is a testharness.js-based test. -Found 90 tests; 46 PASS, 44 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 90 tests; 47 PASS, 43 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Element.animate() creates an Animation object -FAIL Element.animate() creates an Animation object in the relevant realm of the target element Cannot read property 'prototype' of undefined +PASS Element.animate() creates an Animation object in the relevant realm of the target element PASS Element.animate() creates an Animation object with a KeyframeEffect PASS Element.animate() creates an Animation object with a KeyframeEffect that is created in the relevant realm of the target element PASS Element.animate() creates an Animation object with a KeyframeEffect whose AnimationEffectTiming object is created in the relevant realm of the target element
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor-expected.txt index 999cc88..fcf2de07 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor-expected.txt
@@ -1,11 +1,11 @@ This is a testharness.js-based test. -FAIL Animation can be constructed with null effect and null timeline Animation is not defined -FAIL Animation can be constructed with null effect and non-null timeline Animation is not defined -FAIL Animation can be constructed with null effect and no timeline parameter Animation is not defined -FAIL Animation can be constructed with non-null effect and null timeline Animation is not defined -FAIL Animation can be constructed with non-null effect and non-null timeline Animation is not defined -FAIL Animation can be constructed with non-null effect and no timeline parameter Animation is not defined -FAIL Animation constructed by an effect with null target runs normally Animation is not defined -FAIL Animation constructed with a keyframe that target element is in iframe Animation is not defined +FAIL Animation can be constructed with null effect and null timeline assert_equals: Animation timeline should be null expected null but got object "[object DocumentTimeline]" +PASS Animation can be constructed with null effect and non-null timeline +PASS Animation can be constructed with null effect and no timeline parameter +FAIL Animation can be constructed with non-null effect and null timeline assert_equals: Animation timeline should be null expected null but got object "[object DocumentTimeline]" +PASS Animation can be constructed with non-null effect and non-null timeline +PASS Animation can be constructed with non-null effect and no timeline parameter +PASS Animation constructed by an effect with null target runs normally +PASS Animation constructed with a keyframe that target element is in iframe Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect-expected.txt deleted file mode 100644 index 5e92030..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -FAIL effect is set correctly. Animation is not defined -PASS Clearing and setting Animation.effect should update the computed style of the target element -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish-expected.txt deleted file mode 100644 index bd053d2e..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -This is a testharness.js-based test. -PASS Test exceptions when finishing non-running animation -PASS Test exceptions when finishing infinite animation -PASS Test finishing of animation -PASS Test finishing of animation with a current time past the effect end -PASS Test finishing of reversed animation -PASS Test finishing of reversed animation with a current time less than zero -PASS Test finish() while paused -PASS Test finish() while pause-pending with positive playbackRate -PASS Test finish() while pause-pending with negative playbackRate -PASS Test finish() while play-pending -PASS Test finish() during aborted pause -PASS Test resetting of computed style -PASS Test finish() resolves finished promise synchronously -FAIL Test finish() resolves finished promise synchronously with an animation without a target Animation is not defined -FAIL Test normally finished animation resolves finished promise synchronously with an animation without a target Animation is not defined -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness-expected.txt index 9f776af9..ef03e50 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness-expected.txt
@@ -1,41 +1,41 @@ This is a testharness.js-based test. PASS Animation interface automated IDL tests -FAIL Animation interface: existence and properties of interface object assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface object length assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface object name assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: existence and properties of interface prototype object assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute id assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute effect assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute timeline assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute startTime assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute currentTime assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute playbackRate assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute playState assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute ready assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute finished assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute onfinish assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: attribute oncancel assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: operation cancel() assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: operation finish() assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: operation play() assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: operation pause() assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: operation reverse() assert_own_property: self does not have own property "Animation" expected property "Animation" missing -FAIL Animation interface: new Animation() must inherit property "id" with the proper type (0) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "effect" with the proper type (1) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "timeline" with the proper type (2) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "startTime" with the proper type (3) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "currentTime" with the proper type (4) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "playbackRate" with the proper type (5) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "playState" with the proper type (6) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "ready" with the proper type (7) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "finished" with the proper type (8) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "onfinish" with the proper type (9) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "oncancel" with the proper type (10) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "cancel" with the proper type (11) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "finish" with the proper type (12) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "play" with the proper type (13) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "pause" with the proper type (14) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" -FAIL Animation interface: new Animation() must inherit property "reverse" with the proper type (15) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Animation is not defined" +PASS Animation interface: existence and properties of interface object +PASS Animation interface object length +PASS Animation interface object name +PASS Animation interface: existence and properties of interface prototype object +PASS Animation interface: existence and properties of interface prototype object's "constructor" property +PASS Animation interface: attribute id +PASS Animation interface: attribute effect +FAIL Animation interface: attribute timeline assert_equals: setter must be function for PutForwards, Replaceable, or non-readonly attributes expected "function" but got "undefined" +PASS Animation interface: attribute startTime +PASS Animation interface: attribute currentTime +PASS Animation interface: attribute playbackRate +PASS Animation interface: attribute playState +FAIL Animation interface: attribute ready Illegal invocation +FAIL Animation interface: attribute finished Illegal invocation +PASS Animation interface: attribute onfinish +PASS Animation interface: attribute oncancel +PASS Animation interface: operation cancel() +PASS Animation interface: operation finish() +PASS Animation interface: operation play() +PASS Animation interface: operation pause() +PASS Animation interface: operation reverse() +PASS Animation interface: new Animation() must inherit property "id" with the proper type (0) +PASS Animation interface: new Animation() must inherit property "effect" with the proper type (1) +PASS Animation interface: new Animation() must inherit property "timeline" with the proper type (2) +PASS Animation interface: new Animation() must inherit property "startTime" with the proper type (3) +PASS Animation interface: new Animation() must inherit property "currentTime" with the proper type (4) +PASS Animation interface: new Animation() must inherit property "playbackRate" with the proper type (5) +PASS Animation interface: new Animation() must inherit property "playState" with the proper type (6) +PASS Animation interface: new Animation() must inherit property "ready" with the proper type (7) +PASS Animation interface: new Animation() must inherit property "finished" with the proper type (8) +PASS Animation interface: new Animation() must inherit property "onfinish" with the proper type (9) +PASS Animation interface: new Animation() must inherit property "oncancel" with the proper type (10) +PASS Animation interface: new Animation() must inherit property "cancel" with the proper type (11) +PASS Animation interface: new Animation() must inherit property "finish" with the proper type (12) +PASS Animation interface: new Animation() must inherit property "play" with the proper type (13) +PASS Animation interface: new Animation() must inherit property "pause" with the proper type (14) +PASS Animation interface: new Animation() must inherit property "reverse" with the proper type (15) Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime-expected.txt deleted file mode 100644 index 420d718..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -FAIL startTime of a newly created (idle) animation is unresolved Animation is not defined -FAIL startTime of a play-pending animation is unresolved Animation is not defined -FAIL startTime of a pause-pending animation is unresolved Animation is not defined -PASS startTime of a play-pending animation created using Element.animate shortcut is unresolved -PASS startTime is resolved when running -PASS startTime and currentTime are unresolved when animation is cancelled -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations-expected.txt index a4a1451..58e88962 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations-expected.txt
@@ -2,6 +2,6 @@ FAIL Test document.getAnimations for non-animated content document.getAnimations is not a function FAIL Test document.getAnimations for script-generated animations document.getAnimations is not a function FAIL Test the order of document.getAnimations with script generated animations document.getAnimations is not a function -FAIL Test document.getAnimations with null target Animation is not defined +FAIL Test document.getAnimations with null target document.getAnimations is not a function Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setTarget-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setTarget-expected.txt index 421c9d96..ffde75e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setTarget-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setTarget-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. -FAIL Test setting target before constructing the associated animation Animation is not defined -FAIL Test setting target from null to a valid target Animation is not defined +FAIL Test setting target before constructing the associated animation assert_equals: Value at 50% progress expected "50px" but got "0px" +FAIL Test setting target from null to a valid target assert_equals: Value at 50% progress after setting new target expected "50px" but got "10px" FAIL Test setting target from a valid target to null assert_equals: Value after clearing the target expected "10px" but got "50px" FAIL Test setting target from a valid target to another target assert_equals: Value of 1st element (currently not targeted) after changing the effect target expected "10px" but got "50px" FAIL Test falling back to distribute spacing mode after setting null target anim.effect.getKeyframes is not a function
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time-expected.txt deleted file mode 100644 index c940473..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -This is a testharness.js-based test. -FAIL The current time returns the hold time when set Animation is not defined -FAIL The current time is unresolved when there is no associated timeline (and no hold time is set) Animation is not defined -FAIL The current time is unresolved when the start time is unresolved (and no hold time is set) Animation is not defined -FAIL The current time is calculated from the timeline time, start time and playback rate Animation is not defined -PASS The current time does not progress if playback rate is 0 -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation-expected.txt index a1c3d41..e95ca8f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation-expected.txt
@@ -13,6 +13,6 @@ PASS Reversing animation when playbackRate = 0 and currentTime < 0 and the target effect end is positive infinity should NOT throw an exception PASS Reversing an animation when playbackRate < 0 and currentTime < 0 and the target effect end is positive infinity should make it play from the start PASS Reversing when when playbackRate == 0 should preserve the current time and playback rate -FAIL Reversing an animation without an active timeline throws an InvalidStateError Animation is not defined +FAIL Reversing an animation without an active timeline throws an InvalidStateError assert_throws: function "function () { animation.reverse(); }" did not throw Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt deleted file mode 100644 index b74e20b..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -This is a testharness.js-based test. -FAIL Setting the start time of an animation without an active timeline Animation is not defined -FAIL Setting an unresolved start time an animation without an active timeline does not clear the current time Animation is not defined -FAIL Setting the start time clears the hold time Animation is not defined -FAIL Setting an unresolved start time sets the hold time Animation is not defined -FAIL Setting the start time resolves a pending ready promise Animation is not defined -FAIL Setting the start time resolves a pending pause task Animation is not defined -FAIL Setting the start time updates the finished state Animation is not defined -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt index 1e32713..d48b72a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt
@@ -1,8 +1,9 @@ This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = assert_equals: ready promise is rejected with AbortError expected "AbortError" but got "Error" FAIL If new effect is null and old effect is not null, we reset the pending tasks and ready promise is rejected assert_equals: expected "paused" but got "pending" -FAIL If animation has a pending pause task, reschedule that task to run as soon as animation is ready. Animation is not defined -FAIL If animation has a pending play task, reschedule that task to run as soon as animation is ready to play new effect. Animation is not defined -FAIL When setting the effect of an animation to the effect of an existing animation, the existing animation's target effect should be set to null. Animation is not defined -FAIL After setting the target effect of animation to the target effect of an existing animation, the target effect's timing is updated to reflect the current time of the new animation. Animation is not defined +PASS If animation has a pending pause task, reschedule that task to run as soon as animation is ready. +PASS If animation has a pending play task, reschedule that task to run as soon as animation is ready to play new effect. +FAIL When setting the effect of an animation to the effect of an existing animation, the existing animation's target effect should be set to null. assert_equals: expected "finished" but got "idle" +PASS After setting the target effect of animation to the target effect of an existing animation, the target effect's timing is updated to reflect the current time of the new animation. Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt index dbd4b8b..88093d4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt
@@ -1,21 +1,21 @@ This is a testharness.js-based test. -FAIL After setting timeline on paused animation it is still paused Animation is not defined -FAIL After setting timeline on animation paused outside active interval it is still paused Animation is not defined -FAIL After setting timeline on an idle animation without a start time it is still idle Animation is not defined -FAIL After setting timeline on an idle animation with a start time it is running Animation is not defined -FAIL After setting timeline on an idle animation with a sufficiently ancient start time it is finished Animation is not defined -FAIL After setting timeline on a play-pending animation it is still pending Animation is not defined -FAIL After setting timeline on a play-pending animation it begins playing after pending Animation is not defined -FAIL After setting timeline on a pause-pending animation it is still pending Animation is not defined -FAIL After setting timeline on a pause-pending animation it becomes paused after pending Animation is not defined -FAIL After clearing timeline on paused animation it is still paused Animation is not defined -FAIL After clearing timeline on finished animation it is idle Animation is not defined -FAIL After clearing timeline on running animation it is idle Animation is not defined -FAIL After clearing timeline on idle animation it is still idle Animation is not defined +FAIL After setting timeline on paused animation it is still paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on animation paused outside active interval it is still paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on an idle animation without a start time it is still idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on an idle animation with a start time it is running assert_equals: expected "idle" but got "running" +FAIL After setting timeline on an idle animation with a sufficiently ancient start time it is finished assert_equals: expected "idle" but got "finished" +FAIL After setting timeline on a play-pending animation it is still pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on a play-pending animation it begins playing after pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on a pause-pending animation it is still pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on a pause-pending animation it becomes paused after pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on paused animation it is still paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on finished animation it is idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on running animation it is idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on idle animation it is still idle Cannot assign to read only property 'timeline' of object '#<Animation>' FAIL After clearing timeline on play-pending animation it is still pending Cannot assign to read only property 'timeline' of object '#<Animation>' FAIL After clearing and re-setting timeline on play-pending animation it begins to play Cannot assign to read only property 'timeline' of object '#<Animation>' -FAIL After clearing timeline on a pause-pending animation it is still pending Animation is not defined -FAIL After clearing and re-setting timeline on a pause-pending animation it becomes paused Animation is not defined -FAIL After clearing and re-setting timeline on an animation in the middle of an aborted pause, it continues playing using the same start time Animation is not defined +FAIL After clearing timeline on a pause-pending animation it is still pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing and re-setting timeline on a pause-pending animation it becomes paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing and re-setting timeline on an animation in the middle of an aborted pause, it continues playing using the same start time Cannot assign to read only property 'timeline' of object '#<Animation>' Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt index dadc820c..fb6ac1ef 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
@@ -68,7 +68,9 @@ PASS oldChildWindow.onanimationend is newChildWindow.onanimationend PASS oldChildWindow.onanimationiteration is newChildWindow.onanimationiteration PASS oldChildWindow.onanimationstart is newChildWindow.onanimationstart +PASS oldChildWindow.onappinstalled is newChildWindow.onappinstalled PASS oldChildWindow.onauxclick is newChildWindow.onauxclick +PASS oldChildWindow.onbeforeinstallprompt is newChildWindow.onbeforeinstallprompt PASS oldChildWindow.onbeforeunload is newChildWindow.onbeforeunload PASS oldChildWindow.onblur is newChildWindow.onblur PASS oldChildWindow.oncancel is newChildWindow.oncancel
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt index ff8d5746..e1af57f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -40,7 +40,9 @@ PASS childWindow.onanimationend is null PASS childWindow.onanimationiteration is null PASS childWindow.onanimationstart is null +PASS childWindow.onappinstalled is null PASS childWindow.onauxclick is null +PASS childWindow.onbeforeinstallprompt is null PASS childWindow.onbeforeunload is null PASS childWindow.onblur is null PASS childWindow.oncancel is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt index 94999b5..012fb107 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -40,7 +40,9 @@ PASS childWindow.onanimationend is null PASS childWindow.onanimationiteration is null PASS childWindow.onanimationstart is null +PASS childWindow.onappinstalled is null PASS childWindow.onauxclick is null +PASS childWindow.onbeforeinstallprompt is null PASS childWindow.onbeforeunload is null PASS childWindow.onblur is null PASS childWindow.oncancel is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html index dac3bf5..77d1193 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
@@ -17,45 +17,45 @@ }, "DOMMatrixReadOnly transformPoint() - 3d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); var point = matrix2d.transformPoint(new DOMPoint(5)); - assert_dom_point_equals(point, new DOMPoint(20, 10, 0, 1)); + assert_dom_point_equals(point, new DOMPoint(10, 16, 0, 1)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 2d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); var point = matrix2d.transformPoint(new DOMPoint(5, 0, 0, 0)); - assert_dom_point_equals(point, new DOMPoint(10, 0, 0, 0)); + assert_dom_point_equals(point, new DOMPoint(5, 10, 0, 0)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 2d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); var point = matrix2d.transformPoint(new DOMPoint(5, 4)); - assert_dom_point_equals(point, new DOMPoint(20, 18, 0, 1)); + assert_dom_point_equals(point, new DOMPoint(22, 32, 0, 1)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 2d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); var point = matrix2d.transformPoint(new DOMPoint(5, 4, 0, 0)); - assert_dom_point_equals(point, new DOMPoint(10, 8, 0, 0)); + assert_dom_point_equals(point, new DOMPoint(17, 26, 0, 0)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 2d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3)); - assert_dom_point_equals(point, new DOMPoint(20, 18, 3, 1)); + assert_dom_point_equals(point, new DOMPoint(22, 32, 3, 1)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 2d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3, 0)); - assert_dom_point_equals(point, new DOMPoint(10, 8, 3, 0)); + assert_dom_point_equals(point, new DOMPoint(17, 26, 3, 0)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 2d matrix"); test(function() { - var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]); - var point = matrix2d.transformPoint(new DOMPoint(5, 4, 14, 5)); - assert_dom_point_equals(point, new DOMPoint(60, 58, 14, 5)); + var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); + var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3, 2)); + assert_dom_point_equals(point, new DOMPoint(27, 38, 3, 2)); }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 2d matrix"); test(function() {
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-point-readonly.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-point-readonly.html index 3729453..c766777 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-point-readonly.html +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-point-readonly.html
@@ -65,8 +65,8 @@ test(() => { var point = new DOMPointReadOnly(5, 4); - var transformed_point = point.matrixTransform(new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10])); - assert_dom_point_equals(transformed_point, new DOMPoint(20, 18)); + var transformed_point = point.matrixTransform(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6])); + assert_dom_point_equals(transformed_point, new DOMPoint(22, 32)); }, 'DOMMatrixReadOnly.matrixTransform() - 2d matrixTransform'); test(() => {
diff --git a/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions-expected.txt b/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions-expected.txt index 0bb3a46..a82d9a1 100644 --- a/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions-expected.txt
@@ -3,9 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS t.caption = null threw exception NotFoundError: Failed to set the 'caption' property on 'HTMLTableElement': The new child element is null.. PASS t.caption = document.body threw exception TypeError: Failed to set the 'caption' property on 'HTMLTableElement': The provided value is not of type 'HTMLTableCaptionElement'.. -PASS t.tHead = null threw exception NotFoundError: Failed to set the 'tHead' property on 'HTMLTableElement': The new child element is null.. PASS t.tHead = document.body threw exception TypeError: Failed to set the 'tHead' property on 'HTMLTableElement': The provided value is not of type 'HTMLTableSectionElement'.. PASS t.createTFoot() is t.tFoot PASS t.tFoot is non-null.
diff --git a/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions.html b/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions.html index f0ef597..ebf5814 100644 --- a/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions.html +++ b/third_party/WebKit/LayoutTests/html/tabular_data/table_exceptions.html
@@ -9,12 +9,8 @@ var t = document.createElement('table'); - // TODO(foolip): Setting caption/tHead to null should not throw - // an exception, it should just remove the old caption/thead. - shouldThrow("t.caption = null"); shouldThrow("t.caption = document.body"); - shouldThrow("t.tHead = null"); shouldThrow("t.tHead = document.body"); shouldBe("t.createTFoot()", "t.tFoot");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js index dfbfc82..d56f7dbc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -585,11 +585,9 @@ InspectorTest.deprecatedRunAfterPendingDispatches = function(callback) { - var barrier = new CallbackBarrier(); var targets = SDK.targetManager.targets(); - for (var i = 0; i < targets.length; ++i) - targets[i]._deprecatedRunAfterPendingDispatches(barrier.createCallback()); - barrier.callWhenDone(InspectorTest.safeWrap(callback)); + var promises = targets.map(target => new Promise(resolve => target._deprecatedRunAfterPendingDispatches(resolve))); + Promise.all(promises).then(InspectorTest.safeWrap(callback)); } InspectorTest.createKeyEvent = function(key, ctrlKey, altKey, shiftKey, metaKey)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html index 57e07961..8328f30 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html
@@ -9,43 +9,27 @@ InspectorTest.runAfterResourcesAreFinished(["search.js"], step2); var resource; - function step2() + async function step2() { resource = Bindings.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); InspectorTest.addResult(resource.url); // This file should not match search query. var text = "searchTest" + "UniqueString"; - resource.searchInContent(text, false, false, step3); - } - - function step3(searchMatches) - { + var searchMatches = await resource.searchInContent(text, false, false); InspectorTest.dumpSearchMatches(searchMatches); // This file should not match search query. var text = "searchTest" + "UniqueString"; - resource.searchInContent(text, true, false, step4); - } - - function step4(searchMatches) - { + searchMatches = await resource.searchInContent(text, true, false); InspectorTest.dumpSearchMatches(searchMatches); var text = "[a-z]earchTestUniqueString"; - resource.searchInContent(text, false, true, step5); - } - - function step5(searchMatches) - { + searchMatches = await resource.searchInContent(text, false, true); InspectorTest.dumpSearchMatches(searchMatches); var text = "[a-z]earchTestUniqueString"; - resource.searchInContent(text, true, true, step6); - } - - function step6(searchMatches) - { + searchMatches = await resource.searchInContent(text, true, true); InspectorTest.dumpSearchMatches(searchMatches); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-script.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-script.html index 989cb0c..493dfdf 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-script.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-script.html
@@ -20,7 +20,7 @@ InspectorTest.showScriptSource("search.js", step3); } - function step3() + async function step3() { var url = "http://127.0.0.1:8000/inspector/search/resources/search.js"; var scripts = InspectorTest.queryScripts(function(s) { return s.sourceURL === url; }); @@ -29,36 +29,20 @@ // This file should not match search query. var text = "searchTest" + "UniqueString"; - script.searchInContent(text, false, false, step4); - } - - function step4(searchMatches) - { + var searchMatches = await script.searchInContent(text, false, false); InspectorTest.dumpSearchMatches(searchMatches); // This file should not match search query. var text = "searchTest" + "UniqueString"; - script.searchInContent(text, true, false, step5); - } - - function step5(searchMatches) - { + searchMatches = await script.searchInContent(text, true, false); InspectorTest.dumpSearchMatches(searchMatches); var text = "[a-z]earchTestUniqueString"; - script.searchInContent(text, false, true, step6); - } - - function step6(searchMatches) - { + searchMatches = await script.searchInContent(text, false, true); InspectorTest.dumpSearchMatches(searchMatches); var text = "[a-z]earchTestUniqueString"; - script.searchInContent(text, true, true, step7); - } - - function step7(searchMatches) - { + searchMatches = await script.searchInContent(text, true, true); InspectorTest.dumpSearchMatches(searchMatches); InspectorTest.completeDebuggerTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html index 844bc7a..1e56057 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html
@@ -16,41 +16,25 @@ resource.requestContent().then(step3); } - function step3() + async function step3() { staticContentProvider = Common.StaticContentProvider.fromString("", Common.resourceTypes.Script, resource.content); InspectorTest.addResult(resource.url); var text = "searchTestUniqueString"; - staticContentProvider.searchInContent(text, true, false, step4); - } - - function step4(searchMatches) - { + var searchMatches = await staticContentProvider.searchInContent(text, true, false); InspectorTest.dumpSearchMatches(searchMatches); var text = "searchTestUniqueString"; - staticContentProvider.searchInContent(text, true, false, step5); - } - - function step5(searchMatches) - { + searchMatches = await staticContentProvider.searchInContent(text, true, false); InspectorTest.dumpSearchMatches(searchMatches); var text = "[a-z]earchTestUniqueString"; - staticContentProvider.searchInContent(text, false, true, step6); - } - - function step6(searchMatches) - { + searchMatches = await staticContentProvider.searchInContent(text, false, true); InspectorTest.dumpSearchMatches(searchMatches); var text = "[a-z]earchTestUniqueString"; - staticContentProvider.searchInContent(text, true, true, step7); - } - - function step7(searchMatches) - { + searchMatches = await staticContentProvider.searchInContent(text, true, true); InspectorTest.dumpSearchMatches(searchMatches); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php index 23e38e7..f71fd5b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php +++ b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php
@@ -1,50 +1,59 @@ <?php -$cors_arg = strtolower($_GET["cors"]); -if ($cors_arg != "false") { - if ($cors_arg == "" || $cors_arg == "true") { - header("Access-Control-Allow-Origin: http://127.0.0.1:8000"); - } else { - header("Access-Control-Allow-Origin: " . $cors_arg . ""); - } +$cors_arg = strtolower($_GET['cors']); +if ($cors_arg != 'false') { + if ($cors_arg == '' || $cors_arg == 'true') { + header('Access-Control-Allow-Origin: http://127.0.0.1:8000'); + } else { + header('Access-Control-Allow-Origin: ' . $cors_arg); + } } -if (strtolower($_GET["credentials"]) == "true") { - header("Access-Control-Allow-Credentials: true"); + +if (strtolower($_GET['credentials']) == 'true') { + header('Access-Control-Allow-Credentials: true'); } -$custom_header_arg = strtolower($_GET["custom"]); + +$custom_header_arg = strtolower($_GET['custom']); if (!(empty($custom_header_arg))) { - header("Access-Control-Allow-Headers: " . $custom_header_arg); + header('Access-Control-Allow-Headers: ' . $custom_header_arg); } -$suborigin_arg = strtolower($_GET["suborigin"]); +$suborigin_arg = strtolower($_GET['suborigin']); if (!(empty($suborigin_arg))) { - header("Access-Control-Allow-Suborigin: " . $suborigin_arg); + header('Access-Control-Allow-Suborigin: ' . $suborigin_arg); } -if ($_SERVER["HTTP_SUBORIGIN"] == "foobar") { - header("Access-Control-Allow-Suborigin: foobar"); +if ($_SERVER['HTTP_SUBORIGIN'] == 'foobar') { + header('Access-Control-Allow-Suborigin: foobar'); } -header("Content-Type: application/javascript"); +header('Content-Type: application/javascript'); + $delay = $_GET['delay']; if ($delay) - usleep(1000 * $delay); -$value = $_GET['value']; -$result_var = "result"; -if (!empty($_GET["resultvar"])) { - $result_var = $_GET["resultvar"]; -} -$cookie = $_GET['cookie']; -if ($_SERVER['HTTP_ORIGIN'] && $_GET['value_cors']) { - $value = $_GET['value_cors']; -} -if ($value || $cookie) { - if ($cookie) { - $value = $_COOKIE[$cookie]; - } + usleep(1000 * $delay); - echo $result_var . " = \"" . $value . "\";"; -} else if (strtolower($_GET["fail"]) == "true") - echo "throw({toString: function(){ return 'SomeError' }});"; -else - echo "alert('script ran.');"; +if ($_SERVER['HTTP_ORIGIN'] && $_GET['value_cors']) { + $value = $_GET['value_cors']; +} else { + $value = $_GET['value']; +} + +$cookie = $_GET['cookie']; + +if ($value || $cookie) { + if ($cookie) { + $value = $_COOKIE[$cookie]; + } + + $result_var = 'result'; + if (!empty($_GET['resultvar'])) { + $result_var = $_GET['resultvar']; + } + + echo $result_var . " = \"" . $value . "\";"; +} else if (strtolower($_GET['fail']) == 'true') { + echo "throw({toString: function(){ return 'SomeError' }});"; +} else { + echo "alert('script ran.');"; +} ?>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-eventsource.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-eventsource.php index d558429b..c7e8017 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-eventsource.php +++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-eventsource.php
@@ -26,23 +26,21 @@ function xorigin_creds_event_source(acao_value) { return gen_cors_src(xorigin_creds_event_source_string, acao_value); } -function xorigin_ineligible_event_source(acao_value) { +function xorigin_ineligible_event_source() { return gen_cors_src(xorigin_ineligible_event_source_string); } // EventSource tests -var SuboriginEventSourceTest = function(pass, name, src, crossorigin_value) { +var SuboriginEventSourceTest = function(pass, name, src, withCredentials) { SuboriginTest.call( - this, pass, 'EventSource: ' + name, src, crossorigin_value); + this, pass, 'EventSource: ' + name, src, withCredentials); } SuboriginEventSourceTest.prototype.execute = function() { var test = async_test(this.name); var pass = this.pass; - var options = {}; - - if (this.crossorigin_value === 'use-credentials') { - options.withCredentials = 'include'; + var options = { + withCredentials: this.withCredentials } var es = new EventSource(this.src, options); @@ -67,25 +65,25 @@ false, 'anonymous, ACAO: ' + server, xorigin_anon_event_source(), - 'anonymous').execute(); + false).execute(); new SuboriginEventSourceTest( true, 'anonymous, ACAO: *', xorigin_anon_event_source('*'), - 'anonymous').execute(); + true).execute(); new SuboriginEventSourceTest( false, 'use-credentials, ACAO: ' + server, xorigin_creds_event_source(), - 'use-credentials').execute(); + true).execute(); new SuboriginEventSourceTest( false, 'anonymous, CORS-ineligible resource', xorigin_ineligible_event_source(), - 'anonymous').execute(); + false).execute(); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-unsafe-credentials.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-unsafe-credentials.php index 22197e2..a65ff3b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-unsafe-credentials.php +++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-unsafe-credentials.php
@@ -72,7 +72,7 @@ 'physical origin'); async_test( - xhr_test(same_physical_origin_with_redirect_url, 'result1', 'cookieisset'), + xhr_test(same_physical_origin_with_redirect_url, 'result1', ''), '\'unsafe-credentials\' forces credentials across redirect with XHR to ' + 'same physical origin'); @@ -100,7 +100,7 @@ 'Fetch to same physical origin'); promise_test( - fetch_test(same_physical_origin_with_redirect_url, 'result1', 'cookieisset'), + fetch_test(same_physical_origin_with_redirect_url, 'result1', ''), '\'unsafe-credentials\' forces credentials across redirect with ' + 'same-origin Fetch to same physical origin');
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/dom-search-crash.html b/third_party/WebKit/LayoutTests/inspector/elements/dom-search-crash.html index 70458b4..945247d 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/dom-search-crash.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/dom-search-crash.html
@@ -12,7 +12,7 @@ function testNoCrash(next) { - InspectorTest.domModel.performSearch("FooBar", false, next); + InspectorTest.domModel.performSearch("FooBar", false).then(next); } ]); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html index 6f3b1f3..5574b43 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html
@@ -55,116 +55,116 @@ function testPlainText(next) { - InspectorTest.domModel.performSearch("Fo" + "o" + "Bar", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("Fo" + "o" + "Bar", false).then(searchCallback.bind(this, next)); }, function testPartialText(next) { - InspectorTest.domModel.performSearch("oo" + "Ba", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("oo" + "Ba", false).then(searchCallback.bind(this, next)); }, function testStartTag(next) { - InspectorTest.domModel.performSearch("<inpu" + "t", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("<inpu" + "t", false).then(searchCallback.bind(this, next)); }, function testEndTag(next) { - InspectorTest.domModel.performSearch("npu" + "t>", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("npu" + "t>", false).then(searchCallback.bind(this, next)); }, function testPartialTag(next) { - InspectorTest.domModel.performSearch("npu" + "t", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("npu" + "t", false).then(searchCallback.bind(this, next)); }, function testPartialAbsentTagStart(next) { - InspectorTest.domModel.performSearch("<npu" + "t", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("<npu" + "t", false).then(searchCallback.bind(this, next)); }, function testPartialAbsentTagEnd(next) { - InspectorTest.domModel.performSearch("npu" + ">", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("npu" + ">", false).then(searchCallback.bind(this, next)); }, function testFullTag(next) { - InspectorTest.domModel.performSearch("<inpu" + "t>", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("<inpu" + "t>", false).then(searchCallback.bind(this, next)); }, function testExactAttributeName(next) { - InspectorTest.domModel.performSearch("valu" + "e", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("valu" + "e", false).then(searchCallback.bind(this, next)); }, function testExactAttributeVal_ue(next) { - InspectorTest.domModel.performSearch("In" + "putVa" + "l", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("In" + "putVa" + "l", false).then(searchCallback.bind(this, next)); }, function testExactAttributeVal_ueOnRoot(next) { omitInnerHTML = true; - InspectorTest.domModel.performSearch("documen" + "tElement", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("documen" + "tElement", false).then(searchCallback.bind(this, next)); }, function testExactAttributeVal_ueWithQuotes(next) { omitInnerHTML = false; - InspectorTest.domModel.performSearch("\"fo" + "o\"", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("\"fo" + "o\"", false).then(searchCallback.bind(this, next)); }, function testPartialAttributeVal_ue(next) { - InspectorTest.domModel.performSearch("n" + "putVa" + "l", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("n" + "putVa" + "l", false).then(searchCallback.bind(this, next)); }, function testXPathAttribute(next) { - InspectorTest.domModel.performSearch("//html" + "//@attr", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("//html" + "//@attr", false).then(searchCallback.bind(this, next)); }, function testSelector(next) { - InspectorTest.domModel.performSearch("d" + "iv.divclass span", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("d" + "iv.divclass span", false).then(searchCallback.bind(this, next)); }, function testCaseUpperFindsLower(next) { - InspectorTest.domModel.performSearch("K" +"OO", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("K" +"OO", false).then(searchCallback.bind(this, next)); }, function testCaseLowerFindsUpper(next) { - InspectorTest.domModel.performSearch("c" + "aseless", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("c" + "aseless", false).then(searchCallback.bind(this, next)); }, function testCaseAttribute(next) { - InspectorTest.domModel.performSearch("C" + "AMEL", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("C" + "AMEL", false).then(searchCallback.bind(this, next)); }, function testSearchShadowDOM(next) { - InspectorTest.domModel.performSearch("<c" + "ontent", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("<c" + "ontent", false).then(searchCallback.bind(this, next)); }, function testSearchUAShadowDOM(next) { InspectorTest.addResult("Searching UA shadow DOM with setting disabled:") - InspectorTest.domModel.performSearch("inne" + "r-editor", false, searchCallback.bind(this, step2)); + InspectorTest.domModel.performSearch("inne" + "r-editor", false).then(searchCallback.bind(this, step2)); function step2() { InspectorTest.addResult("Searching UA shadow DOM with setting enabled:") - InspectorTest.domModel.performSearch("inne" + "r-editor", true, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("inne" + "r-editor", true).then(searchCallback.bind(this, next)); } }, function testSearchShadowHostChildren(next) { - InspectorTest.domModel.performSearch("shadow-host-c" + "ontent", false, searchCallback.bind(this, next)); + InspectorTest.domModel.performSearch("shadow-host-c" + "ontent", false).then(searchCallback.bind(this, next)); }, ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-expected.txt index 980fd7d..382fdb4 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-expected.txt
@@ -333,59 +333,6 @@ debuggerModel.removeBreakpoint(b.js:3) Dumping Breakpoint Locations -Running: testSourceMapping - Created breakpoints manager - Dumping Storage - a.js:10 enabled:true condition:foo == bar - a.js:20 enabled:true condition: - Adding script: a.js - Adding UISourceCode: a.js - breakpointAdded(a.js, 10, 0, foo == bar, true) - debuggerModel.setBreakpoint(a.js:10:foo == bar) - breakpointAdded(a.js, 20, 0, , true) - debuggerModel.setBreakpoint(a.js:20:) - breakpointRemoved(a.js, 10, 0) - breakpointAdded(a.js, 10, 0, foo == bar, true) - Location created: a.js:10 - breakpointRemoved(a.js, 20, 0) - breakpointAdded(a.js, 20, 0, , true) - Location created: a.js:20 - Dumping Breakpoint Locations - UISourceCode (url='a.js', uri='a.js') - Location: (10, 0) - Location: (20, 0) - - Toggling source mapping. - breakpointRemoved(a.js, 10, 0) - breakpointAdded(a.js, 20, 0, foo == bar, true) - breakpointRemoved(a.js, 20, 0) - breakpointAdded(a.js, 30, 0, , true) - Dumping Breakpoint Locations - UISourceCode (url='a.js', uri='a.js') - Location: (20, 0) - Location: (30, 0) - - Toggling source mapping back. - breakpointRemoved(a.js, 20, 0) - breakpointAdded(a.js, 10, 0, foo == bar, true) - breakpointRemoved(a.js, 30, 0) - breakpointAdded(a.js, 20, 0, , true) - Dumping Breakpoint Locations - UISourceCode (url='a.js', uri='a.js') - Location: (10, 0) - Location: (20, 0) - Dumping Storage - a.js:10 enabled:true condition:foo == bar - a.js:20 enabled:true condition: - Resetting breakpoint manager - breakpointRemoved(a.js, 10, 0) - Location disposed: a.js:10 - debuggerModel.removeBreakpoint(a.js:10) - breakpointRemoved(a.js, 20, 0) - Location disposed: a.js:20 - debuggerModel.removeBreakpoint(a.js:20) - Dumping Breakpoint Locations - Running: testProvisionalBreakpointsResolve Created breakpoints manager Dumping Storage @@ -419,59 +366,6 @@ debuggerModel.removeBreakpoint(a.js:10) Dumping Breakpoint Locations -Running: testSourceMappingReload - Created breakpoints manager - Dumping Storage - b.js:20 enabled:true condition:foo == bar - - Adding files: - Adding script: a.js - Adding UISourceCode: a.js - Adding UISourceCode: b.js - breakpointAdded(b.js, 20, 0, foo == bar, true) - debuggerModel.setBreakpoint(b.js:20:foo == bar) - - Toggling source mapping. - debuggerModel.removeBreakpoint(b.js:20) - debuggerModel.setBreakpoint(a.js:10:foo == bar) - breakpointRemoved(b.js, 20, 0) - breakpointAdded(b.js, 20, 0, foo == bar, true) - Location created: a.js:10 - Dumping Breakpoint Locations - UISourceCode (url='b.js', uri='b.js') - Location: (20, 0) - - Reloading: - Resetting debugger. - Resetting workspace. - breakpointRemoved(b.js, 20, 0) - Location disposed: a.js:10 - - Adding files: - Adding script: a.js - breakpointAdded(debugger:///VMa.js a.js, 10, 0, foo == bar, true) - Location created: a.js:10 - Adding UISourceCode: a.js - breakpointRemoved(debugger:///VMa.js a.js, 10, 0) - breakpointAdded(a.js, 10, 0, foo == bar, true) - breakpointRemoved(a.js, 10, 0) - breakpointAdded(a.js, 10, 0, foo == bar, true) - Adding UISourceCode: b.js - - Toggling source mapping. - breakpointRemoved(a.js, 10, 0) - breakpointAdded(b.js, 20, 0, foo == bar, true) - Dumping Breakpoint Locations - UISourceCode (url='b.js', uri='b.js') - Location: (20, 0) - Dumping Storage - b.js:20 enabled:true condition:foo == bar - Resetting breakpoint manager - breakpointRemoved(b.js, 20, 0) - Location disposed: a.js:10 - debuggerModel.removeBreakpoint(a.js:10) - Dumping Breakpoint Locations - Running: testBreakpointInCollectedReload Created breakpoints manager Dumping Storage
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html index c896fa09..3b3825c 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html
@@ -173,54 +173,6 @@ } }, - function testSourceMapping(next) - { - var shiftingMapping = { - rawLocationToUILocation: function(rawLocation) - { - if (this._disabled) - return null; - return InspectorTest.uiSourceCodes[rawLocation.scriptId].uiLocation(rawLocation.lineNumber + 10, 0); - }, - - uiLocationToRawLocation: function(uiSourceCode, lineNumber) - { - return new SDK.DebuggerModel.Location(mockTarget.debuggerModel, uiSourceCode.url(), lineNumber - 10, 0); - }, - - isIdentity: function() - { - return false; - } - }; - - // Source mapping will shift everything 10 lines ahead so that breakpoint 1 clashes with breakpoint 2. - var serializedBreakpoints = []; - serializedBreakpoints.push(createBreakpoint("a.js", 10, "foo == bar", true)); - serializedBreakpoints.push(createBreakpoint("a.js", 20, "", true)); - - var breakpointManager = createBreakpointManager(serializedBreakpoints); - var uiSourceCodeA = addUISourceCode(breakpointManager, "a.js"); - window.setBreakpointCallback = step2.bind(this); - - function step2() - { - window.setBreakpointCallback = step3.bind(this); - } - - function step3() - { - InspectorTest.dumpBreakpointLocations(breakpointManager); - InspectorTest.addResult("\n Toggling source mapping."); - mockTarget.debuggerModel.pushSourceMapping(shiftingMapping); - InspectorTest.dumpBreakpointLocations(breakpointManager); - InspectorTest.addResult("\n Toggling source mapping back."); - mockTarget.debuggerModel.disableSourceMapping(shiftingMapping); - InspectorTest.finishBreakpointTest(breakpointManager, next); - } - - }, - function testProvisionalBreakpointsResolve(next) { var serializedBreakpoints = []; @@ -243,69 +195,6 @@ } }, - function testSourceMappingReload(next) - { - function createSourceMapping(uiSourceCodeA, uiSourceCodeB) - { - var mapping = { - rawLocationToUILocation: function(rawLocation) - { - if (this._disabled) - return null; - return uiSourceCodeB.uiLocation(rawLocation.lineNumber + 10, 0); - }, - - uiLocationToRawLocation: function(uiSourceCode, lineNumber) - { - return new SDK.DebuggerModel.Location(mockTarget.debuggerModel, uiSourceCodeA.url(), lineNumber - 10, 0); - }, - - isIdentity: function() - { - return false; - } - }; - - return mapping; - } - // Source mapping will shift everything 10 lines ahead. - var serializedBreakpoints = [createBreakpoint("b.js", 20, "foo == bar", true)]; - var breakpointManager = createBreakpointManager(serializedBreakpoints); - InspectorTest.addResult("\n Adding files:"); - var uiSourceCodeA = addUISourceCode(breakpointManager, "a.js"); - var uiSourceCodeB = addUISourceCode(breakpointManager, "b.js", true, true); - - InspectorTest.addResult("\n Toggling source mapping."); - var sourceMapping = createSourceMapping(uiSourceCodeA, uiSourceCodeB); - mockTarget.debuggerModel.pushSourceMapping(sourceMapping); - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(mockTarget.debuggerModel, uiSourceCodeB, sourceMapping); - InspectorTest.runAfterPendingBreakpointUpdates(breakpointManager, breakpointActionsPerformedBeforeReload.bind(this)); - - function breakpointActionsPerformedBeforeReload() - { - InspectorTest.dumpBreakpointLocations(breakpointManager); - InspectorTest.addResult("\n Reloading:"); - resetWorkspace(breakpointManager); - - InspectorTest.addResult("\n Adding files:"); - InspectorTest.addScript(mockTarget, breakpointManager, "a.js"); - mockTarget.debuggerModel._breakpointResolved("a.js:10", new SDK.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); - uiSourceCodeA = addUISourceCode(breakpointManager, "a.js", false, true); - uiSourceCodeB = addUISourceCode(breakpointManager, "b.js", true, true); - - InspectorTest.addResult("\n Toggling source mapping."); - var sourceMapping = createSourceMapping(uiSourceCodeA, uiSourceCodeB); - mockTarget.debuggerModel.pushSourceMapping(sourceMapping); - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(mockTarget.debuggerModel, uiSourceCodeB, sourceMapping); - InspectorTest.runAfterPendingBreakpointUpdates(breakpointManager, breakpointActionsPerformed.bind(this)); - } - - function breakpointActionsPerformed() - { - InspectorTest.finishBreakpointTest(breakpointManager, next); - } - }, - function testBreakpointInCollectedReload(next) { var breakpointManager = createBreakpointManager();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js index 704c107..5b2a98d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
@@ -183,19 +183,6 @@ this._debuggerWorkspaceBinding._reset(this); } - pushSourceMapping(sourceMapping) - { - for (var scriptId in this._scripts) - this._debuggerWorkspaceBinding.pushSourceMapping(this._scripts[scriptId], sourceMapping); - } - - disableSourceMapping(sourceMapping) - { - sourceMapping._disabled = true; - for (var scriptId in this._scripts) - this._debuggerWorkspaceBinding.updateLocations(this._scripts[scriptId]); - } - addBreakpointListener(breakpointId, listener, thisObject) { this._breakpointResolvedEventTarget.addEventListener(breakpointId, listener, thisObject) @@ -232,7 +219,6 @@ for (var i = 0; i < uiSourceCodes.length; ++i) { var uiSourceCode = uiSourceCodes[i]; if (uiSourceCode.url() === url) { - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target.debuggerModel, uiSourceCode, breakpointManager.defaultMapping); InspectorTest.uiSourceCodes[url] = uiSourceCode; return uiSourceCode; } @@ -253,11 +239,8 @@ InspectorTest.testNetworkProject._addResource(resource); uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url); - //var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); - //var uiSourceCode = InspectorTest.testNetworkProject.addFile(contentProvider, null); InspectorTest.uiSourceCodes[url] = uiSourceCode; if (!doNotSetSourceMapping) { - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target.debuggerModel, uiSourceCode, breakpointManager.defaultMapping); breakpointManager._debuggerWorkspaceBinding.updateLocations(target.debuggerModel.scriptForId(url)); } return uiSourceCode;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search-expected.txt index 7d230748..af20a98 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search-expected.txt
@@ -2,12 +2,12 @@ Pre-format search results: Search matches: -lineNumber: 30, line: ' scriptSource.searchInContent("magic-string", true, false, dump1);' -lineNumber: 44, line: ' scriptSource.searchInContent("magic-string", true, false, dump2);' +lineNumber: 30, line: ' var matches = await scriptSource.searchInContent("magic-string", true, false);' +lineNumber: 40, line: ' var matches = await scriptSource.searchInContent("magic-string", true, false);' Post-format search results: Search matches: -lineNumber: 30, line: ' scriptSource.searchInContent("magic-string", true, false, dump1);' -lineNumber: 44, line: ' scriptSource.searchInContent("magic-string", true, false, dump2);' +lineNumber: 30, line: ' var matches = await scriptSource.searchInContent("magic-string", true, false);' +lineNumber: 40, line: ' var matches = await scriptSource.searchInContent("magic-string", true, false);'
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html index 4c4c6f9..7160867 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html
@@ -25,14 +25,10 @@ InspectorTest.showScriptSource("script-formatter-search.html", didShowScriptSource); } - function didShowScriptSource(frame) + async function didShowScriptSource(frame) { scriptSource = frame._uiSourceCode; - scriptSource.searchInContent("magic-string", true, false, dump1); - } - - function dump1(matches) - { + var matches = await scriptSource.searchInContent("magic-string", true, false); InspectorTest.addResult("Pre-format search results:"); InspectorTest.dumpSearchMatches(matches); shouldRequestContent = true; @@ -40,13 +36,9 @@ scriptFormatter._toggleFormatScriptSource(); } - function uiSourceCodeScriptFormatted() + async function uiSourceCodeScriptFormatted() { - scriptSource.searchInContent("magic-string", true, false, dump2); - } - - function dump2(matches) - { + var matches = await scriptSource.searchInContent("magic-string", true, false); InspectorTest.addResult("Post-format search results:"); InspectorTest.dumpSearchMatches(matches); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html index f00d299..0b065a0 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html
@@ -7,10 +7,9 @@ <video loop></video> <script> async_test(function(t) { - // The cast button should be visible for at least the controlsMouseMovementTimeout, - // and no more than that plus the fadeout time. Allow 500ms margin at either side. + // The cast button should be visible for at least |controlsMouseMovementTimeoutMs|. + // Allow 500ms margin at either side. var hideTimeoutLowerBound = controlsMouseMovementTimeoutMs - 500; - var hideTimeoutUpperBound = controlsMouseMovementTimeoutMs + controlsFadeOutDurationMs + 500; var video = document.querySelector("video"); video.src = findMediaFile("video", "../content/test"); @@ -18,25 +17,16 @@ video.onplaying = t.step_func(function() { setTimeout(t.step_func(function() { // Cast button should be visible - assert_true(isCastButtonVisible(), "button should exist"); + assert_true(isControlVisible(overlayCastButton(video)), "button should exist"); }), hideTimeoutLowerBound); - setTimeout(t.step_func_done(function() { + runAfterHideMediaControlsTimerFired(t.step_func_done(function() { // Cast button should be gone - assert_false(isCastButtonVisible(), "button should not exist"); - }), hideTimeoutUpperBound); + assert_false(isControlVisible(overlayCastButton(video)), "button should not exist"); + }), video); }); internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true); video.play(); - - function isCastButtonVisible() { - var controlID = "-internal-media-controls-overlay-cast-button"; - var button = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID); - var style = getComputedStyle(button); - var visibility = style.getPropertyValue("visibility"); - var display = style.getPropertyValue("display"); - return (display != "none" && visibility == "visible"); - } }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html new file mode 100644 index 0000000..b3be3ac --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<title>media controls overlay cast button for autoplay muted element</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> +<script src="../media-controls.js"></script> +<body></body> +<script> +async_test(function(t) { + t.add_cleanup(function() { + internals.settings.setAutoplayPolicy('no-user-gesture-required'); + internals.runtimeFlags.autoplayMutedVideosEnabled = false; + internals.mediaPlayerRemoteRouteAvailabilityChanged(video, false); + }); + + internals.settings.setAutoplayPolicy('user-gesture-required'); + internals.runtimeFlags.autoplayMutedVideosEnabled = true; + + // Have to create the video so it respects the settings set above. + var video = document.createElement("video"); + video.muted = true; + video.autoplay = true; + video.src = findMediaFile("video", "../content/test"); + + video.onloadedmetadata = t.step_func_done(function() { + // Pretend we have a cast device + internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true); + var button = overlayCastButton(video); + assert_false(isControlVisible(button), + "button should not be visible for videos autoplaying muted"); + }); + + document.body.appendChild(video); +}, 'autoplay muted video'); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html index ca96085..92b09e0 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html
@@ -13,12 +13,13 @@ video.onloadedmetadata = t.step_func_done(function() { // Should not have a cast button by default var button = overlayCastButton(video); - assert_equals(button.style.display, "none", "button should not be visible with no cast devices"); + assert_false(isControlVisible(button), "button should not be visible with no cast devices"); // Pretend we have a cast device internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true); + // Now should have cast button - assert_false(("display" in button.style) && (button.style.display == "none"), "button should exist"); + assert_true(isControlVisible(button), "button should exist"); var rect = button.getBoundingClientRect(); assert_not_equals(rect.width, 0, "button should exist"); assert_not_equals(rect.height, 0, "button should exist"); @@ -32,7 +33,7 @@ // Remove cast device - cast button should go away internals.mediaPlayerRemoteRouteAvailabilityChanged(video, false); - assert_equals(button.style.display, "none", "button should not be visible after cast device goes away"); + assert_false(isControlVisible(button), "button should not be visible after cast device goes away"); }); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/media-controls.js b/third_party/WebKit/LayoutTests/media/media-controls.js index b71c411..2752348 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls.js +++ b/third_party/WebKit/LayoutTests/media/media-controls.js
@@ -9,6 +9,13 @@ // in MediaControls.cpp. const controlsMouseMovementTimeoutMs = 3000; +function isControlVisible(control) { + var style = getComputedStyle(control); + var visibility = style.getPropertyValue("visibility"); + var display = style.getPropertyValue("display"); + return (display != "none" && visibility == "visible"); +} + function castButton(videoElement) { var controlID = '-internal-media-controls-cast-button'; var button = mediaControlsElement(window.internals.shadowRoot(videoElement).firstChild, controlID);
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt index bf9eb4b..e42f94a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -1211,6 +1211,7 @@ method createShadowRoot method getAttribute method getAttributeNS + method getAttributeNames method getAttributeNode method getAttributeNodeNS method getBoundingClientRect @@ -7800,7 +7801,9 @@ getter onanimationend getter onanimationiteration getter onanimationstart + getter onappinstalled getter onauxclick + getter onbeforeinstallprompt getter onbeforeunload getter onblur getter oncancel @@ -7978,7 +7981,9 @@ setter onanimationend setter onanimationiteration setter onanimationstart + setter onappinstalled setter onauxclick + setter onbeforeinstallprompt setter onbeforeunload setter onblur setter oncancel
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 8afd57c..897e929b 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
@@ -1140,6 +1140,7 @@ method createShadowRoot method getAttribute method getAttributeNS + method getAttributeNames method getAttributeNode method getAttributeNodeNS method getBoundingClientRect @@ -7729,7 +7730,9 @@ getter onanimationend getter onanimationiteration getter onanimationstart + getter onappinstalled getter onauxclick + getter onbeforeinstallprompt getter onbeforeunload getter onblur getter oncancel @@ -7907,7 +7910,9 @@ setter onanimationend setter onanimationiteration setter onanimationstart + setter onappinstalled setter onauxclick + setter onbeforeinstallprompt setter onbeforeunload setter onblur setter oncancel
diff --git a/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm b/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm index b8ce4ce7..fd528d3 100644 --- a/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm +++ b/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm
@@ -43,5 +43,11 @@ <script>var zoomCount = 3; window.shouldZoomOut = true;</script> <script src="../../../resources/run-after-layout-and-paint.js"></script> <script src="../resources/testPageZoom.js"></script> + <script> + // There are some invisible pixel changes which exceed the threshold of our + // raster-under-invalidation checking, but seems acceptable. + if (window.internals) + internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false; + </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt index f1726d4b..0e95fbaa 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
@@ -113,6 +113,32 @@ setter maxDecibels setter minDecibels setter smoothingTimeConstant +interface Animation : EventTarget + attribute @@toStringTag + getter currentTime + getter effect + getter finished + getter id + getter oncancel + getter onfinish + getter playState + getter playbackRate + getter ready + getter startTime + getter timeline + method cancel + method constructor + method finish + method pause + method play + method reverse + setter currentTime + setter effect + setter id + setter oncancel + setter onfinish + setter playbackRate + setter startTime interface AnimationEffectReadOnly attribute @@toStringTag getter timing @@ -1785,6 +1811,7 @@ method getAnimations method getAttribute method getAttributeNS + method getAttributeNames method getAttributeNode method getAttributeNodeNS method getBoundingClientRect @@ -8913,7 +8940,9 @@ getter onanimationend getter onanimationiteration getter onanimationstart + getter onappinstalled getter onauxclick + getter onbeforeinstallprompt getter onbeforeunload getter onblur getter oncancel @@ -9094,7 +9123,9 @@ setter onanimationend setter onanimationiteration setter onanimationstart + setter onappinstalled setter onauxclick + setter onbeforeinstallprompt setter onbeforeunload setter onblur setter oncancel
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 a660987..83aedcd 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
@@ -61,6 +61,7 @@ property focus property getAttribute property getAttributeNS + property getAttributeNames property getAttributeNode property getAttributeNodeNS property getBoundingClientRect @@ -1134,6 +1135,7 @@ property focus property getAttribute property getAttributeNS + property getAttributeNames property getAttributeNode property getAttributeNodeNS property getBoundingClientRect
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 2f11f82..8ae23f0 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
@@ -65,6 +65,7 @@ property getAnimations property getAttribute property getAttributeNS + property getAttributeNames property getAttributeNode property getAttributeNodeNS property getBoundingClientRect @@ -1161,6 +1162,7 @@ property getAnimations property getAttribute property getAttributeNS + property getAttributeNames property getAttributeNode property getAttributeNodeNS property getBoundingClientRect
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 5f69652f..be5eb77 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -113,6 +113,32 @@ setter maxDecibels setter minDecibels setter smoothingTimeConstant +interface Animation : EventTarget + attribute @@toStringTag + getter currentTime + getter effect + getter finished + getter id + getter oncancel + getter onfinish + getter playState + getter playbackRate + getter ready + getter startTime + getter timeline + method cancel + method constructor + method finish + method pause + method play + method reverse + setter currentTime + setter effect + setter id + setter oncancel + setter onfinish + setter playbackRate + setter startTime interface AnimationEffectReadOnly attribute @@toStringTag getter timing @@ -1785,6 +1811,7 @@ method getAnimations method getAttribute method getAttributeNS + method getAttributeNames method getAttributeNode method getAttributeNodeNS method getBoundingClientRect @@ -8921,7 +8948,9 @@ getter onanimationend getter onanimationiteration getter onanimationstart + getter onappinstalled getter onauxclick + getter onbeforeinstallprompt getter onbeforeunload getter onblur getter oncancel @@ -9102,7 +9131,9 @@ setter onanimationend setter onanimationiteration setter onanimationstart + setter onappinstalled setter onauxclick + setter onbeforeinstallprompt setter onbeforeunload setter onblur setter oncancel
diff --git a/third_party/WebKit/LayoutTests/webexposed/web-animations-api-expected.txt b/third_party/WebKit/LayoutTests/webexposed/web-animations-api-expected.txt index 04dc68eb..0ccc4270 100644 --- a/third_party/WebKit/LayoutTests/webexposed/web-animations-api-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/web-animations-api-expected.txt
@@ -2,8 +2,8 @@ PASS Element.animate() should be exposed. FAIL Element.getAnimations() should not be exposed without experimental web platform features enabled. This test is expected to fail in LayoutTests/webexposed. assert_false: expected false got true -PASS Animation constructor should not be exposed without experimental web platform features enabled. -This test is expected to fail in LayoutTests/webexposed. +FAIL Animation constructor should not be exposed without experimental web platform features enabled. +This test is expected to fail in LayoutTests/webexposed. assert_false: expected false got true FAIL Timeline should not be exposed without experimental web platform features enabled. This test is expected to fail in LayoutTests/webexposed. assert_false: expected false got true FAIL document.timeline should not be exposed without experimental web platform features enabled.
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp index 3585b8e..a946edf 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
@@ -4,6 +4,7 @@ #include "bindings/core/v8/ScriptModule.h" +#include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/V8BindingForCore.h" #include "core/dom/Modulator.h" #include "core/dom/ScriptModuleResolver.h" @@ -40,22 +41,19 @@ const String& source, const String& file_name, AccessControlStatus access_control_status, - const TextPosition& start_position) { + const TextPosition& start_position, + ExceptionState& exception_state) { // We ensure module-related code is not executed without the flag. // https://crbug.com/715376 CHECK(RuntimeEnabledFeatures::ModuleScriptsEnabled()); v8::TryCatch try_catch(isolate); - try_catch.SetVerbose(true); v8::Local<v8::Module> module; if (!V8ScriptRunner::CompileModule(isolate, source, file_name, access_control_status, start_position) .ToLocal(&module)) { - // Compilation error is not used in Blink implementaion logic. - // Note: Error message is delivered to user (e.g. console) by message - // listeners set on v8::Isolate. See V8Initializer::initalizeMainThread(). - // TODO(nhiroki): Revisit this when supporting modules on worker threads. DCHECK(try_catch.HasCaught()); + exception_state.RethrowV8Exception(try_catch.Exception()); return ScriptModule(); } DCHECK(!try_catch.HasCaught());
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h index 3487124..972dd88 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
@@ -17,6 +17,8 @@ namespace blink { +class ExceptionState; + // ScriptModule wraps a handle to a v8::Module for use in core. // // Using ScriptModules needs a ScriptState and its scope to operate in. You @@ -28,12 +30,12 @@ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); public: - static ScriptModule Compile( - v8::Isolate*, - const String& source, - const String& file_name, - AccessControlStatus, - const TextPosition& start_position = TextPosition::MinimumPosition()); + static ScriptModule Compile(v8::Isolate*, + const String& source, + const String& file_name, + AccessControlStatus, + const TextPosition& start_position, + ExceptionState&); // TODO(kouhei): Remove copy ctor ScriptModule();
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp index 6888904..80ad2e68 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
@@ -78,30 +78,33 @@ TEST(ScriptModuleTest, compileSuccess) { V8TestingScope scope; - ScriptModule module = - ScriptModule::Compile(scope.GetIsolate(), "export const a = 42;", - "foo.js", kSharableCrossOrigin); + ScriptModule module = ScriptModule::Compile( + scope.GetIsolate(), "export const a = 42;", "foo.js", + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module.IsNull()); } TEST(ScriptModuleTest, compileFail) { V8TestingScope scope; - ScriptModule module = ScriptModule::Compile(scope.GetIsolate(), "123 = 456", - "foo.js", kSharableCrossOrigin); + ScriptModule module = ScriptModule::Compile( + scope.GetIsolate(), "123 = 456", "foo.js", kSharableCrossOrigin, + TextPosition::MinimumPosition(), scope.GetExceptionState()); ASSERT_TRUE(module.IsNull()); + EXPECT_TRUE(scope.GetExceptionState().HadException()); } TEST(ScriptModuleTest, equalAndHash) { V8TestingScope scope; ScriptModule module_null; - ScriptModule module_a = - ScriptModule::Compile(scope.GetIsolate(), "export const a = 'a';", "a.js", - kSharableCrossOrigin); + ScriptModule module_a = ScriptModule::Compile( + scope.GetIsolate(), "export const a = 'a';", "a.js", kSharableCrossOrigin, + TextPosition::MinimumPosition(), ASSERT_NO_EXCEPTION); ASSERT_FALSE(module_a.IsNull()); - ScriptModule module_b = - ScriptModule::Compile(scope.GetIsolate(), "export const b = 'b';", "b.js", - kSharableCrossOrigin); + ScriptModule module_b = ScriptModule::Compile( + scope.GetIsolate(), "export const b = 'b';", "b.js", kSharableCrossOrigin, + TextPosition::MinimumPosition(), ASSERT_NO_EXCEPTION); ASSERT_FALSE(module_b.IsNull()); Vector<char> module_deleted_buffer(sizeof(ScriptModule)); ScriptModule& module_deleted = @@ -141,7 +144,8 @@ V8TestingScope scope; ScriptModule module = ScriptModule::Compile( scope.GetIsolate(), "import 'a'; import 'b'; export const c = 'c';", - "foo.js", kSharableCrossOrigin); + "foo.js", kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module.IsNull()); auto requests = module.ModuleRequests(scope.GetScriptState()); @@ -156,9 +160,10 @@ Modulator::SetModulator(scope.GetScriptState(), modulator); - ScriptModule module = - ScriptModule::Compile(scope.GetIsolate(), "export const a = 42;", - "foo.js", kSharableCrossOrigin); + ScriptModule module = ScriptModule::Compile( + scope.GetIsolate(), "export const a = 42;", "foo.js", + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module.IsNull()); ScriptValue exception = module.Instantiate(scope.GetScriptState()); ASSERT_TRUE(exception.IsEmpty()); @@ -174,21 +179,24 @@ Modulator::SetModulator(scope.GetScriptState(), modulator); - ScriptModule module_a = - ScriptModule::Compile(scope.GetIsolate(), "export const a = 'a';", - "foo.js", kSharableCrossOrigin); + ScriptModule module_a = ScriptModule::Compile( + scope.GetIsolate(), "export const a = 'a';", "foo.js", + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module_a.IsNull()); resolver->PushScriptModule(module_a); - ScriptModule module_b = - ScriptModule::Compile(scope.GetIsolate(), "export const b = 'b';", - "foo.js", kSharableCrossOrigin); + ScriptModule module_b = ScriptModule::Compile( + scope.GetIsolate(), "export const b = 'b';", "foo.js", + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module_b.IsNull()); resolver->PushScriptModule(module_b); ScriptModule module = ScriptModule::Compile( scope.GetIsolate(), "import 'a'; import 'b'; export const c = 123;", - "c.js", kSharableCrossOrigin); + "c.js", kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module.IsNull()); ScriptValue exception = module.Instantiate(scope.GetScriptState()); ASSERT_TRUE(exception.IsEmpty()); @@ -206,7 +214,8 @@ ScriptModule module = ScriptModule::Compile( scope.GetIsolate(), "export const a = 42; window.foo = 'bar';", "foo.js", - kSharableCrossOrigin); + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ASSERT_FALSE(module.IsNull()); ScriptValue exception = module.Instantiate(scope.GetScriptState()); ASSERT_TRUE(exception.IsEmpty());
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl index 7ab3d72..fe929ba6 100644 --- a/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl
@@ -10,32 +10,6 @@ namespace blink { -namespace { - -using KeywordTable = HashMap<CSSPropertyID, Vector<CSSValueID>>; - -KeywordTable createKeywordTable() { - KeywordTable table; - - {% for property_id, property in properties.items() if property.keywordIDs %} - { - Vector<CSSValueID> {{property.lower_camel_name}}Keywords; - {% for keywordValueID in property.keywordIDs %} - {{property.lower_camel_name}}Keywords.push_back({{keywordValueID}}); - {% endfor %} - table.Set({{property_id}}, {{property.lower_camel_name}}Keywords); - } - {% endfor %} - return table; -} - -KeywordTable& keywordTable() { - DEFINE_STATIC_LOCAL(KeywordTable, keywordTable, (createKeywordTable())); - return keywordTable; -} - -} // namespace - bool CSSOMKeywords::ValidKeywordForProperty(CSSPropertyID id, const CSSKeywordValue& keyword) { CSSValueID valueID = keyword.KeywordValueID(); @@ -49,12 +23,22 @@ return true; } - const KeywordTable::iterator tableIterator = keywordTable().find(id); - if (tableIterator == keywordTable().end()) { + switch (id) { + {% for property_id, property in properties.items() if property.keywordIDs %} + case {{property_id}}: { + switch (valueID) { + {% for keywordValueID in property.keywordIDs %} + case {{keywordValueID}}: + {% endfor %} + return true; + default: + return false; + } + } + {% endfor %} + default: return false; } - - return tableIterator->value.Contains(valueID); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp index 19b5e30..a2adea9 100644 --- a/third_party/WebKit/Source/core/animation/Animation.cpp +++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -32,6 +32,7 @@ #include "core/animation/AnimationTimeline.h" #include "core/animation/CompositorPendingAnimations.h" +#include "core/animation/DocumentTimeline.h" #include "core/animation/KeyframeEffectReadOnly.h" #include "core/animation/css/CSSAnimations.h" #include "core/dom/DOMNodeIds.h" @@ -70,6 +71,7 @@ AnimationTimeline* timeline) { if (!timeline) { // FIXME: Support creating animations without a timeline. + NOTREACHED(); return nullptr; } @@ -84,6 +86,28 @@ return animation; } +Animation* Animation::Create(ExecutionContext* execution_context, + AnimationEffectReadOnly* effect, + ExceptionState& exception_state) { + DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); + + Document* document = ToDocument(execution_context); + return Create(effect, &document->Timeline()); +} + +Animation* Animation::Create(ExecutionContext* execution_context, + AnimationEffectReadOnly* effect, + AnimationTimeline* timeline, + ExceptionState& exception_state) { + DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); + + if (!timeline) { + return Create(execution_context, effect, exception_state); + } + + return Create(effect, timeline); +} + Animation::Animation(ExecutionContext* execution_context, AnimationTimeline& timeline, AnimationEffectReadOnly* content)
diff --git a/third_party/WebKit/Source/core/animation/Animation.h b/third_party/WebKit/Source/core/animation/Animation.h index d95c92a0..26360fa 100644 --- a/third_party/WebKit/Source/core/animation/Animation.h +++ b/third_party/WebKit/Source/core/animation/Animation.h
@@ -75,6 +75,16 @@ }; static Animation* Create(AnimationEffectReadOnly*, AnimationTimeline*); + + // Web Animations API IDL constructors. + static Animation* Create(ExecutionContext*, + AnimationEffectReadOnly*, + ExceptionState&); + static Animation* Create(ExecutionContext*, + AnimationEffectReadOnly*, + AnimationTimeline*, + ExceptionState&); + ~Animation(); void Dispose();
diff --git a/third_party/WebKit/Source/core/animation/Animation.idl b/third_party/WebKit/Source/core/animation/Animation.idl index 9f49ff9..534b54d9 100644 --- a/third_party/WebKit/Source/core/animation/Animation.idl +++ b/third_party/WebKit/Source/core/animation/Animation.idl
@@ -33,9 +33,12 @@ enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" }; [ + Constructor(optional AnimationEffectReadOnly? effect = null, optional AnimationTimeline? timeline), + Exposed(Window WebAnimationsAPI), + ConstructorCallWith=ExecutionContext, + RaisesException=Constructor, ActiveScriptWrappable, DependentLifetime, - NoInterfaceObject, ] interface Animation : EventTarget { // TODO(suzyh): Make timeline mutable. [RuntimeEnabled=WebAnimationsAPI] attribute AnimationEffectReadOnly? effect;
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn index be70c986..18499bd 100644 --- a/third_party/WebKit/Source/core/dom/BUILD.gn +++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -240,6 +240,7 @@ "NodeRareData.h", "NodeTraversal.cpp", "NodeTraversal.h", + "NodeTraversalStrategy.h", "NodeWithIndex.h", "NonDocumentTypeChildNode.h", "NonElementParentNode.h",
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp index a8ded30f..5cb7eb8a 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -100,6 +100,25 @@ const uint64_t original_parent_document_version_; }; +inline bool CheckReferenceChildParent(const Node& parent, + const Node* next, + const Node* old_child, + ExceptionState& exception_state) { + if (next && next->parentNode() != &parent) { + exception_state.ThrowDOMException(kNotFoundError, + "The node before which the new node is " + "to be inserted is not a child of this " + "node."); + return false; + } + if (old_child && old_child->parentNode() != &parent) { + exception_state.ThrowDOMException( + kNotFoundError, "The node to be replaced is not a child of this node."); + return false; + } + return true; +} + } // namespace // This dispatches various events; DOM mutation events, blur events, IFRAME @@ -147,11 +166,25 @@ return true; } +// Returns true if |new_child| contains this node. In that case, +// |exception_state| has an exception. bool ContainerNode::ContainsConsideringHostElements( - const Node& new_child) const { + const Node& new_child, + ExceptionState& exception_state) const { + // Non-ContainerNode can contain nothing. + if (!new_child.IsContainerNode()) + return false; + + bool child_contains_parent = false; if (IsInShadowTree() || GetDocument().IsTemplateDocument()) - return new_child.ContainsIncludingHostElements(*this); - return new_child.contains(this); + child_contains_parent = new_child.ContainsIncludingHostElements(*this); + else + child_contains_parent = new_child.contains(this); + if (child_contains_parent) { + exception_state.ThrowDOMException( + kHierarchyRequestError, "The new child element contains the parent."); + } + return child_contains_parent; } // EnsurePreInsertionValidity() is an implementation of step 2 to 6 of @@ -159,40 +192,35 @@ // https://dom.spec.whatwg.org/#concept-node-replace . DISABLE_CFI_PERF bool ContainerNode::EnsurePreInsertionValidity( - const Node* new_child, + const Node& new_child, const Node* next, const Node* old_child, ExceptionState& exception_state) const { DCHECK(!(next && old_child)); - // Not mentioned in spec: throw NotFoundError if newChild is null - if (!new_child) { - exception_state.ThrowDOMException(kNotFoundError, - "The new child element is null."); - return false; - } // Use common case fast path if possible. - if ((new_child->IsElementNode() || new_child->IsTextNode()) && + if ((new_child.IsElementNode() || new_child.IsTextNode()) && IsElementNode()) { - DCHECK(IsChildTypeAllowed(*new_child)); - if (ContainsConsideringHostElements(*new_child)) { - exception_state.ThrowDOMException( - kHierarchyRequestError, "The new child element contains the parent."); + DCHECK(IsChildTypeAllowed(new_child)); + // 2. If node is a host-including inclusive ancestor of parent, throw a + // HierarchyRequestError. + if (ContainsConsideringHostElements(new_child, exception_state)) return false; - } - return true; + // 3. If child is not null and its parent is not parent, then throw a + // NotFoundError. + return CheckReferenceChildParent(*this, next, old_child, exception_state); } // This should never happen, but also protect release builds from tree // corruption. - DCHECK(!new_child->IsPseudoElement()); - if (new_child->IsPseudoElement()) { + DCHECK(!new_child.IsPseudoElement()); + if (new_child.IsPseudoElement()) { exception_state.ThrowDOMException( kHierarchyRequestError, "The new child element is a pseudo-element."); return false; } - return CheckAcceptChildGuaranteedNodeTypes(*new_child, next, old_child, + return CheckAcceptChildGuaranteedNodeTypes(new_child, next, old_child, exception_state); } @@ -201,21 +229,31 @@ const Node* next, const Node* old_child, ExceptionState& exception_state) const { - if (IsDocumentNode()) + if (IsDocumentNode()) { + // Step 2 is unnecessary. No one can have a Document child. + // Step 3: + if (!CheckReferenceChildParent(*this, next, old_child, exception_state)) + return false; + // Step 4-6. return ToDocument(this)->CanAcceptChild(new_child, next, old_child, exception_state); - // Skip containsIncludingHostElements() if !newChild.parentNode() && - // isConnected(). |newChild| typically has no parentNode(), and it means - // it's !isConnected(). In such case, the contains check for connected - // |this| is unnecessary. - if (new_child.IsContainerNode() && - (new_child.IsDocumentNode() || new_child.parentNode() || - !isConnected()) && - new_child.ContainsIncludingHostElements(*this)) { - exception_state.ThrowDOMException( - kHierarchyRequestError, "The new child element contains the parent."); - return false; } + + // 2. If node is a host-including inclusive ancestor of parent, throw a + // HierarchyRequestError. + if (ContainsConsideringHostElements(new_child, exception_state)) + return false; + + // 3. If child is not null and its parent is not parent, then throw a + // NotFoundError. + if (!CheckReferenceChildParent(*this, next, old_child, exception_state)) + return false; + + // 4. If node is not a DocumentFragment, DocumentType, Element, Text, + // ProcessingInstruction, or Comment node, throw a HierarchyRequestError. + // 5. If either node is a Text node and parent is a document, or node is a + // doctype and parent is not a document, throw a HierarchyRequestError. + // // TODO(tkent): IsChildTypeAllowed() is unnecessary for // RecheckNodeInsertionStructuralPrereq(). if (!IsChildTypeAllowed(new_child)) { @@ -225,6 +263,8 @@ "' may not be inserted inside nodes of type '" + nodeName() + "'."); return false; } + + // Step 6 is unnecessary for non-Document nodes. return true; } @@ -244,15 +284,7 @@ exception_state)) return false; } - if (next && next->parentNode() != this) { - exception_state.ThrowDOMException( - kNotFoundError, - "The node before which the new node is to " - "be inserted is not a child of this " - "node."); - return false; - } - return true; + return CheckReferenceChildParent(*this, next, nullptr, exception_state); } template <typename Functor> @@ -324,22 +356,14 @@ Node* ContainerNode::InsertBefore(Node* new_child, Node* ref_child, ExceptionState& exception_state) { + DCHECK(new_child); // https://dom.spec.whatwg.org/#concept-node-pre-insert // insertBefore(node, 0) is equivalent to appendChild(node) if (!ref_child) return AppendChild(new_child, exception_state); - // NotFoundError: Raised if refChild is not a child of this node - if (ref_child->parentNode() != this) { - exception_state.ThrowDOMException( - kNotFoundError, - "The node before which the new node is to " - "be inserted is not a child of this " - "node."); - return nullptr; - } - + // 2. Let reference child be child. // 3. If reference child is node, set it to node’s next sibling. if (ref_child == new_child) { ref_child = new_child->nextSibling(); @@ -347,11 +371,10 @@ return AppendChild(new_child, exception_state); } - // Make sure adding the new child is OK. - if (!EnsurePreInsertionValidity(new_child, ref_child, nullptr, + // 1. Ensure pre-insertion validity of node into parent before child. + if (!EnsurePreInsertionValidity(*new_child, ref_child, nullptr, exception_state)) return new_child; - DCHECK(new_child); NodeVector targets; DOMTreeMutationDetector detector(*new_child, *this); @@ -467,6 +490,7 @@ Node* ContainerNode::ReplaceChild(Node* new_child, Node* old_child, ExceptionState& exception_state) { + DCHECK(new_child); // https://dom.spec.whatwg.org/#concept-node-replace if (!old_child) { @@ -475,27 +499,11 @@ return nullptr; } - // 1. If parent is not a Document, DocumentFragment, or Element node, throw a - // HierarchyRequestError. - // 2. If node is a host-including inclusive ancestor of parent, throw a - // HierarchyRequestError. - // 4. If node is not a DocumentFragment, DocumentType, Element, Text, - // ProcessingInstruction, or Comment node, throw a HierarchyRequestError. - // 5. If either node is a Text node and parent is a document, or node is a - // doctype and parent is not a document, throw a HierarchyRequestError. - // 6. If parent is a document, and any of the statements below, switched on - // node, are true, throw a HierarchyRequestError. - if (!EnsurePreInsertionValidity(new_child, nullptr, old_child, + // Step 2 to 6. + if (!EnsurePreInsertionValidity(*new_child, nullptr, old_child, exception_state)) return old_child; - // 3. If child’s parent is not parent, then throw a NotFoundError. - if (old_child->parentNode() != this) { - exception_state.ThrowDOMException( - kNotFoundError, "The node to be replaced is not a child of this node."); - return nullptr; - } - // 7. Let reference child be child’s next sibling. Node* next = old_child->nextSibling(); // 8. If reference child is node, set it to node’s next sibling. @@ -776,10 +784,11 @@ Node* ContainerNode::AppendChild(Node* new_child, ExceptionState& exception_state) { - // Make sure adding the new child is ok - if (!EnsurePreInsertionValidity(new_child, nullptr, nullptr, exception_state)) - return new_child; DCHECK(new_child); + // Make sure adding the new child is ok + if (!EnsurePreInsertionValidity(*new_child, nullptr, nullptr, + exception_state)) + return new_child; NodeVector targets; DOMTreeMutationDetector detector(*new_child, *this);
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.h b/third_party/WebKit/Source/core/dom/ContainerNode.h index 16ea7870..fcd0645 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.h +++ b/third_party/WebKit/Source/core/dom/ContainerNode.h
@@ -419,12 +419,13 @@ const Node* next, const Node* old_child, ExceptionState&) const; - inline bool EnsurePreInsertionValidity(const Node* new_child, + inline bool EnsurePreInsertionValidity(const Node& new_child, const Node* next, const Node* old_child, ExceptionState&) const; inline bool CheckParserAcceptChild(const Node& new_child) const; - inline bool ContainsConsideringHostElements(const Node&) const; + inline bool ContainsConsideringHostElements(const Node&, + ExceptionState&) const; inline bool IsChildTypeAllowed(const Node& child) const; bool GetUpperLeftCorner(FloatPoint&) const;
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 66314b51..2bff5dd1 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -327,6 +327,18 @@ return rare_data.AttributeMap(); } +Vector<AtomicString> Element::getAttributeNames() const { + Vector<AtomicString> attributesVector; + if (!hasAttributes()) + return attributesVector; + + AttributeCollection attributes = element_data_->Attributes(); + attributesVector.ReserveInitialCapacity(attributes.size()); + for (const Attribute& attr : attributes) + attributesVector.UncheckedAppend(attr.GetName().ToString()); + return attributesVector; +} + ElementAnimations* Element::GetElementAnimations() const { if (HasRareData()) return GetElementRareData()->GetElementAnimations();
diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h index 5323a536..d1ba5652 100644 --- a/third_party/WebKit/Source/core/dom/Element.h +++ b/third_party/WebKit/Source/core/dom/Element.h
@@ -372,6 +372,7 @@ // For exposing to DOM only. NamedNodeMap* attributesForBindings() const; + Vector<AtomicString> getAttributeNames() const; enum class AttributeModificationReason { kDirectly, kByParser, kByCloning }; struct AttributeModificationParams {
diff --git a/third_party/WebKit/Source/core/dom/Element.idl b/third_party/WebKit/Source/core/dom/Element.idl index 54bf0a4..f642b455 100644 --- a/third_party/WebKit/Source/core/dom/Element.idl +++ b/third_party/WebKit/Source/core/dom/Element.idl
@@ -44,6 +44,7 @@ boolean hasAttributes(); [SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes; + sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString name); DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName); [RaisesException, CEReactions, CustomElementCallbacks] void setAttribute(DOMString name, DOMString value);
diff --git a/third_party/WebKit/Source/core/dom/Modulator.h b/third_party/WebKit/Source/core/dom/Modulator.h index 8d9f266..8c62b81 100644 --- a/third_party/WebKit/Source/core/dom/Modulator.h +++ b/third_party/WebKit/Source/core/dom/Modulator.h
@@ -18,6 +18,7 @@ namespace blink { +class ExceptionState; class ModuleScript; class ModuleScriptFetchRequest; class ModuleScriptLoaderClient; @@ -107,7 +108,8 @@ virtual ScriptModule CompileModule(const String& script, const String& url_str, AccessControlStatus, - const TextPosition&) = 0; + const TextPosition&, + ExceptionState&) = 0; virtual ScriptValue InstantiateModule(ScriptModule) = 0;
diff --git a/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp b/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp index f2e478c..bc3ff25 100644 --- a/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp +++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
@@ -121,8 +121,9 @@ const String& provided_source, const String& url_str, AccessControlStatus access_control_status, - const TextPosition& position) { - // Implements Steps 3-6 of + const TextPosition& position, + ExceptionState& exception_state) { + // Implements Steps 3-5 of // https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-module-script // Step 3. Let realm be the provided environment settings object's Realm. @@ -136,12 +137,10 @@ script_source = provided_source; // Step 5. Let result be ParseModule(script source, realm, script). - // Step 6. If result is a List of errors, report the exception given by the - // first element of result for script, return null, and abort these steps. - // Note: reporting is routed via V8Initializer::messageHandlerInMainThread. ScriptState::Scope scope(script_state_.Get()); return ScriptModule::Compile(script_state_->GetIsolate(), script_source, - url_str, access_control_status, position); + url_str, access_control_status, position, + exception_state); } ScriptValue ModulatorImpl::InstantiateModule(ScriptModule script_module) {
diff --git a/third_party/WebKit/Source/core/dom/ModulatorImpl.h b/third_party/WebKit/Source/core/dom/ModulatorImpl.h index 35013d1..ae97b35f 100644 --- a/third_party/WebKit/Source/core/dom/ModulatorImpl.h +++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.h
@@ -63,7 +63,8 @@ ScriptModule CompileModule(const String& script, const String& url_str, AccessControlStatus, - const TextPosition&) override; + const TextPosition&, + ExceptionState&) override; ScriptValue InstantiateModule(ScriptModule) override; ScriptValue GetError(const ModuleScript*) override; Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override;
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.cpp b/third_party/WebKit/Source/core/dom/ModuleScript.cpp index 3f1139d..7758d41 100644 --- a/third_party/WebKit/Source/core/dom/ModuleScript.cpp +++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
@@ -27,15 +27,40 @@ // provided. // Note: "script's settings object" will be "modulator". - // Delegate to Modulator::compileModule to process Steps 3-6. - ScriptModule result = modulator->CompileModule( - source_text, base_url.GetString(), access_control_status, start_position); - // Step 6: "...return null, and abort these steps." - if (result.IsNull()) - return nullptr; + v8::HandleScope scope(modulator->GetScriptState()->GetIsolate()); + ExceptionState exception_state(modulator->GetScriptState()->GetIsolate(), + ExceptionState::kExecutionContext, + "ModuleScript", "Create"); - return CreateInternal(source_text, modulator, result, base_url, nonce, - parser_state, credentials_mode, start_position); + // Delegate to Modulator::CompileModule to process Steps 3-5. + ScriptModule result = modulator->CompileModule( + source_text, base_url.GetString(), access_control_status, start_position, + exception_state); + + // CreateInternal processes Steps 7-13. + // [nospec] We initialize the other ModuleScript members anyway by running + // Steps 7-13 before Step 6. In a case that compile failed, we will + // immediately turn the script into errored state. Thus the members will not + // be used for the speced algorithms, but may be used from inspector. + ModuleScript* script = + CreateInternal(source_text, modulator, result, base_url, nonce, + parser_state, credentials_mode, start_position); + + // Step 6. If result is a List of errors, then: + if (exception_state.HadException()) { + DCHECK(result.IsNull()); + + // Step 6.1. Error script with errors[0]. + v8::Local<v8::Value> error = exception_state.GetException(); + exception_state.ClearException(); + script->SetErrorAndClearRecord( + ScriptValue(modulator->GetScriptState(), error)); + + // Step 6.2. Return script. + return script; + } + + return script; } ModuleScript* ModuleScript::CreateForTest( @@ -61,13 +86,14 @@ WebURLRequest::FetchCredentialsMode credentials_mode, const TextPosition& start_position) { // https://html.spec.whatwg.org/#creating-a-module-script - // Step 7. Set script's module record to result. - // Step 8. Set script's base URL to the script base URL provided. - // Step 9. Set script's cryptographic nonce to the cryptographic nonce + // Step 7. Set script's state to "uninstantiated". + // Step 8. Set script's module record to result. + // Step 9. Set script's base URL to the script base URL provided. + // Step 10. Set script's cryptographic nonce to the cryptographic nonce // provided. - // Step 10. Set script's parser state to the parser state. - // Step 11. Set script's credentials mode to the credentials mode provided. - // Step 12. Return script. + // Step 11. Set script's parser state to the parser state. + // Step 12. Set script's credentials mode to the credentials mode provided. + // Step 13. Return script. // [not specced] |source_text| is saved for CSP checks. ModuleScript* module_script = new ModuleScript(modulator, result, base_url, nonce, parser_state,
diff --git a/third_party/WebKit/Source/core/dom/NodeTraversalStrategy.h b/third_party/WebKit/Source/core/dom/NodeTraversalStrategy.h new file mode 100644 index 0000000..3a07e091 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/NodeTraversalStrategy.h
@@ -0,0 +1,47 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NodeTraversalStrategy_h +#define NodeTraversalStrategy_h + +#include "core/dom/Node.h" + +namespace blink { + +// NodeTraversalStrategy is helpful to implement algorithm templates independent +// from tree traversal direction, and to instantiate them with specific +// direction. +// +// For example, +// +// template <Strategy> void IterateOverChildren(const Node& parent) { +// for (Node* child = Strategy::StartNode(parent); child; +// child = Strategy::NextNode(*child)) { +// ... +// } +// } +// IterateOverChildren<NextNodeTraversalStrategy>(parent) iterates forward, +// IterateOverChildren<PreviousNodeTraversalStrategy>(parent) iterates backward. + +class NextNodeTraversalStrategy { + STATIC_ONLY(NextNodeTraversalStrategy); + + public: + static Node* StartNode(const Node& parent) { return parent.firstChild(); } + static Node* NextNode(const Node& current) { return current.nextSibling(); } +}; + +class PreviousNodeTraversalStrategy { + STATIC_ONLY(PreviousNodeTraversalStrategy); + + public: + static Node* StartNode(const Node& parent) { return parent.lastChild(); } + static Node* NextNode(const Node& current) { + return current.previousSibling(); + } +}; + +} // namespace blink + +#endif // NodeTraversalStrategy_h
diff --git a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.cpp b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.cpp index 058afd3..00e2ecd 100644 --- a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.cpp
@@ -12,13 +12,15 @@ void ScriptModuleResolverImpl::RegisterModuleScript( ModuleScript* module_script) { + DCHECK(module_script); + if (module_script->Record().IsNull()) + return; + DVLOG(1) << "ScriptModuleResolverImpl::registerModuleScript(url=\"" << module_script->BaseURL().GetString() << "\", hash=" << ScriptModuleHash::GetHash(module_script->Record()) << ")"; - DCHECK(module_script); - DCHECK(!module_script->Record().IsNull()); auto result = record_to_module_script_map_.Set(module_script->Record(), module_script); DCHECK(result.is_new_entry);
diff --git a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp index 749d594..94406eb 100644 --- a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp
@@ -74,7 +74,8 @@ V8TestingScope& scope) { ScriptModule referrer_record = ScriptModule::Compile( scope.GetIsolate(), "import './target.js'; export const a = 42;", - "referrer.js", kSharableCrossOrigin); + "referrer.js", kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); KURL referrer_url(kParsedURLString, "https://example.com/referrer.js"); ModuleScript* referrer_module_script = ModuleScript::CreateForTest( modulator, referrer_record, referrer_url, "", kParserInserted, @@ -87,9 +88,10 @@ Modulator* modulator, V8TestingScope& scope, ModuleInstantiationState state = ModuleInstantiationState::kInstantiated) { - ScriptModule record = - ScriptModule::Compile(scope.GetIsolate(), "export const pi = 3.14;", - "target.js", kSharableCrossOrigin); + ScriptModule record = ScriptModule::Compile( + scope.GetIsolate(), "export const pi = 3.14;", "target.js", + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); KURL url(kParsedURLString, "https://example.com/target.js"); ModuleScript* module_script = ModuleScript::CreateForTest(modulator, record, url, "", kParserInserted,
diff --git a/third_party/WebKit/Source/core/dom/TreeWalker.cpp b/third_party/WebKit/Source/core/dom/TreeWalker.cpp index 2eafa3b..94e21fb10 100644 --- a/third_party/WebKit/Source/core/dom/TreeWalker.cpp +++ b/third_party/WebKit/Source/core/dom/TreeWalker.cpp
@@ -28,6 +28,7 @@ #include "bindings/core/v8/ExceptionState.h" #include "core/dom/ContainerNode.h" #include "core/dom/NodeTraversal.h" +#include "core/dom/NodeTraversalStrategy.h" namespace blink { @@ -126,76 +127,61 @@ return 0; } -Node* TreeWalker::previousSibling(ExceptionState& exception_state) { +// https://dom.spec.whatwg.org/#concept-traverse-siblings +template <typename Strategy> +Node* TreeWalker::TraverseSiblings(ExceptionState& exception_state) { + // 1. Let node be the value of the currentNode attribute. Node* node = current_; + // 2. If node is root, return null. if (node == root()) - return 0; - while (1) { - for (Node* sibling = node->previousSibling(); sibling;) { - unsigned accept_node_result = AcceptNode(sibling, exception_state); + return nullptr; + // 3. While true: + while (true) { + // 1. Let sibling be node's next sibling if type is next, and node's + // previous sibling if type is previous. + Node* sibling = Strategy::NextNode(*node); + // 2. While sibling is not null: + while (sibling) { + // 1. Set node to sibling. + node = sibling; + // 2. Filter node and let result be the return value. + unsigned result = AcceptNode(node, exception_state); if (exception_state.HadException()) return 0; - switch (accept_node_result) { - case NodeFilter::kFilterAccept: - current_ = sibling; - return current_.Get(); - case NodeFilter::kFilterSkip: - if (sibling->lastChild()) { - sibling = sibling->lastChild(); - node = sibling; - continue; - } - break; - case NodeFilter::kFilterReject: - break; - } - sibling = sibling->previousSibling(); + // 3. If result is FILTER_ACCEPT, then set the currentNode attribute to + // node and return node. + if (result == NodeFilter::kFilterAccept) + return SetCurrent(node); + // 4. Set sibling to node's first child if type is next, and node's last + // child if type is previous. + sibling = Strategy::StartNode(*sibling); + // 5. If result is FILTER_REJECT or sibling is null, then set sibling to + // node's next sibling if type is next, and node's previous sibling if + // type is previous. + if (result == NodeFilter::kFilterReject || !sibling) + sibling = Strategy::NextNode(*node); } + // 3. Set node to its parent. node = node->parentNode(); + // 4. If node is null or is root, return null. if (!node || node == root()) - return 0; - unsigned accept_node_result = AcceptNode(node, exception_state); + return nullptr; + // 5. Filter node and if the return value is FILTER_ACCEPT, then return + // null. + unsigned result = AcceptNode(node, exception_state); if (exception_state.HadException()) - return 0; - if (accept_node_result == NodeFilter::kFilterAccept) - return 0; + return nullptr; + if (result == NodeFilter::kFilterAccept) + return nullptr; } } +Node* TreeWalker::previousSibling(ExceptionState& exception_state) { + return TraverseSiblings<PreviousNodeTraversalStrategy>(exception_state); +} + Node* TreeWalker::nextSibling(ExceptionState& exception_state) { - Node* node = current_; - if (node == root()) - return 0; - while (1) { - for (Node* sibling = node->nextSibling(); sibling;) { - unsigned accept_node_result = AcceptNode(sibling, exception_state); - if (exception_state.HadException()) - return 0; - switch (accept_node_result) { - case NodeFilter::kFilterAccept: - current_ = sibling; - return current_.Get(); - case NodeFilter::kFilterSkip: - if (sibling->hasChildren()) { - sibling = sibling->firstChild(); - node = sibling; - continue; - } - break; - case NodeFilter::kFilterReject: - break; - } - sibling = sibling->nextSibling(); - } - node = node->parentNode(); - if (!node || node == root()) - return 0; - unsigned accept_node_result = AcceptNode(node, exception_state); - if (exception_state.HadException()) - return 0; - if (accept_node_result == NodeFilter::kFilterAccept) - return 0; - } + return TraverseSiblings<NextNodeTraversalStrategy>(exception_state); } Node* TreeWalker::previousNode(ExceptionState& exception_state) {
diff --git a/third_party/WebKit/Source/core/dom/TreeWalker.h b/third_party/WebKit/Source/core/dom/TreeWalker.h index 7f80f3d..2fa7863d 100644 --- a/third_party/WebKit/Source/core/dom/TreeWalker.h +++ b/third_party/WebKit/Source/core/dom/TreeWalker.h
@@ -66,6 +66,8 @@ TreeWalker(Node*, unsigned what_to_show, V8NodeFilterCondition*); Node* SetCurrent(Node*); + template <typename Strategy> + Node* TraverseSiblings(ExceptionState&); Member<Node> current_; };
diff --git a/third_party/WebKit/Source/core/editing/BUILD.gn b/third_party/WebKit/Source/core/editing/BUILD.gn index 93de22d..55605712 100644 --- a/third_party/WebKit/Source/core/editing/BUILD.gn +++ b/third_party/WebKit/Source/core/editing/BUILD.gn
@@ -66,6 +66,7 @@ "SelectionEditor.h", "SelectionModifier.cpp", "SelectionModifier.h", + "SelectionModifierCharacter.cpp", "SelectionModifierWord.cpp", "SelectionStrategy.h", "SelectionTemplate.cpp", @@ -84,6 +85,7 @@ "VisibleUnits.h", "VisibleUnitsLine.cpp", "VisibleUnitsParagraph.cpp", + "VisibleUnitsSentence.cpp", "VisibleUnitsWord.cpp", "WritingDirection.h", "commands/AppendNodeCommand.cpp", @@ -306,6 +308,7 @@ "PositionTest.cpp", "RelocatablePositionTest.cpp", "SelectionControllerTest.cpp", + "SelectionModifierTest.cpp", "SelectionTemplateTest.cpp", "SurroundingTextTest.cpp", "VisiblePositionTest.cpp",
diff --git a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp index e1bcd3d9..48c63c5 100644 --- a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp +++ b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
@@ -74,24 +74,25 @@ } static LayoutRect MapCaretRectToCaretPainter( - LayoutItem caret_layout_item, - LayoutBlockItem caret_painter_item, - const LayoutRect& passed_caret_rect) { + const LayoutBlockItem& caret_painter_item, + const LocalCaretRect& caret_rect) { // FIXME: This shouldn't be called on un-rooted subtrees. // FIXME: This should probably just use mapLocalToAncestor. // Compute an offset between the caretLayoutItem and the caretPainterItem. + LayoutItem caret_layout_item = LayoutItem(caret_rect.layout_object); DCHECK(caret_layout_item.IsDescendantOf(caret_painter_item)); - LayoutRect caret_rect = passed_caret_rect; + LayoutRect result_rect = caret_rect.rect; + caret_painter_item.FlipForWritingMode(result_rect); while (caret_layout_item != caret_painter_item) { LayoutItem container_item = caret_layout_item.Container(); if (container_item.IsNull()) return LayoutRect(); - caret_rect.Move(caret_layout_item.OffsetFromContainer(container_item)); + result_rect.Move(caret_layout_item.OffsetFromContainer(container_item)); caret_layout_item = container_item; } - return caret_rect; + return result_rect; } LayoutRect CaretDisplayItemClient::ComputeCaretRect( @@ -102,19 +103,13 @@ DCHECK(caret_position.AnchorNode()->GetLayoutObject()); // First compute a rect local to the layoutObject at the selection start. - LayoutObject* layout_object; - const LayoutRect& caret_local_rect = - LocalCaretRectOfPosition(caret_position, layout_object); + const LocalCaretRect& caret_rect = LocalCaretRectOfPosition(caret_position); // Get the layoutObject that will be responsible for painting the caret // (which is either the layoutObject we just found, or one of its containers). - LayoutBlockItem caret_painter_item = + const LayoutBlockItem caret_painter_item = LayoutBlockItem(CaretLayoutBlock(caret_position.AnchorNode())); - LayoutRect caret_local_rect_with_writing_mode = caret_local_rect; - caret_painter_item.FlipForWritingMode(caret_local_rect_with_writing_mode); - return MapCaretRectToCaretPainter(LayoutItem(layout_object), - caret_painter_item, - caret_local_rect_with_writing_mode); + return MapCaretRectToCaretPainter(caret_painter_item, caret_rect); } void CaretDisplayItemClient::ClearPreviousVisualRect(const LayoutBlock& block) {
diff --git a/third_party/WebKit/Source/core/editing/SelectionModifier.cpp b/third_party/WebKit/Source/core/editing/SelectionModifier.cpp index 1f08e08..8ff2d8b6 100644 --- a/third_party/WebKit/Source/core/editing/SelectionModifier.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionModifier.cpp
@@ -802,26 +802,24 @@ if (visible_position.IsNull()) return LayoutUnit(); - LayoutObject* layout_object; - LayoutRect local_rect = LocalCaretRectOfPosition( - visible_position.ToPositionWithAffinity(), layout_object); - if (local_rect.IsEmpty() || !layout_object) + const LocalCaretRect& caret_rect = + LocalCaretRectOfPosition(visible_position.ToPositionWithAffinity()); + if (caret_rect.IsEmpty()) return LayoutUnit(); // This ignores transforms on purpose, for now. Vertical navigation is done // without consulting transforms, so that 'up' in transformed text is 'up' // relative to the text, not absolute 'up'. - FloatPoint caret_point = - layout_object->LocalToAbsolute(FloatPoint(local_rect.Location())); - LayoutObject* containing_block = layout_object->ContainingBlock(); - if (!containing_block) { - // Just use ourselves to determine the writing mode if we have no containing - // block. - containing_block = layout_object; - } - return LayoutUnit(containing_block->IsHorizontalWritingMode() - ? caret_point.X() - : caret_point.Y()); + const FloatPoint& caret_point = caret_rect.layout_object->LocalToAbsolute( + FloatPoint(caret_rect.rect.Location())); + LayoutObject* const containing_block = + caret_rect.layout_object->ContainingBlock(); + // Just use ourselves to determine the writing mode if we have no containing + // block. + LayoutObject* const layout_object = + containing_block ? containing_block : caret_rect.layout_object; + return LayoutUnit(layout_object->IsHorizontalWritingMode() ? caret_point.X() + : caret_point.Y()); } LayoutUnit SelectionModifier::LineDirectionPointForBlockDirectionNavigation(
diff --git a/third_party/WebKit/Source/core/editing/SelectionModifier.h b/third_party/WebKit/Source/core/editing/SelectionModifier.h index 5a00050e..50a0b1d 100644 --- a/third_party/WebKit/Source/core/editing/SelectionModifier.h +++ b/third_party/WebKit/Source/core/editing/SelectionModifier.h
@@ -98,6 +98,22 @@ LayoutUnit NoXPosForVerticalArrowNavigation(); +// Following functions are exported for using in SelectionModifier and +// testing only. + +// TODO(yosin) Since return value of |leftPositionOf()| with |VisiblePosition| +// isn't defined well on flat tree, we should not use it for a position in +// flat tree. +CORE_EXPORT VisiblePosition LeftPositionOf(const VisiblePosition&); +CORE_EXPORT VisiblePositionInFlatTree +LeftPositionOf(const VisiblePositionInFlatTree&); +// TODO(yosin) Since return value of |rightPositionOf()| with |VisiblePosition| +// isn't defined well on flat tree, we should not use it for a position in +// flat tree. +CORE_EXPORT VisiblePosition RightPositionOf(const VisiblePosition&); +CORE_EXPORT VisiblePositionInFlatTree +RightPositionOf(const VisiblePositionInFlatTree&); + } // namespace blink #endif // SelectionModifier_h
diff --git a/third_party/WebKit/Source/core/editing/SelectionModifierCharacter.cpp b/third_party/WebKit/Source/core/editing/SelectionModifierCharacter.cpp new file mode 100644 index 0000000..ff9b7385 --- /dev/null +++ b/third_party/WebKit/Source/core/editing/SelectionModifierCharacter.cpp
@@ -0,0 +1,484 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. 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. + */ + +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/editing/SelectionModifier.h" + +#include "core/editing/EditingUtilities.h" +#include "core/editing/VisibleUnits.h" +#include "core/layout/api/LineLayoutAPIShim.h" +#include "core/layout/api/LineLayoutItem.h" +#include "core/layout/line/InlineTextBox.h" +#include "core/layout/line/RootInlineBox.h" + +namespace blink { + +namespace { + +template <typename Strategy> +static PositionTemplate<Strategy> LeftVisuallyDistinctCandidate( + const VisiblePositionTemplate<Strategy>& visible_position) { + DCHECK(visible_position.IsValid()) << visible_position; + const PositionTemplate<Strategy> deep_position = + visible_position.DeepEquivalent(); + PositionTemplate<Strategy> p = deep_position; + + if (p.IsNull()) + return PositionTemplate<Strategy>(); + + const PositionTemplate<Strategy> downstream_start = + MostForwardCaretPosition(p); + const TextDirection primary_direction = PrimaryDirectionOf(*p.AnchorNode()); + const TextAffinity affinity = visible_position.Affinity(); + + while (true) { + InlineBoxPosition box_position = + ComputeInlineBoxPosition(p, affinity, primary_direction); + InlineBox* box = box_position.inline_box; + int offset = box_position.offset_in_box; + if (!box) { + return primary_direction == TextDirection::kLtr + ? PreviousVisuallyDistinctCandidate(deep_position) + : NextVisuallyDistinctCandidate(deep_position); + } + LineLayoutItem line_layout_item = box->GetLineLayoutItem(); + + while (true) { + if ((line_layout_item.IsAtomicInlineLevel() || line_layout_item.IsBR()) && + offset == box->CaretRightmostOffset()) { + return box->IsLeftToRightDirection() + ? PreviousVisuallyDistinctCandidate(deep_position) + : NextVisuallyDistinctCandidate(deep_position); + } + if (!line_layout_item.GetNode()) { + box = box->PrevLeafChild(); + if (!box) { + return primary_direction == TextDirection::kLtr + ? PreviousVisuallyDistinctCandidate(deep_position) + : NextVisuallyDistinctCandidate(deep_position); + } + line_layout_item = box->GetLineLayoutItem(); + offset = box->CaretRightmostOffset(); + continue; + } + + offset = + box->IsLeftToRightDirection() + ? PreviousGraphemeBoundaryOf(line_layout_item.GetNode(), offset) + : NextGraphemeBoundaryOf(line_layout_item.GetNode(), offset); + + const int caret_min_offset = box->CaretMinOffset(); + const int caret_max_offset = box->CaretMaxOffset(); + + if (offset > caret_min_offset && offset < caret_max_offset) + break; + + if (box->IsLeftToRightDirection() ? offset < caret_min_offset + : offset > caret_max_offset) { + // Overshot to the left. + InlineBox* const prev_box = box->PrevLeafChildIgnoringLineBreak(); + if (!prev_box) { + PositionTemplate<Strategy> position_on_left = + primary_direction == TextDirection::kLtr + ? PreviousVisuallyDistinctCandidate( + visible_position.DeepEquivalent()) + : NextVisuallyDistinctCandidate( + visible_position.DeepEquivalent()); + if (position_on_left.IsNull()) + return PositionTemplate<Strategy>(); + + InlineBox* box_on_left = + ComputeInlineBoxPosition(position_on_left, affinity, + primary_direction) + .inline_box; + if (box_on_left && box_on_left->Root() == box->Root()) + return PositionTemplate<Strategy>(); + return position_on_left; + } + + // Reposition at the other logical position corresponding to our + // edge's visual position and go for another round. + box = prev_box; + line_layout_item = box->GetLineLayoutItem(); + offset = prev_box->CaretRightmostOffset(); + continue; + } + + DCHECK_EQ(offset, box->CaretLeftmostOffset()); + + unsigned char level = box->BidiLevel(); + InlineBox* prev_box = box->PrevLeafChild(); + + if (box->Direction() == primary_direction) { + if (!prev_box) { + InlineBox* logical_start = nullptr; + if (primary_direction == TextDirection::kLtr + ? box->Root().GetLogicalStartBoxWithNode(logical_start) + : box->Root().GetLogicalEndBoxWithNode(logical_start)) { + box = logical_start; + line_layout_item = box->GetLineLayoutItem(); + offset = primary_direction == TextDirection::kLtr + ? box->CaretMinOffset() + : box->CaretMaxOffset(); + } + break; + } + if (prev_box->BidiLevel() >= level) + break; + + level = prev_box->BidiLevel(); + + InlineBox* next_box = box; + do { + next_box = next_box->NextLeafChild(); + } while (next_box && next_box->BidiLevel() > level); + + if (next_box && next_box->BidiLevel() == level) + break; + + box = prev_box; + line_layout_item = box->GetLineLayoutItem(); + offset = box->CaretRightmostOffset(); + if (box->Direction() == primary_direction) + break; + continue; + } + + while (prev_box && !prev_box->GetLineLayoutItem().GetNode()) + prev_box = prev_box->PrevLeafChild(); + + if (prev_box) { + box = prev_box; + line_layout_item = box->GetLineLayoutItem(); + offset = box->CaretRightmostOffset(); + if (box->BidiLevel() > level) { + do { + prev_box = prev_box->PrevLeafChild(); + } while (prev_box && prev_box->BidiLevel() > level); + + if (!prev_box || prev_box->BidiLevel() < level) + continue; + } + } else { + // Trailing edge of a secondary run. Set to the leading edge of + // the entire run. + while (true) { + while (InlineBox* next_box = box->NextLeafChild()) { + if (next_box->BidiLevel() < level) + break; + box = next_box; + } + if (box->BidiLevel() == level) + break; + level = box->BidiLevel(); + while (InlineBox* prev_box = box->PrevLeafChild()) { + if (prev_box->BidiLevel() < level) + break; + box = prev_box; + } + if (box->BidiLevel() == level) + break; + level = box->BidiLevel(); + } + line_layout_item = box->GetLineLayoutItem(); + offset = primary_direction == TextDirection::kLtr + ? box->CaretMinOffset() + : box->CaretMaxOffset(); + } + break; + } + + p = PositionTemplate<Strategy>::EditingPositionOf( + line_layout_item.GetNode(), offset); + + if ((IsVisuallyEquivalentCandidate(p) && + MostForwardCaretPosition(p) != downstream_start) || + p.AtStartOfTree() || p.AtEndOfTree()) + return p; + + DCHECK_NE(p, deep_position); + } +} + +template <typename Strategy> +VisiblePositionTemplate<Strategy> LeftPositionOfAlgorithm( + const VisiblePositionTemplate<Strategy>& visible_position) { + DCHECK(visible_position.IsValid()) << visible_position; + const PositionTemplate<Strategy> pos = + LeftVisuallyDistinctCandidate(visible_position); + // TODO(yosin) Why can't we move left from the last position in a tree? + if (pos.AtStartOfTree() || pos.AtEndOfTree()) + return VisiblePositionTemplate<Strategy>(); + + const VisiblePositionTemplate<Strategy> left = CreateVisiblePosition(pos); + DCHECK_NE(left.DeepEquivalent(), visible_position.DeepEquivalent()); + + return DirectionOfEnclosingBlockOf(left.DeepEquivalent()) == + TextDirection::kLtr + ? HonorEditingBoundaryAtOrBefore(left, + visible_position.DeepEquivalent()) + : HonorEditingBoundaryAtOrAfter(left, + visible_position.DeepEquivalent()); +} + +template <typename Strategy> +PositionTemplate<Strategy> RightVisuallyDistinctCandidate( + const VisiblePositionTemplate<Strategy>& visible_position) { + DCHECK(visible_position.IsValid()) << visible_position; + const PositionTemplate<Strategy> deep_position = + visible_position.DeepEquivalent(); + PositionTemplate<Strategy> p = deep_position; + if (p.IsNull()) + return PositionTemplate<Strategy>(); + + const PositionTemplate<Strategy> downstream_start = + MostForwardCaretPosition(p); + const TextDirection primary_direction = PrimaryDirectionOf(*p.AnchorNode()); + const TextAffinity affinity = visible_position.Affinity(); + + while (true) { + InlineBoxPosition box_position = + ComputeInlineBoxPosition(p, affinity, primary_direction); + InlineBox* box = box_position.inline_box; + int offset = box_position.offset_in_box; + if (!box) { + return primary_direction == TextDirection::kLtr + ? NextVisuallyDistinctCandidate(deep_position) + : PreviousVisuallyDistinctCandidate(deep_position); + } + LayoutObject* layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + + while (true) { + if ((layout_object->IsAtomicInlineLevel() || layout_object->IsBR()) && + offset == box->CaretLeftmostOffset()) { + return box->IsLeftToRightDirection() + ? NextVisuallyDistinctCandidate(deep_position) + : PreviousVisuallyDistinctCandidate(deep_position); + } + if (!layout_object->GetNode()) { + box = box->NextLeafChild(); + if (!box) { + return primary_direction == TextDirection::kLtr + ? NextVisuallyDistinctCandidate(deep_position) + : PreviousVisuallyDistinctCandidate(deep_position); + } + layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + offset = box->CaretLeftmostOffset(); + continue; + } + + offset = + box->IsLeftToRightDirection() + ? NextGraphemeBoundaryOf(layout_object->GetNode(), offset) + : PreviousGraphemeBoundaryOf(layout_object->GetNode(), offset); + + const int caret_min_offset = box->CaretMinOffset(); + const int caret_max_offset = box->CaretMaxOffset(); + + if (offset > caret_min_offset && offset < caret_max_offset) + break; + + if (box->IsLeftToRightDirection() ? offset > caret_max_offset + : offset < caret_min_offset) { + // Overshot to the right. + InlineBox* const next_box = box->NextLeafChildIgnoringLineBreak(); + if (!next_box) { + PositionTemplate<Strategy> position_on_right = + primary_direction == TextDirection::kLtr + ? NextVisuallyDistinctCandidate(deep_position) + : PreviousVisuallyDistinctCandidate(deep_position); + if (position_on_right.IsNull()) + return PositionTemplate<Strategy>(); + + InlineBox* box_on_right = + ComputeInlineBoxPosition(position_on_right, affinity, + primary_direction) + .inline_box; + if (box_on_right && box_on_right->Root() == box->Root()) + return PositionTemplate<Strategy>(); + return position_on_right; + } + + // Reposition at the other logical position corresponding to our + // edge's visual position and go for another round. + box = next_box; + layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + offset = next_box->CaretLeftmostOffset(); + continue; + } + + DCHECK_EQ(offset, box->CaretRightmostOffset()); + + unsigned char level = box->BidiLevel(); + InlineBox* next_box = box->NextLeafChild(); + + if (box->Direction() == primary_direction) { + if (!next_box) { + InlineBox* logical_end = nullptr; + if (primary_direction == TextDirection::kLtr + ? box->Root().GetLogicalEndBoxWithNode(logical_end) + : box->Root().GetLogicalStartBoxWithNode(logical_end)) { + box = logical_end; + layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + offset = primary_direction == TextDirection::kLtr + ? box->CaretMaxOffset() + : box->CaretMinOffset(); + } + break; + } + + if (next_box->BidiLevel() >= level) + break; + + level = next_box->BidiLevel(); + + InlineBox* prev_box = box; + do { + prev_box = prev_box->PrevLeafChild(); + } while (prev_box && prev_box->BidiLevel() > level); + + // For example, abc FED 123 ^ CBA + if (prev_box && prev_box->BidiLevel() == level) + break; + + // For example, abc 123 ^ CBA or 123 ^ CBA abc + box = next_box; + layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + offset = box->CaretLeftmostOffset(); + if (box->Direction() == primary_direction) + break; + continue; + } + + while (next_box && !next_box->GetLineLayoutItem().GetNode()) + next_box = next_box->NextLeafChild(); + + if (next_box) { + box = next_box; + layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + offset = box->CaretLeftmostOffset(); + + if (box->BidiLevel() > level) { + do { + next_box = next_box->NextLeafChild(); + } while (next_box && next_box->BidiLevel() > level); + + if (!next_box || next_box->BidiLevel() < level) + continue; + } + } else { + // Trailing edge of a secondary run. Set to the leading edge of the + // entire run. + while (true) { + while (InlineBox* prev_box = box->PrevLeafChild()) { + if (prev_box->BidiLevel() < level) + break; + box = prev_box; + } + if (box->BidiLevel() == level) + break; + level = box->BidiLevel(); + while (InlineBox* next_box = box->NextLeafChild()) { + if (next_box->BidiLevel() < level) + break; + box = next_box; + } + if (box->BidiLevel() == level) + break; + level = box->BidiLevel(); + } + layout_object = + LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); + offset = primary_direction == TextDirection::kLtr + ? box->CaretMaxOffset() + : box->CaretMinOffset(); + } + break; + } + + p = PositionTemplate<Strategy>::EditingPositionOf(layout_object->GetNode(), + offset); + + if ((IsVisuallyEquivalentCandidate(p) && + MostForwardCaretPosition(p) != downstream_start) || + p.AtStartOfTree() || p.AtEndOfTree()) + return p; + + DCHECK_NE(p, deep_position); + } +} + +template <typename Strategy> +VisiblePositionTemplate<Strategy> RightPositionOfAlgorithm( + const VisiblePositionTemplate<Strategy>& visible_position) { + DCHECK(visible_position.IsValid()) << visible_position; + const PositionTemplate<Strategy> pos = + RightVisuallyDistinctCandidate(visible_position); + // TODO(editing-dev): Why can't we move left from the last position in a tree? + if (pos.AtStartOfTree() || pos.AtEndOfTree()) + return VisiblePositionTemplate<Strategy>(); + + const VisiblePositionTemplate<Strategy> right = CreateVisiblePosition(pos); + DCHECK_NE(right.DeepEquivalent(), visible_position.DeepEquivalent()); + + return DirectionOfEnclosingBlockOf(right.DeepEquivalent()) == + TextDirection::kLtr + ? HonorEditingBoundaryAtOrAfter(right, + visible_position.DeepEquivalent()) + : HonorEditingBoundaryAtOrBefore( + right, visible_position.DeepEquivalent()); +} + +} // namespace + +VisiblePosition LeftPositionOf(const VisiblePosition& visible_position) { + return LeftPositionOfAlgorithm<EditingStrategy>(visible_position); +} + +VisiblePositionInFlatTree LeftPositionOf( + const VisiblePositionInFlatTree& visible_position) { + return LeftPositionOfAlgorithm<EditingInFlatTreeStrategy>(visible_position); +} + +VisiblePosition RightPositionOf(const VisiblePosition& visible_position) { + return RightPositionOfAlgorithm<EditingStrategy>(visible_position); +} + +VisiblePositionInFlatTree RightPositionOf( + const VisiblePositionInFlatTree& visible_position) { + return RightPositionOfAlgorithm<EditingInFlatTreeStrategy>(visible_position); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/SelectionModifierTest.cpp b/third_party/WebKit/Source/core/editing/SelectionModifierTest.cpp new file mode 100644 index 0000000..89ed37d --- /dev/null +++ b/third_party/WebKit/Source/core/editing/SelectionModifierTest.cpp
@@ -0,0 +1,95 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/editing/SelectionModifier.h" + +#include "core/editing/EditingTestBase.h" + +namespace blink { + +class SelectionModifierTest : public EditingTestBase {}; + +TEST_F(SelectionModifierTest, leftPositionOf) { + const char* body_content = + "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b " + "id=three>333</b>"; + const char* shadow_content = + "<b id=four>4444</b><content select=#two></content><content " + "select=#one></content><b id=five>55555</b>"; + SetBodyContent(body_content); + ShadowRoot* shadow_root = SetShadowContent(shadow_content, "host"); + + Element* one = GetDocument().getElementById("one"); + Element* two = GetDocument().getElementById("two"); + Element* three = GetDocument().getElementById("three"); + Element* four = shadow_root->getElementById("four"); + Element* five = shadow_root->getElementById("five"); + + EXPECT_EQ( + Position(two->firstChild(), 1), + LeftPositionOf(CreateVisiblePosition(Position(one, 0))).DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(two->firstChild(), 1), + LeftPositionOf(CreateVisiblePosition(PositionInFlatTree(one, 0))) + .DeepEquivalent()); + + EXPECT_EQ( + Position(one->firstChild(), 0), + LeftPositionOf(CreateVisiblePosition(Position(two, 0))).DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(four->firstChild(), 3), + LeftPositionOf(CreateVisiblePosition(PositionInFlatTree(two, 0))) + .DeepEquivalent()); + + EXPECT_EQ(Position(two->firstChild(), 2), + LeftPositionOf(CreateVisiblePosition(Position(three, 0))) + .DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(five->firstChild(), 5), + LeftPositionOf(CreateVisiblePosition(PositionInFlatTree(three, 0))) + .DeepEquivalent()); +} + +TEST_F(SelectionModifierTest, rightPositionOf) { + const char* body_content = + "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b " + "id=three>333</b>"; + const char* shadow_content = + "<p id=four>4444</p><content select=#two></content><content " + "select=#one></content><p id=five>55555</p>"; + SetBodyContent(body_content); + ShadowRoot* shadow_root = SetShadowContent(shadow_content, "host"); + + Node* one = GetDocument().getElementById("one")->firstChild(); + Node* two = GetDocument().getElementById("two")->firstChild(); + Node* three = GetDocument().getElementById("three")->firstChild(); + Node* four = shadow_root->getElementById("four")->firstChild(); + Node* five = shadow_root->getElementById("five")->firstChild(); + + EXPECT_EQ(Position(), RightPositionOf(CreateVisiblePosition(Position(one, 1))) + .DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(five, 0), + RightPositionOf(CreateVisiblePosition(PositionInFlatTree(one, 1))) + .DeepEquivalent()); + + EXPECT_EQ(Position(one, 1), + RightPositionOf(CreateVisiblePosition(Position(two, 2))) + .DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(one, 1), + RightPositionOf(CreateVisiblePosition(PositionInFlatTree(two, 2))) + .DeepEquivalent()); + + EXPECT_EQ(Position(five, 0), + RightPositionOf(CreateVisiblePosition(Position(four, 4))) + .DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(two, 0), + RightPositionOf(CreateVisiblePosition(PositionInFlatTree(four, 4))) + .DeepEquivalent()); + + EXPECT_EQ(Position(), + RightPositionOf(CreateVisiblePosition(Position(five, 5))) + .DeepEquivalent()); + EXPECT_EQ(PositionInFlatTree(three, 0), + RightPositionOf(CreateVisiblePosition(PositionInFlatTree(five, 5))) + .DeepEquivalent()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp index 8bf72e4..b8fe711a 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -63,7 +63,6 @@ #include "core/layout/line/InlineTextBox.h" #include "platform/heap/Handle.h" #include "platform/text/TextBoundaries.h" -#include "platform/text/TextBreakIterator.h" namespace blink { @@ -541,131 +540,6 @@ // --------- -static unsigned StartSentenceBoundary(const UChar* characters, - unsigned length, - unsigned, - BoundarySearchContextAvailability, - bool&) { - TextBreakIterator* iterator = SentenceBreakIterator(characters, length); - // FIXME: The following function can return -1; we don't handle that. - return iterator->preceding(length); -} - -template <typename Strategy> -static VisiblePositionTemplate<Strategy> StartOfSentenceAlgorithm( - const VisiblePositionTemplate<Strategy>& c) { - DCHECK(c.IsValid()) << c; - return CreateVisiblePosition(PreviousBoundary(c, StartSentenceBoundary)); -} - -VisiblePosition StartOfSentence(const VisiblePosition& c) { - return StartOfSentenceAlgorithm<EditingStrategy>(c); -} - -VisiblePositionInFlatTree StartOfSentence(const VisiblePositionInFlatTree& c) { - return StartOfSentenceAlgorithm<EditingInFlatTreeStrategy>(c); -} - -static unsigned EndSentenceBoundary(const UChar* characters, - unsigned length, - unsigned, - BoundarySearchContextAvailability, - bool&) { - TextBreakIterator* iterator = SentenceBreakIterator(characters, length); - return iterator->next(); -} - -// TODO(yosin) This includes the space after the punctuation that marks the end -// of the sentence. -template <typename Strategy> -static VisiblePositionTemplate<Strategy> EndOfSentenceAlgorithm( - const VisiblePositionTemplate<Strategy>& c) { - DCHECK(c.IsValid()) << c; - return CreateVisiblePosition(NextBoundary(c, EndSentenceBoundary), - VP_UPSTREAM_IF_POSSIBLE); -} - -VisiblePosition EndOfSentence(const VisiblePosition& c) { - return EndOfSentenceAlgorithm<EditingStrategy>(c); -} - -VisiblePositionInFlatTree EndOfSentence(const VisiblePositionInFlatTree& c) { - return EndOfSentenceAlgorithm<EditingInFlatTreeStrategy>(c); -} - -static unsigned PreviousSentencePositionBoundary( - const UChar* characters, - unsigned length, - unsigned, - BoundarySearchContextAvailability, - bool&) { - // FIXME: This is identical to startSentenceBoundary. I'm pretty sure that's - // not right. - TextBreakIterator* iterator = SentenceBreakIterator(characters, length); - // FIXME: The following function can return -1; we don't handle that. - return iterator->preceding(length); -} - -VisiblePosition PreviousSentencePosition(const VisiblePosition& c) { - DCHECK(c.IsValid()) << c; - VisiblePosition prev = CreateVisiblePosition( - PreviousBoundary(c, PreviousSentencePositionBoundary)); - return HonorEditingBoundaryAtOrBefore(prev, c.DeepEquivalent()); -} - -static unsigned NextSentencePositionBoundary(const UChar* characters, - unsigned length, - unsigned, - BoundarySearchContextAvailability, - bool&) { - // FIXME: This is identical to endSentenceBoundary. This isn't right, it needs - // to move to the equivlant position in the following sentence. - TextBreakIterator* iterator = SentenceBreakIterator(characters, length); - return iterator->following(0); -} - -VisiblePosition NextSentencePosition(const VisiblePosition& c) { - DCHECK(c.IsValid()) << c; - VisiblePosition next = CreateVisiblePosition( - NextBoundary(c, NextSentencePositionBoundary), VP_UPSTREAM_IF_POSSIBLE); - return HonorEditingBoundaryAtOrAfter(next, c.DeepEquivalent()); -} - -EphemeralRange ExpandEndToSentenceBoundary(const EphemeralRange& range) { - DCHECK(range.IsNotNull()); - const VisiblePosition& visible_end = - CreateVisiblePosition(range.EndPosition()); - DCHECK(visible_end.IsNotNull()); - const Position& sentence_end = EndOfSentence(visible_end).DeepEquivalent(); - // TODO(xiaochengh): |sentenceEnd < range.endPosition()| is possible, - // which would trigger a DCHECK in EphemeralRange's constructor if we return - // it directly. However, this shouldn't happen and needs to be fixed. - return EphemeralRange( - range.StartPosition(), - sentence_end.IsNotNull() && sentence_end > range.EndPosition() - ? sentence_end - : range.EndPosition()); -} - -EphemeralRange ExpandRangeToSentenceBoundary(const EphemeralRange& range) { - DCHECK(range.IsNotNull()); - const VisiblePosition& visible_start = - CreateVisiblePosition(range.StartPosition()); - DCHECK(visible_start.IsNotNull()); - const Position& sentence_start = - StartOfSentence(visible_start).DeepEquivalent(); - // TODO(xiaochengh): |sentenceStart > range.startPosition()| is possible, - // which would trigger a DCHECK in EphemeralRange's constructor if we return - // it directly. However, this shouldn't happen and needs to be fixed. - return ExpandEndToSentenceBoundary(EphemeralRange( - sentence_start.IsNotNull() && sentence_start < range.StartPosition() - ? sentence_start - : range.StartPosition(), - range.EndPosition())); -} - -// --------- - VisiblePosition StartOfBlock(const VisiblePosition& visible_position, EditingBoundaryCrossingRule rule) { DCHECK(visible_position.IsValid()) << visible_position; @@ -690,14 +564,6 @@ : VisiblePosition(); } -bool InSameBlock(const VisiblePosition& a, const VisiblePosition& b) { - DCHECK(a.IsValid()) << a; - DCHECK(b.IsValid()) << b; - return !a.IsNull() && - EnclosingBlock(a.DeepEquivalent().ComputeContainerNode()) == - EnclosingBlock(b.DeepEquivalent().ComputeContainerNode()); -} - bool IsStartOfBlock(const VisiblePosition& pos) { DCHECK(pos.IsValid()) << pos; return pos.IsNotNull() && @@ -1111,90 +977,90 @@ position, affinity, primary_direction); } +// TODO(editing-dev): Once we mark |LayoutObject::LocalCaretRect()| |const|, +// we should make this function to take |const LayoutObject&|. +static LocalCaretRect ComputeLocalCaretRect( + LayoutObject* layout_object, + const InlineBoxPosition box_position) { + return LocalCaretRect( + layout_object, layout_object->LocalCaretRect(box_position.inline_box, + box_position.offset_in_box)); +} + template <typename Strategy> -LayoutRect LocalCaretRectOfPositionTemplate( - const PositionWithAffinityTemplate<Strategy>& position, - LayoutObject*& layout_object) { - if (position.IsNull()) { - layout_object = nullptr; - return LayoutRect(); - } - Node* node = position.AnchorNode(); - - layout_object = node->GetLayoutObject(); +LocalCaretRect LocalCaretRectOfPositionTemplate( + const PositionWithAffinityTemplate<Strategy>& position) { + if (position.IsNull()) + return LocalCaretRect(); + Node* const node = position.AnchorNode(); + LayoutObject* const layout_object = node->GetLayoutObject(); if (!layout_object) - return LayoutRect(); + return LocalCaretRect(); - InlineBoxPosition box_position = + const InlineBoxPosition& box_position = ComputeInlineBoxPosition(position.GetPosition(), position.Affinity()); - if (box_position.inline_box) - layout_object = LineLayoutAPIShim::LayoutObjectFrom( - box_position.inline_box->GetLineLayoutItem()); - - return layout_object->LocalCaretRect(box_position.inline_box, - box_position.offset_in_box); + if (box_position.inline_box) { + return ComputeLocalCaretRect( + LineLayoutAPIShim::LayoutObjectFrom( + box_position.inline_box->GetLineLayoutItem()), + box_position); + } + return ComputeLocalCaretRect(layout_object, box_position); } // This function was added because the caret rect that is calculated by // using the line top value instead of the selection top. template <typename Strategy> -LayoutRect LocalSelectionRectOfPositionTemplate( - const PositionWithAffinityTemplate<Strategy>& position, - LayoutObject*& layout_object) { - if (position.IsNull()) { - layout_object = nullptr; - return LayoutRect(); - } - Node* node = position.AnchorNode(); - layout_object = node->GetLayoutObject(); - if (!layout_object) - return LayoutRect(); +LocalCaretRect LocalSelectionRectOfPositionTemplate( + const PositionWithAffinityTemplate<Strategy>& position) { + if (position.IsNull()) + return LocalCaretRect(); + Node* const node = position.AnchorNode(); + if (!node->GetLayoutObject()) + return LocalCaretRect(); - InlineBoxPosition box_position = + const InlineBoxPosition& box_position = ComputeInlineBoxPosition(position.GetPosition(), position.Affinity()); if (!box_position.inline_box) - return LayoutRect(); + return LocalCaretRect(); - layout_object = LineLayoutAPIShim::LayoutObjectFrom( + LayoutObject* const layout_object = LineLayoutAPIShim::LayoutObjectFrom( box_position.inline_box->GetLineLayoutItem()); - LayoutRect rect = layout_object->LocalCaretRect(box_position.inline_box, - box_position.offset_in_box); + const LayoutRect& rect = layout_object->LocalCaretRect( + box_position.inline_box, box_position.offset_in_box); if (rect.IsEmpty()) - return rect; + return LocalCaretRect(); InlineBox* const box = box_position.inline_box; if (layout_object->Style()->IsHorizontalWritingMode()) { - rect.SetY(box->Root().SelectionTop()); - rect.SetHeight(box->Root().SelectionHeight()); - return rect; + return LocalCaretRect( + layout_object, + LayoutRect(LayoutPoint(rect.X(), box->Root().SelectionTop()), + LayoutSize(rect.Width(), box->Root().SelectionHeight()))); } - rect.SetX(box->Root().SelectionTop()); - rect.SetWidth(box->Root().SelectionHeight()); - return rect; + return LocalCaretRect( + layout_object, + LayoutRect(LayoutPoint(box->Root().SelectionTop(), rect.Y()), + LayoutSize(box->Root().SelectionHeight(), rect.Height()))); } -LayoutRect LocalCaretRectOfPosition(const PositionWithAffinity& position, - LayoutObject*& layout_object) { - return LocalCaretRectOfPositionTemplate<EditingStrategy>(position, - layout_object); +LocalCaretRect LocalCaretRectOfPosition(const PositionWithAffinity& position) { + return LocalCaretRectOfPositionTemplate<EditingStrategy>(position); } -LayoutRect LocalSelectionRectOfPosition(const PositionWithAffinity& position, - LayoutObject*& layout_object) { - return LocalSelectionRectOfPositionTemplate<EditingStrategy>(position, - layout_object); +static LocalCaretRect LocalSelectionRectOfPosition( + const PositionWithAffinity& position) { + return LocalSelectionRectOfPositionTemplate<EditingStrategy>(position); } -LayoutRect LocalCaretRectOfPosition( - const PositionInFlatTreeWithAffinity& position, - LayoutObject*& layout_object) { - return LocalCaretRectOfPositionTemplate<EditingInFlatTreeStrategy>( - position, layout_object); +LocalCaretRect LocalCaretRectOfPosition( + const PositionInFlatTreeWithAffinity& position) { + return LocalCaretRectOfPositionTemplate<EditingInFlatTreeStrategy>(position); } static LayoutUnit BoundingBoxLogicalHeight(LayoutObject* o, @@ -1334,20 +1200,23 @@ return false; } +static FloatQuad LocalToAbsoluteQuadOf(const LocalCaretRect& caret_rect) { + return caret_rect.layout_object->LocalToAbsoluteQuad( + FloatRect(caret_rect.rect)); +} + bool RendersInDifferentPosition(const Position& position1, const Position& position2) { if (position1.IsNull() || position2.IsNull()) return false; - LayoutObject* layout_object1; - const LayoutRect& rect1 = - LocalCaretRectOfPosition(PositionWithAffinity(position1), layout_object1); - LayoutObject* layout_object2; - const LayoutRect& rect2 = - LocalCaretRectOfPosition(PositionWithAffinity(position2), layout_object2); - if (!layout_object1 || !layout_object2) - return layout_object1 != layout_object2; - return layout_object1->LocalToAbsoluteQuad(FloatRect(rect1)) != - layout_object2->LocalToAbsoluteQuad(FloatRect(rect2)); + const LocalCaretRect& caret_rect1 = + LocalCaretRectOfPosition(PositionWithAffinity(position1)); + const LocalCaretRect& caret_rect2 = + LocalCaretRectOfPosition(PositionWithAffinity(position2)); + if (!caret_rect1.layout_object || !caret_rect2.layout_object) + return caret_rect1.layout_object != caret_rect2.layout_object; + return LocalToAbsoluteQuadOf(caret_rect1) != + LocalToAbsoluteQuadOf(caret_rect2); } static bool IsVisuallyEmpty(const LayoutObject* layout) { @@ -1859,14 +1728,11 @@ static IntRect AbsoluteCaretBoundsOfAlgorithm( const VisiblePositionTemplate<Strategy>& visible_position) { DCHECK(visible_position.IsValid()) << visible_position; - LayoutObject* layout_object; - LayoutRect local_rect = LocalCaretRectOfPosition( - visible_position.ToPositionWithAffinity(), layout_object); - if (local_rect.IsEmpty() || !layout_object) + const LocalCaretRect& caret_rect = + LocalCaretRectOfPosition(visible_position.ToPositionWithAffinity()); + if (caret_rect.IsEmpty()) return IntRect(); - - return layout_object->LocalToAbsoluteQuad(FloatRect(local_rect)) - .EnclosingBoundingBox(); + return LocalToAbsoluteQuadOf(caret_rect).EnclosingBoundingBox(); } IntRect AbsoluteCaretBoundsOf(const VisiblePosition& visible_position) { @@ -1877,14 +1743,11 @@ static IntRect AbsoluteSelectionBoundsOfAlgorithm( const VisiblePositionTemplate<Strategy>& visible_position) { DCHECK(visible_position.IsValid()) << visible_position; - LayoutObject* layout_object; - LayoutRect local_rect = LocalSelectionRectOfPosition( - visible_position.ToPositionWithAffinity(), layout_object); - if (local_rect.IsEmpty() || !layout_object) + const LocalCaretRect& caret_rect = + LocalSelectionRectOfPosition(visible_position.ToPositionWithAffinity()); + if (caret_rect.IsEmpty()) return IntRect(); - - return layout_object->LocalToAbsoluteQuad(FloatRect(local_rect)) - .EnclosingBoundingBox(); + return LocalToAbsoluteQuadOf(caret_rect).EnclosingBoundingBox(); } IntRect AbsoluteSelectionBoundsOf(const VisiblePosition& visible_position) { @@ -1975,442 +1838,6 @@ } template <typename Strategy> -static PositionTemplate<Strategy> LeftVisuallyDistinctCandidate( - const VisiblePositionTemplate<Strategy>& visible_position) { - DCHECK(visible_position.IsValid()) << visible_position; - const PositionTemplate<Strategy> deep_position = - visible_position.DeepEquivalent(); - PositionTemplate<Strategy> p = deep_position; - - if (p.IsNull()) - return PositionTemplate<Strategy>(); - - const PositionTemplate<Strategy> downstream_start = - MostForwardCaretPosition(p); - TextDirection primary_direction = PrimaryDirectionOf(*p.AnchorNode()); - const TextAffinity affinity = visible_position.Affinity(); - - while (true) { - InlineBoxPosition box_position = - ComputeInlineBoxPosition(p, affinity, primary_direction); - InlineBox* box = box_position.inline_box; - int offset = box_position.offset_in_box; - if (!box) - return primary_direction == TextDirection::kLtr - ? PreviousVisuallyDistinctCandidate(deep_position) - : NextVisuallyDistinctCandidate(deep_position); - - LineLayoutItem line_layout_item = box->GetLineLayoutItem(); - - while (true) { - if ((line_layout_item.IsAtomicInlineLevel() || line_layout_item.IsBR()) && - offset == box->CaretRightmostOffset()) - return box->IsLeftToRightDirection() - ? PreviousVisuallyDistinctCandidate(deep_position) - : NextVisuallyDistinctCandidate(deep_position); - - if (!line_layout_item.GetNode()) { - box = box->PrevLeafChild(); - if (!box) - return primary_direction == TextDirection::kLtr - ? PreviousVisuallyDistinctCandidate(deep_position) - : NextVisuallyDistinctCandidate(deep_position); - line_layout_item = box->GetLineLayoutItem(); - offset = box->CaretRightmostOffset(); - continue; - } - - offset = - box->IsLeftToRightDirection() - ? PreviousGraphemeBoundaryOf(line_layout_item.GetNode(), offset) - : NextGraphemeBoundaryOf(line_layout_item.GetNode(), offset); - - int caret_min_offset = box->CaretMinOffset(); - int caret_max_offset = box->CaretMaxOffset(); - - if (offset > caret_min_offset && offset < caret_max_offset) - break; - - if (box->IsLeftToRightDirection() ? offset < caret_min_offset - : offset > caret_max_offset) { - // Overshot to the left. - InlineBox* prev_box = box->PrevLeafChildIgnoringLineBreak(); - if (!prev_box) { - PositionTemplate<Strategy> position_on_left = - primary_direction == TextDirection::kLtr - ? PreviousVisuallyDistinctCandidate( - visible_position.DeepEquivalent()) - : NextVisuallyDistinctCandidate( - visible_position.DeepEquivalent()); - if (position_on_left.IsNull()) - return PositionTemplate<Strategy>(); - - InlineBox* box_on_left = - ComputeInlineBoxPosition(position_on_left, affinity, - primary_direction) - .inline_box; - if (box_on_left && box_on_left->Root() == box->Root()) - return PositionTemplate<Strategy>(); - return position_on_left; - } - - // Reposition at the other logical position corresponding to our - // edge's visual position and go for another round. - box = prev_box; - line_layout_item = box->GetLineLayoutItem(); - offset = prev_box->CaretRightmostOffset(); - continue; - } - - DCHECK_EQ(offset, box->CaretLeftmostOffset()); - - unsigned char level = box->BidiLevel(); - InlineBox* prev_box = box->PrevLeafChild(); - - if (box->Direction() == primary_direction) { - if (!prev_box) { - InlineBox* logical_start = 0; - if (primary_direction == TextDirection::kLtr - ? box->Root().GetLogicalStartBoxWithNode(logical_start) - : box->Root().GetLogicalEndBoxWithNode(logical_start)) { - box = logical_start; - line_layout_item = box->GetLineLayoutItem(); - offset = primary_direction == TextDirection::kLtr - ? box->CaretMinOffset() - : box->CaretMaxOffset(); - } - break; - } - if (prev_box->BidiLevel() >= level) - break; - - level = prev_box->BidiLevel(); - - InlineBox* next_box = box; - do { - next_box = next_box->NextLeafChild(); - } while (next_box && next_box->BidiLevel() > level); - - if (next_box && next_box->BidiLevel() == level) - break; - - box = prev_box; - line_layout_item = box->GetLineLayoutItem(); - offset = box->CaretRightmostOffset(); - if (box->Direction() == primary_direction) - break; - continue; - } - - while (prev_box && !prev_box->GetLineLayoutItem().GetNode()) - prev_box = prev_box->PrevLeafChild(); - - if (prev_box) { - box = prev_box; - line_layout_item = box->GetLineLayoutItem(); - offset = box->CaretRightmostOffset(); - if (box->BidiLevel() > level) { - do { - prev_box = prev_box->PrevLeafChild(); - } while (prev_box && prev_box->BidiLevel() > level); - - if (!prev_box || prev_box->BidiLevel() < level) - continue; - } - } else { - // Trailing edge of a secondary run. Set to the leading edge of - // the entire run. - while (true) { - while (InlineBox* next_box = box->NextLeafChild()) { - if (next_box->BidiLevel() < level) - break; - box = next_box; - } - if (box->BidiLevel() == level) - break; - level = box->BidiLevel(); - while (InlineBox* prev_box = box->PrevLeafChild()) { - if (prev_box->BidiLevel() < level) - break; - box = prev_box; - } - if (box->BidiLevel() == level) - break; - level = box->BidiLevel(); - } - line_layout_item = box->GetLineLayoutItem(); - offset = primary_direction == TextDirection::kLtr - ? box->CaretMinOffset() - : box->CaretMaxOffset(); - } - break; - } - - p = PositionTemplate<Strategy>::EditingPositionOf( - line_layout_item.GetNode(), offset); - - if ((IsVisuallyEquivalentCandidate(p) && - MostForwardCaretPosition(p) != downstream_start) || - p.AtStartOfTree() || p.AtEndOfTree()) - return p; - - DCHECK_NE(p, deep_position); - } -} - -template <typename Strategy> -VisiblePositionTemplate<Strategy> LeftPositionOfAlgorithm( - const VisiblePositionTemplate<Strategy>& visible_position) { - DCHECK(visible_position.IsValid()) << visible_position; - const PositionTemplate<Strategy> pos = - LeftVisuallyDistinctCandidate(visible_position); - // TODO(yosin) Why can't we move left from the last position in a tree? - if (pos.AtStartOfTree() || pos.AtEndOfTree()) - return VisiblePositionTemplate<Strategy>(); - - const VisiblePositionTemplate<Strategy> left = CreateVisiblePosition(pos); - DCHECK_NE(left.DeepEquivalent(), visible_position.DeepEquivalent()); - - return DirectionOfEnclosingBlockOf(left.DeepEquivalent()) == - TextDirection::kLtr - ? HonorEditingBoundaryAtOrBefore(left, - visible_position.DeepEquivalent()) - : HonorEditingBoundaryAtOrAfter(left, - visible_position.DeepEquivalent()); -} - -VisiblePosition LeftPositionOf(const VisiblePosition& visible_position) { - return LeftPositionOfAlgorithm<EditingStrategy>(visible_position); -} - -VisiblePositionInFlatTree LeftPositionOf( - const VisiblePositionInFlatTree& visible_position) { - return LeftPositionOfAlgorithm<EditingInFlatTreeStrategy>(visible_position); -} - -template <typename Strategy> -static PositionTemplate<Strategy> RightVisuallyDistinctCandidate( - const VisiblePositionTemplate<Strategy>& visible_position) { - DCHECK(visible_position.IsValid()) << visible_position; - const PositionTemplate<Strategy> deep_position = - visible_position.DeepEquivalent(); - PositionTemplate<Strategy> p = deep_position; - if (p.IsNull()) - return PositionTemplate<Strategy>(); - - const PositionTemplate<Strategy> downstream_start = - MostForwardCaretPosition(p); - TextDirection primary_direction = PrimaryDirectionOf(*p.AnchorNode()); - const TextAffinity affinity = visible_position.Affinity(); - - while (true) { - InlineBoxPosition box_position = - ComputeInlineBoxPosition(p, affinity, primary_direction); - InlineBox* box = box_position.inline_box; - int offset = box_position.offset_in_box; - if (!box) - return primary_direction == TextDirection::kLtr - ? NextVisuallyDistinctCandidate(deep_position) - : PreviousVisuallyDistinctCandidate(deep_position); - - LayoutObject* layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - - while (true) { - if ((layout_object->IsAtomicInlineLevel() || layout_object->IsBR()) && - offset == box->CaretLeftmostOffset()) - return box->IsLeftToRightDirection() - ? NextVisuallyDistinctCandidate(deep_position) - : PreviousVisuallyDistinctCandidate(deep_position); - - if (!layout_object->GetNode()) { - box = box->NextLeafChild(); - if (!box) - return primary_direction == TextDirection::kLtr - ? NextVisuallyDistinctCandidate(deep_position) - : PreviousVisuallyDistinctCandidate(deep_position); - layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - offset = box->CaretLeftmostOffset(); - continue; - } - - offset = - box->IsLeftToRightDirection() - ? NextGraphemeBoundaryOf(layout_object->GetNode(), offset) - : PreviousGraphemeBoundaryOf(layout_object->GetNode(), offset); - - int caret_min_offset = box->CaretMinOffset(); - int caret_max_offset = box->CaretMaxOffset(); - - if (offset > caret_min_offset && offset < caret_max_offset) - break; - - if (box->IsLeftToRightDirection() ? offset > caret_max_offset - : offset < caret_min_offset) { - // Overshot to the right. - InlineBox* next_box = box->NextLeafChildIgnoringLineBreak(); - if (!next_box) { - PositionTemplate<Strategy> position_on_right = - primary_direction == TextDirection::kLtr - ? NextVisuallyDistinctCandidate(deep_position) - : PreviousVisuallyDistinctCandidate(deep_position); - if (position_on_right.IsNull()) - return PositionTemplate<Strategy>(); - - InlineBox* box_on_right = - ComputeInlineBoxPosition(position_on_right, affinity, - primary_direction) - .inline_box; - if (box_on_right && box_on_right->Root() == box->Root()) - return PositionTemplate<Strategy>(); - return position_on_right; - } - - // Reposition at the other logical position corresponding to our - // edge's visual position and go for another round. - box = next_box; - layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - offset = next_box->CaretLeftmostOffset(); - continue; - } - - DCHECK_EQ(offset, box->CaretRightmostOffset()); - - unsigned char level = box->BidiLevel(); - InlineBox* next_box = box->NextLeafChild(); - - if (box->Direction() == primary_direction) { - if (!next_box) { - InlineBox* logical_end = 0; - if (primary_direction == TextDirection::kLtr - ? box->Root().GetLogicalEndBoxWithNode(logical_end) - : box->Root().GetLogicalStartBoxWithNode(logical_end)) { - box = logical_end; - layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - offset = primary_direction == TextDirection::kLtr - ? box->CaretMaxOffset() - : box->CaretMinOffset(); - } - break; - } - - if (next_box->BidiLevel() >= level) - break; - - level = next_box->BidiLevel(); - - InlineBox* prev_box = box; - do { - prev_box = prev_box->PrevLeafChild(); - } while (prev_box && prev_box->BidiLevel() > level); - - // For example, abc FED 123 ^ CBA - if (prev_box && prev_box->BidiLevel() == level) - break; - - // For example, abc 123 ^ CBA or 123 ^ CBA abc - box = next_box; - layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - offset = box->CaretLeftmostOffset(); - if (box->Direction() == primary_direction) - break; - continue; - } - - while (next_box && !next_box->GetLineLayoutItem().GetNode()) - next_box = next_box->NextLeafChild(); - - if (next_box) { - box = next_box; - layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - offset = box->CaretLeftmostOffset(); - - if (box->BidiLevel() > level) { - do { - next_box = next_box->NextLeafChild(); - } while (next_box && next_box->BidiLevel() > level); - - if (!next_box || next_box->BidiLevel() < level) - continue; - } - } else { - // Trailing edge of a secondary run. Set to the leading edge of the - // entire run. - while (true) { - while (InlineBox* prev_box = box->PrevLeafChild()) { - if (prev_box->BidiLevel() < level) - break; - box = prev_box; - } - if (box->BidiLevel() == level) - break; - level = box->BidiLevel(); - while (InlineBox* next_box = box->NextLeafChild()) { - if (next_box->BidiLevel() < level) - break; - box = next_box; - } - if (box->BidiLevel() == level) - break; - level = box->BidiLevel(); - } - layout_object = - LineLayoutAPIShim::LayoutObjectFrom(box->GetLineLayoutItem()); - offset = primary_direction == TextDirection::kLtr - ? box->CaretMaxOffset() - : box->CaretMinOffset(); - } - break; - } - - p = PositionTemplate<Strategy>::EditingPositionOf(layout_object->GetNode(), - offset); - - if ((IsVisuallyEquivalentCandidate(p) && - MostForwardCaretPosition(p) != downstream_start) || - p.AtStartOfTree() || p.AtEndOfTree()) - return p; - - DCHECK_NE(p, deep_position); - } -} - -template <typename Strategy> -static VisiblePositionTemplate<Strategy> RightPositionOfAlgorithm( - const VisiblePositionTemplate<Strategy>& visible_position) { - DCHECK(visible_position.IsValid()) << visible_position; - const PositionTemplate<Strategy> pos = - RightVisuallyDistinctCandidate(visible_position); - // FIXME: Why can't we move left from the last position in a tree? - if (pos.AtStartOfTree() || pos.AtEndOfTree()) - return VisiblePositionTemplate<Strategy>(); - - const VisiblePositionTemplate<Strategy> right = CreateVisiblePosition(pos); - DCHECK_NE(right.DeepEquivalent(), visible_position.DeepEquivalent()); - - return DirectionOfEnclosingBlockOf(right.DeepEquivalent()) == - TextDirection::kLtr - ? HonorEditingBoundaryAtOrAfter(right, - visible_position.DeepEquivalent()) - : HonorEditingBoundaryAtOrBefore( - right, visible_position.DeepEquivalent()); -} - -VisiblePosition RightPositionOf(const VisiblePosition& visible_position) { - return RightPositionOfAlgorithm<EditingStrategy>(visible_position); -} - -VisiblePositionInFlatTree RightPositionOf( - const VisiblePositionInFlatTree& visible_position) { - return RightPositionOfAlgorithm<EditingInFlatTreeStrategy>(visible_position); -} - -template <typename Strategy> static VisiblePositionTemplate<Strategy> NextPositionOfAlgorithm( const PositionWithAffinityTemplate<Strategy>& position, EditingBoundaryCrossingRule rule) {
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.h b/third_party/WebKit/Source/core/editing/VisibleUnits.h index e56dcb76..16e3a9e49 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnits.h +++ b/third_party/WebKit/Source/core/editing/VisibleUnits.h
@@ -64,6 +64,18 @@ } }; +// This struct represents local caret rectangle in |layout_object|. +struct LocalCaretRect { + LayoutObject* layout_object = nullptr; + LayoutRect rect; + + LocalCaretRect() = default; + LocalCaretRect(LayoutObject* layout_object, const LayoutRect& rect) + : layout_object(layout_object), rect(rect) {} + + bool IsEmpty() const { return !layout_object || rect.IsEmpty(); } +}; + // The print for |InlineBoxPosition| is available only for testing // in "webkit_unit_tests", and implemented in // "core/editing/VisibleUnitsTest.cpp". @@ -130,19 +142,6 @@ CORE_EXPORT UChar32 CharacterBefore(const VisiblePosition&); CORE_EXPORT UChar32 CharacterBefore(const VisiblePositionInFlatTree&); -// TODO(yosin) Since return value of |leftPositionOf()| with |VisiblePosition| -// isn't defined well on flat tree, we should not use it for a position in -// flat tree. -CORE_EXPORT VisiblePosition LeftPositionOf(const VisiblePosition&); -CORE_EXPORT VisiblePositionInFlatTree -LeftPositionOf(const VisiblePositionInFlatTree&); -// TODO(yosin) Since return value of |rightPositionOf()| with |VisiblePosition| -// isn't defined well on flat tree, we should not use it for a position in -// flat tree. -CORE_EXPORT VisiblePosition RightPositionOf(const VisiblePosition&); -CORE_EXPORT VisiblePositionInFlatTree -RightPositionOf(const VisiblePositionInFlatTree&); - CORE_EXPORT VisiblePosition NextPositionOf(const VisiblePosition&, EditingBoundaryCrossingRule = kCanCrossEditingBoundary); @@ -284,7 +283,6 @@ VisiblePosition EndOfBlock( const VisiblePosition&, EditingBoundaryCrossingRule = kCannotCrossEditingBoundary); -bool InSameBlock(const VisiblePosition&, const VisiblePosition&); bool IsStartOfBlock(const VisiblePosition&); bool IsEndOfBlock(const VisiblePosition&); @@ -320,10 +318,10 @@ CORE_EXPORT InlineBoxPosition ComputeInlineBoxPosition(const VisiblePosition&); // Rect is local to the returned layoutObject -CORE_EXPORT LayoutRect LocalCaretRectOfPosition(const PositionWithAffinity&, - LayoutObject*&); -CORE_EXPORT LayoutRect -LocalCaretRectOfPosition(const PositionInFlatTreeWithAffinity&, LayoutObject*&); +CORE_EXPORT LocalCaretRect +LocalCaretRectOfPosition(const PositionWithAffinity&); +CORE_EXPORT LocalCaretRect +LocalCaretRectOfPosition(const PositionInFlatTreeWithAffinity&); bool HasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*); // Returns a hit-tested VisiblePosition for the given point in contents-space @@ -377,6 +375,10 @@ VisiblePosition HonorEditingBoundaryAtOrBefore(const VisiblePosition&, const Position&); +VisiblePositionInFlatTree HonorEditingBoundaryAtOrBefore( + const VisiblePositionInFlatTree&, + const PositionInFlatTree&); + Position NextRootInlineBoxCandidatePosition(Node*, const VisiblePosition&, EditableType);
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsSentence.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsSentence.cpp new file mode 100644 index 0000000..a88e9d7 --- /dev/null +++ b/third_party/WebKit/Source/core/editing/VisibleUnitsSentence.cpp
@@ -0,0 +1,163 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. 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. + */ + +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/editing/VisibleUnits.h" + +#include "platform/text/TextBreakIterator.h" + +namespace blink { + +namespace { + +unsigned EndSentenceBoundary(const UChar* characters, + unsigned length, + unsigned, + BoundarySearchContextAvailability, + bool&) { + TextBreakIterator* iterator = SentenceBreakIterator(characters, length); + return iterator->next(); +} + +unsigned NextSentencePositionBoundary(const UChar* characters, + unsigned length, + unsigned, + BoundarySearchContextAvailability, + bool&) { + // FIXME: This is identical to endSentenceBoundary. This isn't right, it needs + // to move to the equivlant position in the following sentence. + TextBreakIterator* iterator = SentenceBreakIterator(characters, length); + return iterator->following(0); +} + +unsigned PreviousSentencePositionBoundary(const UChar* characters, + unsigned length, + unsigned, + BoundarySearchContextAvailability, + bool&) { + // FIXME: This is identical to startSentenceBoundary. I'm pretty sure that's + // not right. + TextBreakIterator* iterator = SentenceBreakIterator(characters, length); + // FIXME: The following function can return -1; we don't handle that. + return iterator->preceding(length); +} + +unsigned StartSentenceBoundary(const UChar* characters, + unsigned length, + unsigned, + BoundarySearchContextAvailability, + bool&) { + TextBreakIterator* iterator = SentenceBreakIterator(characters, length); + // FIXME: The following function can return -1; we don't handle that. + return iterator->preceding(length); +} + +// TODO(yosin) This includes the space after the punctuation that marks the end +// of the sentence. +template <typename Strategy> +static VisiblePositionTemplate<Strategy> EndOfSentenceAlgorithm( + const VisiblePositionTemplate<Strategy>& c) { + DCHECK(c.IsValid()) << c; + return CreateVisiblePosition(NextBoundary(c, EndSentenceBoundary), + VP_UPSTREAM_IF_POSSIBLE); +} + +template <typename Strategy> +VisiblePositionTemplate<Strategy> StartOfSentenceAlgorithm( + const VisiblePositionTemplate<Strategy>& c) { + DCHECK(c.IsValid()) << c; + return CreateVisiblePosition(PreviousBoundary(c, StartSentenceBoundary)); +} + +} // namespace + +VisiblePosition EndOfSentence(const VisiblePosition& c) { + return EndOfSentenceAlgorithm<EditingStrategy>(c); +} + +VisiblePositionInFlatTree EndOfSentence(const VisiblePositionInFlatTree& c) { + return EndOfSentenceAlgorithm<EditingInFlatTreeStrategy>(c); +} + +EphemeralRange ExpandEndToSentenceBoundary(const EphemeralRange& range) { + DCHECK(range.IsNotNull()); + const VisiblePosition& visible_end = + CreateVisiblePosition(range.EndPosition()); + DCHECK(visible_end.IsNotNull()); + const Position& sentence_end = EndOfSentence(visible_end).DeepEquivalent(); + // TODO(xiaochengh): |sentenceEnd < range.endPosition()| is possible, + // which would trigger a DCHECK in EphemeralRange's constructor if we return + // it directly. However, this shouldn't happen and needs to be fixed. + return EphemeralRange( + range.StartPosition(), + sentence_end.IsNotNull() && sentence_end > range.EndPosition() + ? sentence_end + : range.EndPosition()); +} + +EphemeralRange ExpandRangeToSentenceBoundary(const EphemeralRange& range) { + DCHECK(range.IsNotNull()); + const VisiblePosition& visible_start = + CreateVisiblePosition(range.StartPosition()); + DCHECK(visible_start.IsNotNull()); + const Position& sentence_start = + StartOfSentence(visible_start).DeepEquivalent(); + // TODO(xiaochengh): |sentenceStart > range.startPosition()| is possible, + // which would trigger a DCHECK in EphemeralRange's constructor if we return + // it directly. However, this shouldn't happen and needs to be fixed. + return ExpandEndToSentenceBoundary(EphemeralRange( + sentence_start.IsNotNull() && sentence_start < range.StartPosition() + ? sentence_start + : range.StartPosition(), + range.EndPosition())); +} + +VisiblePosition NextSentencePosition(const VisiblePosition& c) { + DCHECK(c.IsValid()) << c; + VisiblePosition next = CreateVisiblePosition( + NextBoundary(c, NextSentencePositionBoundary), VP_UPSTREAM_IF_POSSIBLE); + return HonorEditingBoundaryAtOrAfter(next, c.DeepEquivalent()); +} + +VisiblePosition PreviousSentencePosition(const VisiblePosition& c) { + DCHECK(c.IsValid()) << c; + VisiblePosition prev = CreateVisiblePosition( + PreviousBoundary(c, PreviousSentencePositionBoundary)); + return HonorEditingBoundaryAtOrBefore(prev, c.DeepEquivalent()); +} + +VisiblePosition StartOfSentence(const VisiblePosition& c) { + return StartOfSentenceAlgorithm<EditingStrategy>(c); +} + +VisiblePositionInFlatTree StartOfSentence(const VisiblePositionInFlatTree& c) { + return StartOfSentenceAlgorithm<EditingInFlatTreeStrategy>(c); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp index 8795eb6..f463135 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -1040,44 +1040,6 @@ EXPECT_FALSE(IsVisuallyEquivalentCandidate(Position(&GetDocument(), 0))); } -TEST_F(VisibleUnitsTest, leftPositionOf) { - const char* body_content = - "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b " - "id=three>333</b>"; - const char* shadow_content = - "<b id=four>4444</b><content select=#two></content><content " - "select=#one></content><b id=five>55555</b>"; - SetBodyContent(body_content); - ShadowRoot* shadow_root = SetShadowContent(shadow_content, "host"); - - Element* one = GetDocument().getElementById("one"); - Element* two = GetDocument().getElementById("two"); - Element* three = GetDocument().getElementById("three"); - Element* four = shadow_root->getElementById("four"); - Element* five = shadow_root->getElementById("five"); - - EXPECT_EQ( - Position(two->firstChild(), 1), - LeftPositionOf(CreateVisiblePosition(Position(one, 0))).DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(two->firstChild(), 1), - LeftPositionOf(CreateVisiblePosition(PositionInFlatTree(one, 0))) - .DeepEquivalent()); - - EXPECT_EQ( - Position(one->firstChild(), 0), - LeftPositionOf(CreateVisiblePosition(Position(two, 0))).DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(four->firstChild(), 3), - LeftPositionOf(CreateVisiblePosition(PositionInFlatTree(two, 0))) - .DeepEquivalent()); - - EXPECT_EQ(Position(two->firstChild(), 2), - LeftPositionOf(CreateVisiblePosition(Position(three, 0))) - .DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(five->firstChild(), 5), - LeftPositionOf(CreateVisiblePosition(PositionInFlatTree(three, 0))) - .DeepEquivalent()); -} - TEST_F(VisibleUnitsTest, localCaretRectOfPosition) { const char* body_content = "<p id='host'><b id='one'>1</b></p><b id='two'>22</b>"; @@ -1088,18 +1050,16 @@ Element* one = GetDocument().getElementById("one"); - LayoutObject* layout_object_from_dom_tree; - LayoutRect layout_rect_from_dom_tree = LocalCaretRectOfPosition( - Position(one->firstChild(), 0), layout_object_from_dom_tree); + const LocalCaretRect& caret_rect_from_dom_tree = + LocalCaretRectOfPosition(Position(one->firstChild(), 0)); - LayoutObject* layout_object_from_flat_tree; - LayoutRect layout_rect_from_flat_tree = LocalCaretRectOfPosition( - PositionInFlatTree(one->firstChild(), 0), layout_object_from_flat_tree); + const LocalCaretRect& caret_rect_from_flat_tree = + LocalCaretRectOfPosition(PositionInFlatTree(one->firstChild(), 0)); - EXPECT_TRUE(layout_object_from_dom_tree); - EXPECT_FALSE(layout_rect_from_dom_tree.IsEmpty()); - EXPECT_EQ(layout_object_from_dom_tree, layout_object_from_flat_tree); - EXPECT_EQ(layout_rect_from_dom_tree, layout_rect_from_flat_tree); + EXPECT_FALSE(caret_rect_from_dom_tree.IsEmpty()); + EXPECT_EQ(caret_rect_from_dom_tree.layout_object, + caret_rect_from_flat_tree.layout_object); + EXPECT_EQ(caret_rect_from_dom_tree.rect, caret_rect_from_flat_tree.rect); } TEST_F(VisibleUnitsTest, logicalEndOfLine) { @@ -1615,50 +1575,6 @@ Position(sample2->firstChild(), 0))); } -TEST_F(VisibleUnitsTest, rightPositionOf) { - const char* body_content = - "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b " - "id=three>333</b>"; - const char* shadow_content = - "<p id=four>4444</p><content select=#two></content><content " - "select=#one></content><p id=five>55555</p>"; - SetBodyContent(body_content); - ShadowRoot* shadow_root = SetShadowContent(shadow_content, "host"); - - Node* one = GetDocument().getElementById("one")->firstChild(); - Node* two = GetDocument().getElementById("two")->firstChild(); - Node* three = GetDocument().getElementById("three")->firstChild(); - Node* four = shadow_root->getElementById("four")->firstChild(); - Node* five = shadow_root->getElementById("five")->firstChild(); - - EXPECT_EQ(Position(), RightPositionOf(CreateVisiblePosition(Position(one, 1))) - .DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(five, 0), - RightPositionOf(CreateVisiblePosition(PositionInFlatTree(one, 1))) - .DeepEquivalent()); - - EXPECT_EQ(Position(one, 1), - RightPositionOf(CreateVisiblePosition(Position(two, 2))) - .DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(one, 1), - RightPositionOf(CreateVisiblePosition(PositionInFlatTree(two, 2))) - .DeepEquivalent()); - - EXPECT_EQ(Position(five, 0), - RightPositionOf(CreateVisiblePosition(Position(four, 4))) - .DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(two, 0), - RightPositionOf(CreateVisiblePosition(PositionInFlatTree(four, 4))) - .DeepEquivalent()); - - EXPECT_EQ(Position(), - RightPositionOf(CreateVisiblePosition(Position(five, 5))) - .DeepEquivalent()); - EXPECT_EQ(PositionInFlatTree(three, 0), - RightPositionOf(CreateVisiblePosition(PositionInFlatTree(five, 5))) - .DeepEquivalent()); -} - TEST_F(VisibleUnitsTest, startOfDocument) { const char* body_content = "<a id=host><b id=one>1</b><b id=two>22</b></a>"; const char* shadow_content =
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp index e3c6f79..7e2d71e 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
@@ -61,6 +61,14 @@ return cur_block; } +static bool InSameBlock(const VisiblePosition& a, const VisiblePosition& b) { + DCHECK(a.IsValid()) << a; + DCHECK(b.IsValid()) << b; + return !a.IsNull() && + EnclosingBlock(a.DeepEquivalent().ComputeContainerNode()) == + EnclosingBlock(b.DeepEquivalent().ComputeContainerNode()); +} + InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand( Document& document, bool must_use_default_paragraph_element,
diff --git a/third_party/WebKit/Source/core/exported/BUILD.gn b/third_party/WebKit/Source/core/exported/BUILD.gn index 02badcd..3324096 100644 --- a/third_party/WebKit/Source/core/exported/BUILD.gn +++ b/third_party/WebKit/Source/core/exported/BUILD.gn
@@ -30,6 +30,7 @@ "WebFileChooserCompletionImpl.h", "WebFormControlElement.cpp", "WebFormElement.cpp", + "WebFrame.cpp", "WebFrameContentDumper.cpp", "WebHeap.cpp", "WebHistoryItem.cpp", @@ -51,6 +52,8 @@ "WebPluginContainerImpl.h", "WebPluginScriptForbiddenScope.cpp", "WebRange.cpp", + "WebRemoteFrameImpl.cpp", + "WebRemoteFrameImpl.h", "WebRenderTheme.cpp", "WebScopedUserGesture.cpp", "WebScriptController.cpp",
diff --git a/third_party/WebKit/Source/web/WebFrame.cpp b/third_party/WebKit/Source/core/exported/WebFrame.cpp similarity index 98% rename from third_party/WebKit/Source/web/WebFrame.cpp rename to third_party/WebKit/Source/core/exported/WebFrame.cpp index 7446d1cc..9a4c200 100644 --- a/third_party/WebKit/Source/web/WebFrame.cpp +++ b/third_party/WebKit/Source/core/exported/WebFrame.cpp
@@ -11,7 +11,9 @@ #include "core/dom/UserGestureIndicator.h" #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameView.h" +#include "core/frame/OpenedFrameTracker.h" #include "core/frame/RemoteFrame.h" +#include "core/frame/RemoteFrameOwner.h" #include "core/frame/WebLocalFrameBase.h" #include "core/frame/WebRemoteFrameBase.h" #include "core/html/HTMLFrameElementBase.h" @@ -22,8 +24,6 @@ #include "public/web/WebElement.h" #include "public/web/WebFrameOwnerProperties.h" #include "public/web/WebSandboxFlags.h" -#include "web/OpenedFrameTracker.h" -#include "web/RemoteFrameOwner.h" namespace blink { @@ -201,6 +201,10 @@ opener_ = opener; } +void WebFrame::ClearOpener() { + SetOpener(nullptr); +} + void WebFrame::InsertAfter(WebFrame* new_child, WebFrame* previous_sibling) { new_child->parent_ = this;
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp similarity index 95% rename from third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp rename to third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp index cdc293c6..1748b82d 100644 --- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp
@@ -2,18 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "web/WebRemoteFrameImpl.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "bindings/core/v8/WindowProxy.h" #include "core/dom/Fullscreen.h" #include "core/dom/RemoteSecurityContext.h" #include "core/dom/SecurityContext.h" +#include "core/exported/WebFactory.h" #include "core/exported/WebViewBase.h" #include "core/frame/LocalFrameView.h" +#include "core/frame/RemoteFrameClientImpl.h" +#include "core/frame/RemoteFrameOwner.h" #include "core/frame/Settings.h" +#include "core/frame/WebLocalFrameBase.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/html/HTMLFrameOwnerElement.h" #include "core/layout/LayoutObject.h" +#include "core/page/ChromeClient.h" #include "core/page/Page.h" #include "platform/bindings/DOMWrapperWorld.h" #include "platform/feature_policy/FeaturePolicy.h" @@ -27,8 +32,6 @@ #include "public/web/WebRange.h" #include "public/web/WebTreeScopeType.h" #include "v8/include/v8.h" -#include "web/RemoteFrameOwner.h" -#include "web/WebLocalFrameImpl.h" namespace blink { @@ -122,9 +125,11 @@ } WebView* WebRemoteFrameImpl::View() const { - if (!GetFrame()) + if (!GetFrame()) { return nullptr; - return WebViewBase::FromPage(GetFrame()->GetPage()); + } + DCHECK(GetFrame()->GetPage()); + return GetFrame()->GetPage()->GetChromeClient().GetWebView(); } WebDocument WebRemoteFrameImpl::GetDocument() const { @@ -281,7 +286,7 @@ const WebParsedFeaturePolicy& container_policy, const WebFrameOwnerProperties& frame_owner_properties, WebFrame* opener) { - WebLocalFrameImpl* child = WebLocalFrameImpl::Create( + WebLocalFrameBase* child = WebFactory::GetInstance().CreateWebLocalFrameBase( scope, client, interface_provider, interface_registry, opener); InsertAfter(child, previous_sibling); RemoteFrameOwner* owner = @@ -330,7 +335,9 @@ WebRemoteFrameImpl* WebRemoteFrameImpl::FromFrame(RemoteFrame& frame) { if (!frame.Client()) return nullptr; - return static_cast<RemoteFrameClientImpl*>(frame.Client())->GetWebFrame(); + RemoteFrameClientImpl* client = + static_cast<RemoteFrameClientImpl*>(frame.Client()); + return ToWebRemoteFrameImpl(client->GetWebFrame()); } void WebRemoteFrameImpl::SetReplicatedOrigin(const WebSecurityOrigin& origin) { @@ -428,8 +435,8 @@ void WebRemoteFrameImpl::DidStopLoading() { GetFrame()->SetIsLoading(false); if (Parent() && Parent()->IsWebLocalFrame()) { - WebLocalFrameImpl* parent_frame = - ToWebLocalFrameImpl(Parent()->ToWebLocalFrame()); + WebLocalFrameBase* parent_frame = + ToWebLocalFrameBase(Parent()->ToWebLocalFrame()); parent_frame->GetFrame()->GetDocument()->CheckCompleted(); } }
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h similarity index 96% rename from third_party/WebKit/Source/web/WebRemoteFrameImpl.h rename to third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h index 23d9bb7f..0792d9a 100644 --- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h
@@ -5,24 +5,24 @@ #ifndef WebRemoteFrameImpl_h #define WebRemoteFrameImpl_h +#include "core/CoreExport.h" #include "core/frame/RemoteFrame.h" #include "core/frame/WebRemoteFrameBase.h" #include "platform/heap/SelfKeepAlive.h" #include "platform/wtf/Compiler.h" #include "public/platform/WebInsecureRequestPolicy.h" #include "public/web/WebRemoteFrameClient.h" -#include "web/RemoteFrameClientImpl.h" -#include "web/WebExport.h" namespace blink { class FrameOwner; class RemoteFrame; +class RemoteFrameClientImpl; enum class WebFrameLoadType; class WebAssociatedURLLoader; struct WebAssociatedURLLoaderOptions; -class WEB_EXPORT WebRemoteFrameImpl final +class CORE_EXPORT WebRemoteFrameImpl final : NON_EXPORTED_BASE(public WebRemoteFrameBase) { public: static WebRemoteFrameImpl* Create(WebTreeScopeType, @@ -130,9 +130,9 @@ const AtomicString& name) override; RemoteFrame* GetFrame() const override { return frame_.Get(); } - void SetCoreFrame(RemoteFrame*); + void SetCoreFrame(RemoteFrame*) override; - WebRemoteFrameClient* Client() const { return client_; } + WebRemoteFrameClient* Client() const override { return client_; } static WebRemoteFrameImpl* FromFrame(RemoteFrame&);
diff --git a/third_party/WebKit/Source/core/exported/WebViewBase.h b/third_party/WebKit/Source/core/exported/WebViewBase.h index 92d509e..218e429 100644 --- a/third_party/WebKit/Source/core/exported/WebViewBase.h +++ b/third_party/WebKit/Source/core/exported/WebViewBase.h
@@ -66,7 +66,6 @@ virtual Page* GetPage() const = 0; virtual Frame* FocusedCoreFrame() const = 0; - static WebViewBase* FromPage(Page*); static HashSet<WebViewBase*>& AllInstances(); // Returns the main frame associated with this view. This may be null when
diff --git a/third_party/WebKit/Source/core/frame/BUILD.gn b/third_party/WebKit/Source/core/frame/BUILD.gn index 743e275..cbc5f765 100644 --- a/third_party/WebKit/Source/core/frame/BUILD.gn +++ b/third_party/WebKit/Source/core/frame/BUILD.gn
@@ -75,6 +75,8 @@ "NavigatorLanguage.cpp", "NavigatorLanguage.h", "NavigatorOnLine.h", + "OpenedFrameTracker.cpp", + "OpenedFrameTracker.h", "PageScaleConstraints.cpp", "PageScaleConstraints.h", "PageScaleConstraintsSet.cpp", @@ -90,6 +92,10 @@ "RemoteFrame.cpp", "RemoteFrame.h", "RemoteFrameClient.h", + "RemoteFrameClientImpl.cpp", + "RemoteFrameClientImpl.h", + "RemoteFrameOwner.cpp", + "RemoteFrameOwner.h", "RemoteFrameView.cpp", "RemoteFrameView.h", "ResizeViewportAnchor.cpp",
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp index e6981c8..ecaa21a9 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -3276,6 +3276,7 @@ if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { if (GetLayoutView()->Layer()->NeedsRepaint()) { + paint_controller_->SetupRasterUnderInvalidationChecking(); GraphicsContext graphics_context(*paint_controller_); if (RuntimeEnabledFeatures::PrintBrowserEnabled()) graphics_context.SetPrinting(true); @@ -3355,7 +3356,6 @@ paint_artifact_compositor_->Update( paint_controller_->GetPaintArtifact(), - paint_controller_->PaintChunksRasterInvalidationTrackingMap(), is_storing_composited_layer_debug_info_, composited_element_ids); }
diff --git a/third_party/WebKit/Source/web/OpenedFrameTracker.cpp b/third_party/WebKit/Source/core/frame/OpenedFrameTracker.cpp similarity index 95% rename from third_party/WebKit/Source/web/OpenedFrameTracker.cpp rename to third_party/WebKit/Source/core/frame/OpenedFrameTracker.cpp index 18b49fe..b110a5c 100644 --- a/third_party/WebKit/Source/web/OpenedFrameTracker.cpp +++ b/third_party/WebKit/Source/core/frame/OpenedFrameTracker.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "web/OpenedFrameTracker.h" +#include "core/frame/OpenedFrameTracker.h" #include "platform/heap/Handle.h" #include "public/web/WebFrame.h"
diff --git a/third_party/WebKit/Source/web/OpenedFrameTracker.h b/third_party/WebKit/Source/core/frame/OpenedFrameTracker.h similarity index 100% rename from third_party/WebKit/Source/web/OpenedFrameTracker.h rename to third_party/WebKit/Source/core/frame/OpenedFrameTracker.h
diff --git a/third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp similarity index 94% rename from third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp rename to third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp index 9e14f40..e2ebce4 100644 --- a/third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp +++ b/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "web/RemoteFrameClientImpl.h" +#include "core/frame/RemoteFrameClientImpl.h" #include <memory> #include "core/events/KeyboardEvent.h" @@ -12,6 +12,7 @@ #include "core/frame/RemoteFrame.h" #include "core/frame/RemoteFrameView.h" #include "core/frame/WebLocalFrameBase.h" +#include "core/frame/WebRemoteFrameBase.h" #include "core/layout/api/LayoutEmbeddedContentItem.h" #include "core/layout/api/LayoutItem.h" #include "platform/exported/WrappedResourceRequest.h" @@ -20,7 +21,6 @@ #include "platform/weborigin/SecurityPolicy.h" #include "platform/wtf/PtrUtil.h" #include "public/web/WebRemoteFrameClient.h" -#include "web/WebRemoteFrameImpl.h" namespace blink { @@ -38,11 +38,11 @@ } // namespace -RemoteFrameClientImpl::RemoteFrameClientImpl(WebRemoteFrameImpl* web_frame) +RemoteFrameClientImpl::RemoteFrameClientImpl(WebRemoteFrameBase* web_frame) : web_frame_(web_frame) {} RemoteFrameClientImpl* RemoteFrameClientImpl::Create( - WebRemoteFrameImpl* web_frame) { + WebRemoteFrameBase* web_frame) { return new RemoteFrameClientImpl(web_frame); } @@ -107,19 +107,21 @@ void RemoteFrameClientImpl::Navigate(const ResourceRequest& request, bool should_replace_current_entry) { - if (web_frame_->Client()) + if (web_frame_->Client()) { web_frame_->Client()->Navigate(WrappedResourceRequest(request), should_replace_current_entry); + } } void RemoteFrameClientImpl::Reload( FrameLoadType load_type, ClientRedirectPolicy client_redirect_policy) { DCHECK(IsReloadLoadType(load_type)); - if (web_frame_->Client()) + if (web_frame_->Client()) { web_frame_->Client()->Reload( static_cast<WebFrameLoadType>(load_type), static_cast<WebClientRedirectPolicy>(client_redirect_policy)); + } } unsigned RemoteFrameClientImpl::BackForwardLength() { @@ -134,10 +136,11 @@ MessageEvent* event, PassRefPtr<SecurityOrigin> target, LocalFrame* source_frame) const { - if (web_frame_->Client()) + if (web_frame_->Client()) { web_frame_->Client()->ForwardPostMessage( WebLocalFrameBase::FromFrame(source_frame), web_frame_, WebSecurityOrigin(std::move(target)), WebDOMMessageEvent(event)); + } } void RemoteFrameClientImpl::FrameRectsChanged(const IntRect& frame_rect) {
diff --git a/third_party/WebKit/Source/web/RemoteFrameClientImpl.h b/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h similarity index 85% rename from third_party/WebKit/Source/web/RemoteFrameClientImpl.h rename to third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h index 6e30c2b..98a1e5b 100644 --- a/third_party/WebKit/Source/web/RemoteFrameClientImpl.h +++ b/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h
@@ -8,11 +8,11 @@ #include "core/frame/RemoteFrameClient.h" namespace blink { -class WebRemoteFrameImpl; +class WebRemoteFrameBase; class RemoteFrameClientImpl final : public RemoteFrameClient { public: - static RemoteFrameClientImpl* Create(WebRemoteFrameImpl*); + static RemoteFrameClientImpl* Create(WebRemoteFrameBase*); DECLARE_VIRTUAL_TRACE(); @@ -41,12 +41,12 @@ void AdvanceFocus(WebFocusType, LocalFrame*) override; void VisibilityChanged(bool visible) override; - WebRemoteFrameImpl* GetWebFrame() const { return web_frame_; } + WebRemoteFrameBase* GetWebFrame() const { return web_frame_; } private: - explicit RemoteFrameClientImpl(WebRemoteFrameImpl*); + explicit RemoteFrameClientImpl(WebRemoteFrameBase*); - Member<WebRemoteFrameImpl> web_frame_; + Member<WebRemoteFrameBase> web_frame_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/web/RemoteFrameOwner.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameOwner.cpp similarity index 97% rename from third_party/WebKit/Source/web/RemoteFrameOwner.cpp rename to third_party/WebKit/Source/core/frame/RemoteFrameOwner.cpp index 85b667f..2d217d5f 100644 --- a/third_party/WebKit/Source/web/RemoteFrameOwner.cpp +++ b/third_party/WebKit/Source/core/frame/RemoteFrameOwner.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. -#include "web/RemoteFrameOwner.h" +#include "core/frame/RemoteFrameOwner.h" #include "core/frame/LocalFrame.h" #include "core/frame/WebLocalFrameBase.h"
diff --git a/third_party/WebKit/Source/web/RemoteFrameOwner.h b/third_party/WebKit/Source/core/frame/RemoteFrameOwner.h similarity index 98% rename from third_party/WebKit/Source/web/RemoteFrameOwner.h rename to third_party/WebKit/Source/core/frame/RemoteFrameOwner.h index 650575b..a6fe4d2 100644 --- a/third_party/WebKit/Source/web/RemoteFrameOwner.h +++ b/third_party/WebKit/Source/core/frame/RemoteFrameOwner.h
@@ -5,6 +5,7 @@ #ifndef RemoteFrameOwner_h #define RemoteFrameOwner_h +#include "core/CoreExport.h" #include "core/frame/FrameOwner.h" #include "platform/scroll/ScrollTypes.h" #include "public/web/WebFrameOwnerProperties.h" @@ -16,7 +17,7 @@ // 1. Allows the local frame's loader to retrieve sandbox flags associated with // its owner element in another process. // 2. Trigger a load event on its owner element once it finishes a load. -class RemoteFrameOwner final +class CORE_EXPORT RemoteFrameOwner final : public GarbageCollectedFinalized<RemoteFrameOwner>, public FrameOwner { USING_GARBAGE_COLLECTED_MIXIN(RemoteFrameOwner);
diff --git a/third_party/WebKit/Source/core/frame/WebRemoteFrameBase.h b/third_party/WebKit/Source/core/frame/WebRemoteFrameBase.h index 3a6cf40..77aa943 100644 --- a/third_party/WebKit/Source/core/frame/WebRemoteFrameBase.h +++ b/third_party/WebKit/Source/core/frame/WebRemoteFrameBase.h
@@ -13,6 +13,7 @@ class FrameOwner; class Page; class RemoteFrame; +class WebRemoteFrameClient; class WebRemoteFrameBase : public GarbageCollectedFinalized<WebRemoteFrameBase>, public WebRemoteFrame { @@ -23,6 +24,8 @@ FrameOwner*, const AtomicString& name) = 0; virtual RemoteFrame* GetFrame() const = 0; + virtual void SetCoreFrame(RemoteFrame*) = 0; + virtual WebRemoteFrameClient* Client() const = 0; DEFINE_INLINE_VIRTUAL_TRACE() {}
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp index 4c7d6ed..b5cd50e 100644 --- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp +++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
@@ -276,7 +276,7 @@ DOMPoint* DOMMatrixReadOnly::transformPoint(const DOMPointInit& point) { if (is2D() && point.z() == 0 && point.w() == 1) { - double x = point.x() * m11() + point.y() * m12() + m41(); + double x = point.x() * m11() + point.y() * m21() + m41(); double y = point.x() * m12() + point.y() * m22() + m42(); return DOMPoint::Create(x, y, 0, 1); }
diff --git a/third_party/WebKit/Source/core/geometry/DOMPointReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMPointReadOnly.cpp index fa25625..c15c6e64 100644 --- a/third_party/WebKit/Source/core/geometry/DOMPointReadOnly.cpp +++ b/third_party/WebKit/Source/core/geometry/DOMPointReadOnly.cpp
@@ -42,7 +42,7 @@ if (matrix->is2D() && z() == 0 && w() == 1) { double transformed_x = - x() * matrix->m11() + y() * matrix->m12() + matrix->m41(); + x() * matrix->m11() + y() * matrix->m21() + matrix->m41(); double transformed_y = x() * matrix->m12() + y() * matrix->m22() + matrix->m42(); return DOMPoint::Create(transformed_x, transformed_y, 0, 1);
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h index bce174e6..f29eaca5 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -414,7 +414,7 @@ void DisconnectedFromRemoteDevice() final; void CancelledRemotePlaybackRequest() final; void RemotePlaybackStarted() final; - void OnBecamePersistentVideo(bool) override{}; + void OnBecamePersistentVideo(bool) override {} bool HasSelectedVideoTrack() final; WebMediaPlayer::TrackId GetSelectedVideoTrackId() final; bool IsAutoplayingMuted() final;
diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp index 1f1b8df..4683ab5 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp
@@ -76,7 +76,8 @@ void HTMLTableElement::setCaption(HTMLTableCaptionElement* new_caption, ExceptionState& exception_state) { deleteCaption(); - InsertBefore(new_caption, firstChild(), exception_state); + if (new_caption) + InsertBefore(new_caption, firstChild(), exception_state); } HTMLTableSectionElement* HTMLTableElement::tHead() const { @@ -87,6 +88,8 @@ void HTMLTableElement::setTHead(HTMLTableSectionElement* new_head, ExceptionState& exception_state) { deleteTHead(); + if (!new_head) + return; HTMLElement* child; for (child = Traversal<HTMLElement>::FirstChild(*this); child;
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp index ab50cc7..2c256d24 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp +++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp
@@ -38,8 +38,8 @@ MOCK_METHOD0(SignalTaskSwitchInCompleteTimeoutEventForTesting, void()); protected: - void CreateBlobAndReturnResult() override{}; - void CreateNullAndReturnResult() override{}; + void CreateBlobAndReturnResult() override {} + void CreateNullAndReturnResult() override {} void SignalAlternativeCodePathFinishedForTesting() override; void PostDelayedTaskToCurrentThread(const WebTraceLocation&, std::unique_ptr<WTF::Closure>,
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp index 2b101935..8211585 100644 --- a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp +++ b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp
@@ -211,12 +211,20 @@ } bool AutoplayPolicy::IsAutoplayingMutedInternal(bool muted) const { + return !element_->paused() && IsOrWillBeAutoplayingMutedInternal(muted); +} + +bool AutoplayPolicy::IsOrWillBeAutoplayingMuted() const { + return IsOrWillBeAutoplayingMutedInternal(element_->muted()); +} + +bool AutoplayPolicy::IsOrWillBeAutoplayingMutedInternal(bool muted) const { if (!element_->IsHTMLVideoElement() || !RuntimeEnabledFeatures::AutoplayMutedVideosEnabled()) { return false; } - return !element_->paused() && muted && IsLockedPendingUserGesture(); + return muted && IsLockedPendingUserGesture(); } bool AutoplayPolicy::IsLockedPendingUserGesture() const {
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.h b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.h index bf3be2c..6f2a1c04 100644 --- a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.h +++ b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.h
@@ -61,8 +61,13 @@ // only be called once per call of setMuted(). bool RequestAutoplayUnmute(); + // Indicates the media element is autoplaying because of being muted. bool IsAutoplayingMuted() const; + // Indicates the media element is or will autoplay because of being + // muted. + CORE_EXPORT bool IsOrWillBeAutoplayingMuted() const; + // Unlock user gesture if a user gesture can be utilized. void TryUnlockingUserGesture(); @@ -108,6 +113,7 @@ bool IsAutoplayAllowedPerSettings() const; bool IsAutoplayingMutedInternal(bool muted) const; + bool IsOrWillBeAutoplayingMutedInternal(bool muted) const; // Called when the video visibility changes while autoplaying muted, will // pause the video when invisible and resume the video when visible.
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp index 8725c86..4d6fa7b 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp
@@ -25,7 +25,7 @@ : PrerendererClient(page), is_prefetch_only_(is_prefetch_only) {} private: - void WillAddPrerender(Prerender*) override{}; + void WillAddPrerender(Prerender*) override {} bool IsPrefetchOnly() override { return is_prefetch_only_; } bool is_prefetch_only_;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h b/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h index 7b05897..860721c 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
@@ -28,7 +28,7 @@ NGLogicalRect rect; // Type of this exclusion. - Type type; + Type type = kExclusionTypeUndefined; bool operator==(const NGExclusion& other) const;
diff --git a/third_party/WebKit/Source/core/loader/EmptyClients.h b/third_party/WebKit/Source/core/loader/EmptyClients.h index e23bbf49d..1fbd94c 100644 --- a/third_party/WebKit/Source/core/loader/EmptyClients.h +++ b/third_party/WebKit/Source/core/loader/EmptyClients.h
@@ -81,7 +81,7 @@ ~EmptyChromeClient() override {} void ChromeDestroyed() override {} - void* WebView() const override { return nullptr; } + WebViewBase* GetWebView() const override { return nullptr; } void SetWindowRect(const IntRect&, LocalFrame&) override {} IntRect RootWindowRect() override { return IntRect(); } @@ -152,7 +152,7 @@ bool HasOpenedPopup() const override { return false; } PopupMenu* OpenPopupMenu(LocalFrame&, HTMLSelectElement&) override; PagePopup* OpenPagePopup(PagePopupClient*) override { return nullptr; } - void ClosePagePopup(PagePopup*) override{}; + void ClosePagePopup(PagePopup*) override {} DOMWindow* PagePopupWindowForTesting() const override { return nullptr; } bool TabsToLinks() override { return false; }
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index 1b32305..8d932672 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -296,6 +296,8 @@ void FrameFetchContext::PrepareRequest(ResourceRequest& request, RedirectType redirect_type) { + SetFirstPartyCookieAndRequestorOrigin(request); + GetFrame()->Loader().ApplyUserAgent(request); GetLocalFrameClient()->DispatchWillSendRequest(request); @@ -687,8 +689,6 @@ const ResourceLoaderOptions& options, SecurityViolationReportingPolicy reporting_policy, ResourceRequest& request) { - SetFirstPartyCookieAndRequestorOrigin(request); - // Before modifying the request for CSP, evaluate report-only headers. This // allows site owners to learn about requests that are being modified // (e.g. mixed content that is being upgraded by upgrade-insecure-requests). @@ -703,27 +703,37 @@ void FrameFetchContext::SetFirstPartyCookieAndRequestorOrigin( ResourceRequest& request) { - if (!GetDocument()) - return; - + // Set the first party for cookies url if it has not been set yet (new + // requests). This value will be updated during redirects, consistent with + // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1.1? if (request.FirstPartyForCookies().IsNull()) { - request.SetFirstPartyForCookies( - GetDocument() ? GetDocument()->FirstPartyForCookies() - : SecurityOrigin::UrlWithUniqueSecurityOrigin()); + if (request.GetFrameType() == WebURLRequest::kFrameTypeTopLevel) { + request.SetFirstPartyForCookies(request.Url()); + } else { + // Use GetDocument() for subresource or nested frame cases, + // GetFrame()->GetDocument() otherwise. + Document* document = + GetDocument() ? GetDocument() : GetFrame()->GetDocument(); + request.SetFirstPartyForCookies(document->FirstPartyForCookies()); + } } - // Subresource requests inherit their requestor origin from |m_document| - // directly. Top-level and nested frame types are taken care of in - // 'FrameLoadRequest()'. Auxiliary frame types in 'createWindow()' and - // 'FrameLoader::load'. - // TODO(mkwst): It would be cleaner to adjust blink::ResourceRequest to - // initialize itself with a `nullptr` initiator so that this can be a simple - // `isNull()` check. https://crbug.com/625969 - if (request.GetFrameType() == WebURLRequest::kFrameTypeNone && - request.RequestorOrigin()->IsUnique()) { - request.SetRequestorOrigin(GetDocument()->IsSandboxed(kSandboxOrigin) - ? SecurityOrigin::Create(document_->Url()) - : document_->GetSecurityOrigin()); + // Subresource requests inherit their requestor origin from |document_| + // directly. Top-level frame types are taken care of in 'FrameLoadRequest()'. + // Auxiliary frame types in 'CreateWindow()' and 'FrameLoader::Load'. + if (!request.RequestorOrigin()) { + if (request.GetFrameType() == WebURLRequest::kFrameTypeNone) { + Document* document = GetDocument(); + request.SetRequestorOrigin(document->IsSandboxed(kSandboxOrigin) + ? SecurityOrigin::Create(document->Url()) + : document->GetSecurityOrigin()); + } else { + // Set the requestor origin to the same origin as the frame's document + // if it hasn't yet been set. (We may hit here for nested frames and + // redirect cases) + request.SetRequestorOrigin( + GetFrame()->GetDocument()->GetSecurityOrigin()); + } } }
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index 1d81f49f..4e22089 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -768,9 +768,9 @@ struct TestCase { const char* document_url; bool document_sandboxed; - const char* requestor_origin; // "" => unique origin + const char* requestor_origin; // "" => null WebURLRequest::FrameType frame_type; - const char* serialized_origin; // "" => unique origin + const char* serialized_origin; // "" => null } cases[] = { // No document origin => unique request origin {"", false, "", WebURLRequest::kFrameTypeNone, "null"}, @@ -783,24 +783,17 @@ "http://example.test"}, // If the request already has a requestor origin, then - // 'setFirstPartyCookieAndRequestorOrigin' leaves it alone: + // 'SetFirstPartyCookieAndRequestorOrigin' leaves it alone: {"http://example.test", false, "http://not-example.test", WebURLRequest::kFrameTypeNone, "http://not-example.test"}, {"http://example.test", true, "http://not-example.test", WebURLRequest::kFrameTypeNone, "http://not-example.test"}, - - // If the request's frame type is not 'none', then - // 'setFirstPartyCookieAndRequestorOrigin' - // leaves it alone: - {"http://example.test", false, "", WebURLRequest::kFrameTypeTopLevel, ""}, - {"http://example.test", false, "", WebURLRequest::kFrameTypeAuxiliary, - ""}, - {"http://example.test", false, "", WebURLRequest::kFrameTypeNested, ""}, }; + int index = 0; for (const auto& test : cases) { - SCOPED_TRACE(::testing::Message() - << test.document_url << " => " << test.serialized_origin); + SCOPED_TRACE(::testing::Message() << index++ << " " << test.document_url + << " => " << test.serialized_origin); // Set up a new document to ensure sandbox flags are cleared: dummy_page_holder = DummyPageHolder::Create(IntSize(500, 500)); dummy_page_holder->GetPage().SetDeviceScaleFactorDeprecated(1.0); @@ -824,7 +817,7 @@ // Compare the populated |requestorOrigin| against |test.serializedOrigin| fetch_context->SetFirstPartyCookieAndRequestorOrigin(request); if (strlen(test.serialized_origin) == 0) { - EXPECT_TRUE(request.RequestorOrigin()->IsUnique()); + EXPECT_TRUE(!request.RequestorOrigin()); } else { EXPECT_EQ(String(test.serialized_origin), request.RequestorOrigin()->ToString());
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp index 9b8a99fe..ba0a692 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -262,10 +262,7 @@ ResourceRequest& out_request) { if (out_request.FirstPartyForCookies().IsNull()) out_request.SetFirstPartyForCookies(FirstPartyForCookies()); - // TODO(mkwst): It would be cleaner to adjust blink::ResourceRequest to - // initialize itself with a `nullptr` initiator so that this can be a simple - // `isNull()` check. https://crbug.com/625969 - if (out_request.RequestorOrigin()->IsUnique()) + if (!out_request.RequestorOrigin()) out_request.SetRequestorOrigin(GetSecurityOrigin()); }
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp index 92ea292..cccc8da 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
@@ -69,11 +69,13 @@ ScriptModule CompileModule(const String& script, const String& url_str, AccessControlStatus access_control_status, - const TextPosition& position) override { + const TextPosition& position, + ExceptionState& exception_state) override { ScriptState::Scope scope(script_state_.Get()); - return ScriptModule::Compile(script_state_->GetIsolate(), - "export default 'foo';", "", - access_control_status); + return ScriptModule::Compile( + script_state_->GetIsolate(), "export default 'foo';", "", + access_control_status, TextPosition::MinimumPosition(), + exception_state); } DECLARE_TRACE();
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp index fcf2142..942c9fa 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp
@@ -78,7 +78,8 @@ ScriptModule script_module = ScriptModule::Compile( script_state_->GetIsolate(), source_text.ToString(), url.GetString(), - kSharableCrossOrigin); + kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ModuleScript* module_script = ModuleScript::CreateForTest( this, script_module, url, "", kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); @@ -131,7 +132,8 @@ ScriptModule script_module = ScriptModule::Compile( script_state_->GetIsolate(), "export default 'pineapples';", - url.GetString(), kSharableCrossOrigin); + url.GetString(), kSharableCrossOrigin, TextPosition::MinimumPosition(), + ASSERT_NO_EXCEPTION); ModuleScript* module_script = ModuleScript::CreateForTest( this, script_module, url, "", kParserInserted, WebURLRequest::kFetchCredentialsModeOmit);
diff --git a/third_party/WebKit/Source/core/page/ChromeClient.h b/third_party/WebKit/Source/core/page/ChromeClient.h index 2dd3171..215af09 100644 --- a/third_party/WebKit/Source/core/page/ChromeClient.h +++ b/third_party/WebKit/Source/core/page/ChromeClient.h
@@ -83,6 +83,7 @@ class WebLayerTreeView; class WebLocalFrameBase; class WebRemoteFrameBase; +class WebViewBase; struct CompositedSelection; struct DateTimeChooserParameters; @@ -169,7 +170,7 @@ String& result); virtual bool TabsToLinks() = 0; - virtual void* WebView() const = 0; + virtual WebViewBase* GetWebView() const = 0; // Methods used by PlatformChromeClient. virtual WebScreenInfo GetScreenInfo() const = 0; @@ -234,13 +235,13 @@ // Pass nullptr as the GraphicsLayer to detach the root layer. // This sets the graphics layer for the LocalFrame's WebWidget, if it has - // one. Otherwise it sets it for the WebViewImpl. + // one. Otherwise it sets it for the WebViewBase. virtual void AttachRootGraphicsLayer(GraphicsLayer*, LocalFrame* local_root) = 0; // Pass nullptr as the WebLayer to detach the root layer. // This sets the WebLayer for the LocalFrame's WebWidget, if it has - // one. Otherwise it sets it for the WebViewImpl. + // one. Otherwise it sets it for the WebViewBase. virtual void AttachRootLayer(WebLayer*, LocalFrame* local_root) = 0; virtual void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*,
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index 1fb2218f..fe4f6c4 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -2914,8 +2914,12 @@ if (this->IsSelfPaintingLayer() == is_self_painting_layer) return; + // Invalidate the old subsequences which may no longer contain some + // descendants of this layer because of the self painting status change. + SetNeedsRepaint(); is_self_painting_layer_ = is_self_painting_layer; self_painting_status_changed_ = true; + SetNeedsRepaint(); if (PaintLayer* parent = this->Parent()) { parent->DirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp index a97ecff..5eda7d5 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
@@ -610,7 +610,7 @@ " will-change: transform'>" " <div id='containingBlock' style='position: relative; z-index: 0'>" " <span id='span' style='opacity: 0.9'>" - " <div id='target' style='float: right; overflow: hidden'</div>" + " <div id='target' style='float: right; overflow: hidden'></div>" " </span>" " </div>" "</div>"); @@ -635,7 +635,7 @@ " will-change: transform'>" " <div id='containingBlock' style='position: relative; z-index: 0'>" " <span id='span' style='opacity: 0.9; will-change: transform'>" - " <div id='target' style='float: right; overflow: hidden'</div>" + " <div id='target' style='float: right; overflow: hidden'></div>" " </span>" " </div>" "</div>"); @@ -1034,4 +1034,38 @@ EXPECT_NE(nullptr, target_paint_layer->Transform()); } +TEST_P(PaintLayerTest, NeedsRepaintOnSelfPaintingStatusChange) { + SetBodyInnerHTML( + "<span id='span' style='opacity: 0.1'>" + " <div id='target' style='overflow: hidden; float: left;" + " column-width: 10px'>" + " </div>" + "</span>"); + + auto* span_layer = + ToLayoutBoxModelObject(GetLayoutObjectByElementId("span"))->Layer(); + auto* target_element = GetDocument().getElementById("target"); + auto* target_object = target_element->GetLayoutObject(); + auto* target_layer = ToLayoutBoxModelObject(target_object)->Layer(); + + // Target layer is self painting because it is a multicol container. + EXPECT_TRUE(target_layer->IsSelfPaintingLayer()); + EXPECT_EQ(span_layer, target_layer->CompositingContainer()); + EXPECT_FALSE(target_layer->NeedsRepaint()); + EXPECT_FALSE(span_layer->NeedsRepaint()); + + // Removing column-width: 10px makes target layer no longer self-painting, + // and change its compositing container. The original compositing container + // span_layer should be marked NeedsRepaint. + target_element->setAttribute(HTMLNames::styleAttr, + "overflow: hidden; float: left"); + GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); + EXPECT_FALSE(target_layer->IsSelfPaintingLayer()); + EXPECT_EQ(span_layer->Parent(), target_layer->CompositingContainer()); + EXPECT_TRUE(target_layer->NeedsRepaint()); + EXPECT_TRUE(target_layer->CompositingContainer()->NeedsRepaint()); + EXPECT_TRUE(span_layer->NeedsRepaint()); + GetDocument().View()->UpdateAllLifecyclePhases(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index ba9c457..a3ae4a9 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -2153,10 +2153,12 @@ ->auto_repeat_rows_insertion_point_; } AutoRepeatType GridAutoRepeatColumnsType() const { - return rare_non_inherited_data_->grid_data_->auto_repeat_columns_type_; + return static_cast<AutoRepeatType>( + rare_non_inherited_data_->grid_data_->auto_repeat_columns_type_); } AutoRepeatType GridAutoRepeatRowsType() const { - return rare_non_inherited_data_->grid_data_->auto_repeat_rows_type_; + return static_cast<AutoRepeatType>( + rare_non_inherited_data_->grid_data_->auto_repeat_rows_type_); } const NamedGridLinesMap& NamedGridColumnLines() const { return rare_non_inherited_data_->grid_data_->named_grid_column_lines_;
diff --git a/third_party/WebKit/Source/core/style/StyleGridData.cpp b/third_party/WebKit/Source/core/style/StyleGridData.cpp index 2ffb81aa..fdab2220 100644 --- a/third_party/WebKit/Source/core/style/StyleGridData.cpp +++ b/third_party/WebKit/Source/core/style/StyleGridData.cpp
@@ -45,7 +45,6 @@ ComputedStyle::InitialOrderedNamedGridColumnLines()), auto_repeat_ordered_named_grid_row_lines_( ComputedStyle::InitialOrderedNamedGridRowLines()), - grid_auto_flow_(ComputedStyle::InitialGridAutoFlow()), grid_auto_rows_(ComputedStyle::InitialGridAutoRows()), grid_auto_columns_(ComputedStyle::InitialGridAutoColumns()), named_grid_area_(ComputedStyle::InitialNamedGridArea()), @@ -59,6 +58,7 @@ ComputedStyle::InitialGridAutoRepeatInsertionPoint()), auto_repeat_rows_insertion_point_( ComputedStyle::InitialGridAutoRepeatInsertionPoint()), + grid_auto_flow_(ComputedStyle::InitialGridAutoFlow()), auto_repeat_columns_type_(ComputedStyle::InitialGridAutoRepeatType()), auto_repeat_rows_type_(ComputedStyle::InitialGridAutoRepeatType()) {} @@ -77,7 +77,6 @@ o.auto_repeat_ordered_named_grid_column_lines_), auto_repeat_ordered_named_grid_row_lines_( o.auto_repeat_ordered_named_grid_row_lines_), - grid_auto_flow_(o.grid_auto_flow_), grid_auto_rows_(o.grid_auto_rows_), grid_auto_columns_(o.grid_auto_columns_), named_grid_area_(o.named_grid_area_), @@ -90,6 +89,7 @@ auto_repeat_columns_insertion_point_( o.auto_repeat_columns_insertion_point_), auto_repeat_rows_insertion_point_(o.auto_repeat_rows_insertion_point_), + grid_auto_flow_(o.grid_auto_flow_), auto_repeat_columns_type_(o.auto_repeat_columns_type_), auto_repeat_rows_type_(o.auto_repeat_rows_type_) {}
diff --git a/third_party/WebKit/Source/core/style/StyleGridData.h b/third_party/WebKit/Source/core/style/StyleGridData.h index e84901e..15707ae 100644 --- a/third_party/WebKit/Source/core/style/StyleGridData.h +++ b/third_party/WebKit/Source/core/style/StyleGridData.h
@@ -99,8 +99,6 @@ OrderedNamedGridLines auto_repeat_ordered_named_grid_column_lines_; OrderedNamedGridLines auto_repeat_ordered_named_grid_row_lines_; - unsigned grid_auto_flow_ : kGridAutoFlowBits; - Vector<GridTrackSize> grid_auto_rows_; Vector<GridTrackSize> grid_auto_columns_; @@ -120,8 +118,9 @@ size_t auto_repeat_columns_insertion_point_; size_t auto_repeat_rows_insertion_point_; - AutoRepeatType auto_repeat_columns_type_; - AutoRepeatType auto_repeat_rows_type_; + unsigned grid_auto_flow_ : kGridAutoFlowBits; + unsigned auto_repeat_columns_type_ : 3; + unsigned auto_repeat_rows_type_ : 3; private: StyleGridData();
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.cpp b/third_party/WebKit/Source/core/testing/DummyModulator.cpp index 4cfd94f5..448d5a8e 100644 --- a/third_party/WebKit/Source/core/testing/DummyModulator.cpp +++ b/third_party/WebKit/Source/core/testing/DummyModulator.cpp
@@ -103,7 +103,8 @@ ScriptModule DummyModulator::CompileModule(const String& script, const String& url_str, AccessControlStatus, - const TextPosition&) { + const TextPosition&, + ExceptionState&) { NOTREACHED(); return ScriptModule(); }
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.h b/third_party/WebKit/Source/core/testing/DummyModulator.h index f9f4b6c..8b6ab8a 100644 --- a/third_party/WebKit/Source/core/testing/DummyModulator.h +++ b/third_party/WebKit/Source/core/testing/DummyModulator.h
@@ -55,7 +55,8 @@ ScriptModule CompileModule(const String& script, const String& url_str, AccessControlStatus, - const TextPosition&) override; + const TextPosition&, + ExceptionState&) override; ScriptValue InstantiateModule(ScriptModule) override; ScriptValue GetError(const ModuleScript*) override; Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override;
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index 1ed4058..11f8f91 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -76,7 +76,6 @@ #include "platform/network/ParsedContentType.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityPolicy.h" -#include "platform/weborigin/Suborigin.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/AutoReset.h" #include "platform/wtf/StdLibExtras.h" @@ -236,7 +235,7 @@ std::move(isolated_world_security_origin)), event_dispatch_recursion_level_(0), async_(true), - include_credentials_(false), + with_credentials_(false), parsed_response_(false), error_(false), upload_events_allowed_(true), @@ -560,7 +559,7 @@ return; } - include_credentials_ = value; + with_credentials_ = value; } void XMLHttpRequest::open(const AtomicString& method, @@ -971,11 +970,8 @@ // 'unsafe-credentials' option is set, and the request's physical origin is // the same as the URL's. bool include_credentials = - include_credentials_ || - (GetSecurityOrigin()->HasSuborigin() && - GetSecurityOrigin()->GetSuborigin()->PolicyContains( - Suborigin::SuboriginPolicyOptions::kUnsafeCredentials) && - SecurityOrigin::Create(url_)->IsSameSchemeHostPort(GetSecurityOrigin())); + GetSecurityOrigin()->HasSuboriginAndShouldAllowCredentialsFor(url_) || + with_credentials_; if (!same_origin_request_ && include_credentials) { UseCounter::Count(&execution_context, @@ -992,8 +988,8 @@ request.SetHTTPMethod(method_); request.SetRequestContext(WebURLRequest::kRequestContextXMLHttpRequest); request.SetFetchCredentialsMode( - include_credentials ? WebURLRequest::kFetchCredentialsModeInclude - : WebURLRequest::kFetchCredentialsModeSameOrigin); + with_credentials_ ? WebURLRequest::kFetchCredentialsModeInclude + : WebURLRequest::kFetchCredentialsModeSameOrigin); request.SetServiceWorkerMode(is_isolated_world_ ? WebURLRequest::ServiceWorkerMode::kNone : WebURLRequest::ServiceWorkerMode::kAll); @@ -1002,7 +998,7 @@ probe::willLoadXHR(&execution_context, this, this, method_, url_, async_, http_body ? http_body->DeepCopy() : nullptr, - request_headers_, include_credentials); + request_headers_, with_credentials_); if (http_body) { DCHECK_NE(method_, HTTPNames::GET); @@ -1028,8 +1024,8 @@ ? kAllowStoredCredentials : kDoNotAllowStoredCredentials; CredentialRequest credentials_requested = - include_credentials ? kClientRequestedCredentials - : kClientDidNotRequestCredentials; + with_credentials_ ? kClientRequestedCredentials + : kClientDidNotRequestCredentials; ResourceLoaderOptions resource_loader_options(allow_credentials, credentials_requested); resource_loader_options.security_origin = GetSecurityOrigin();
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h index a4157e85..b0734c1 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h
@@ -121,7 +121,7 @@ String statusText() const; int status() const; State readyState() const; - bool withCredentials() const { return include_credentials_; } + bool withCredentials() const { return with_credentials_; } void setWithCredentials(bool, ExceptionState&); void open(const AtomicString& method, const String& url, ExceptionState&); void open(const AtomicString& method, @@ -342,7 +342,9 @@ int event_dispatch_recursion_level_; bool async_; - bool include_credentials_; + + bool with_credentials_; + // Used to skip m_responseDocument creation if it's done previously. We need // this separate flag since m_responseDocument can be 0 for some cases. bool parsed_response_;
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn index 0153d68..5acadc5 100644 --- a/third_party/WebKit/Source/devtools/BUILD.gn +++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -175,6 +175,7 @@ "front_end/elements/ColorSwatchPopoverIcon.js", "front_end/elements/ComputedStyleModel.js", "front_end/elements/computedStyleSidebarPane.css", + "front_end/elements/computedStyleWidgetTree.css", "front_end/elements/ComputedStyleWidget.js", "front_end/elements/ElementsBreadcrumbs.js", "front_end/elements/elementsPanel.css",
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js index 233e9e3..97768571 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
@@ -56,8 +56,6 @@ this._workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); - this._debuggerWorkspaceBinding.addEventListener( - Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); targetManager.observeModels(SDK.DebuggerModel, this); } @@ -173,20 +171,6 @@ } /** - * @param {!Common.Event} event - */ - _uiSourceCodeMappingChanged(event) { - var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data.uiSourceCode); - var isIdentity = /** @type {boolean} */ (event.data.isIdentity); - var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data.debuggerModel); - if (isIdentity) - return; - var breakpoints = this._breakpointsForPrimaryUISourceCode.get(uiSourceCode) || []; - for (var i = 0; i < breakpoints.length; ++i) - breakpoints[i]._updateInDebuggerForModel(debuggerModel); - } - - /** * @param {!Workspace.UISourceCode} uiSourceCode */ _removeUISourceCode(uiSourceCode) {
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js index 5ca3e042e..c1f972b 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
@@ -243,7 +243,6 @@ return this._stylesSourceMapping.uiLocationToRawLocations(uiLocation); } - _dispose() { Common.EventTarget.removeEventListeners(this._eventListeners); this._stylesSourceMapping.dispose();
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js index 16bf022..612ab4a4 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
@@ -181,7 +181,7 @@ var script = /** @type {!SDK.Script} */ (event.data); // Create stub UISourceCode for the time source mapping is being loaded. this._addStubUISourceCode(script); - this._debuggerWorkspaceBinding.pushSourceMapping(script, this); + this._debuggerWorkspaceBinding.updateLocations(script); } /** @@ -220,12 +220,10 @@ var project = script.isContentScript() ? this._contentScriptsProject : this._regularProject; for (var sourceURL of sourceMap.sourceURLs()) { var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (project.uiSourceCodeForURL(sourceURL)); - if (hasOtherScripts) { + if (hasOtherScripts) Bindings.NetworkProject.removeFrameAttribution(uiSourceCode, frameId); - } else { - this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, null); + else project.removeFile(sourceURL); - } } this._debuggerWorkspaceBinding.updateLocations(script); } @@ -278,26 +276,17 @@ uiSourceCode[Bindings.CompilerScriptMapping._sourceMapSymbol] = sourceMap; Bindings.NetworkProject.setInitialFrameAttribution(uiSourceCode, frameId); project.addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata, mimeType); - this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); } this._debuggerWorkspaceBinding.updateLocations(script); } /** * @override - * @return {boolean} - */ - isIdentity() { - return false; - } - - /** - * @override * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ - uiLineHasMapping(uiSourceCode, lineNumber) { + static uiLineHasMapping(uiSourceCode, lineNumber) { var sourceMap = uiSourceCode[Bindings.CompilerScriptMapping._sourceMapSymbol]; if (!sourceMap) return true; @@ -313,4 +302,4 @@ }; Bindings.CompilerScriptMapping._frameIdSymbol = Symbol('Bindings.CompilerScriptMapping._frameIdSymbol'); -Bindings.CompilerScriptMapping._sourceMapSymbol = Symbol('Bindings.CompilerScriptMapping._sourceMapSymbol'); \ No newline at end of file +Bindings.CompilerScriptMapping._sourceMapSymbol = Symbol('Bindings.CompilerScriptMapping._sourceMapSymbol');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js b/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js index e6ff440..1cb9170 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js
@@ -197,85 +197,45 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInFileContent(uiSourceCode, query, caseSensitive, isRegex, callback) { + searchInFileContent(uiSourceCode, query, caseSensitive, isRegex) { var contentProvider = this._contentProviders[uiSourceCode.url()]; - contentProvider.searchInContent(query, caseSensitive, isRegex, callback); + return contentProvider.searchInContent(query, caseSensitive, isRegex); } /** * @override * @param {!Workspace.ProjectSearchConfig} searchConfig - * @param {!Array.<string>} filesMathingFileQuery + * @param {!Array<string>} filesMathingFileQuery * @param {!Common.Progress} progress - * @param {function(!Array.<string>)} callback + * @return {!Promise<!Array<string>>} */ - findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress, callback) { + async findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress) { var result = []; - var paths = filesMathingFileQuery; - var totalCount = paths.length; - if (totalCount === 0) { - // searchInContent should call back later. - setTimeout(doneCallback, 0); - return; - } - - var barrier = new CallbackBarrier(); - progress.setTotalWork(paths.length); - for (var i = 0; i < paths.length; ++i) - searchInContent.call(this, paths[i], barrier.createCallback(searchInContentCallback.bind(null, paths[i]))); - barrier.callWhenDone(doneCallback); + progress.setTotalWork(filesMathingFileQuery.length); + await Promise.all(filesMathingFileQuery.map(searchInContent.bind(this))); + progress.done(); + return result; /** * @param {string} path - * @param {function(boolean)} callback * @this {Bindings.ContentProviderBasedProject} */ - function searchInContent(path, callback) { - var queriesToRun = searchConfig.queries().slice(); - searchNextQuery.call(this); - - /** - * @this {Bindings.ContentProviderBasedProject} - */ - function searchNextQuery() { - if (!queriesToRun.length) { - callback(true); - return; - } - var query = queriesToRun.shift(); - this._contentProviders[path].searchInContent( - query, !searchConfig.ignoreCase(), searchConfig.isRegex(), contentCallback.bind(this)); - } - - /** - * @param {!Array.<!Common.ContentProvider.SearchMatch>} searchMatches - * @this {Bindings.ContentProviderBasedProject} - */ - function contentCallback(searchMatches) { + async function searchInContent(path) { + var provider = this._contentProviders[path]; + var allMatchesFound = true; + for (var query of searchConfig.queries().slice()) { + var searchMatches = await provider.searchInContent(query, !searchConfig.ignoreCase(), searchConfig.isRegex()); if (!searchMatches.length) { - callback(false); - return; + allMatchesFound = false; + break; } - searchNextQuery.call(this); } - } - - /** - * @param {string} path - * @param {boolean} matches - */ - function searchInContentCallback(path, matches) { - if (matches) + if (allMatchesFound) result.push(path); progress.worked(1); } - - function doneCallback() { - callback(result); - progress.done(); - } } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js index fa951dc..fd440e7 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
@@ -5,27 +5,34 @@ * @unrestricted * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} */ -Bindings.DebuggerWorkspaceBinding = class extends Common.Object { +Bindings.DebuggerWorkspaceBinding = class { /** * @param {!SDK.TargetManager} targetManager * @param {!Workspace.Workspace} workspace */ constructor(targetManager, workspace) { - super(); this._workspace = workspace; + /** @type {!Array<!Bindings.DebuggerSourceMapping>} */ + this._sourceMappings = []; + /** @type {!Map.<!SDK.DebuggerModel, !Bindings.DebuggerWorkspaceBinding.ModelData>} */ this._debuggerModelToData = new Map(); targetManager.addModelListener( SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, this); targetManager.addModelListener( SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); - workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._onUISourceCodeRemoved, this); - workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); targetManager.observeModels(SDK.DebuggerModel, this); } /** + * @param {!Bindings.DebuggerSourceMapping} sourceMapping + */ + addSourceMapping(sourceMapping) { + this._sourceMappings.push(sourceMapping); + } + + /** * @override * @param {!SDK.DebuggerModel} debuggerModel */ @@ -44,64 +51,6 @@ } /** - * @param {!Common.Event} event - */ - _onUISourceCodeRemoved(event) { - var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); - this._uiSourceCodeRemoved(uiSourceCode); - } - - /** - * @param {!Common.Event} event - */ - _projectRemoved(event) { - var project = /** @type {!Workspace.Project} */ (event.data); - var uiSourceCodes = project.uiSourceCodes(); - for (var uiSourceCode of uiSourceCodes) - this._uiSourceCodeRemoved(uiSourceCode); - } - - /** - * @param {!SDK.Script} script - * @param {!Bindings.DebuggerSourceMapping} sourceMapping - */ - pushSourceMapping(script, sourceMapping) { - var info = this._ensureInfoForScript(script); - info._pushSourceMapping(sourceMapping); - } - - /** - * @param {!SDK.Script} script - * @return {!Bindings.DebuggerSourceMapping} - */ - popSourceMapping(script) { - var info = this._infoForScript(script); - console.assert(info); - return info._popSourceMapping(); - } - - /** - * @param {!SDK.DebuggerModel} debuggerModel - * @param {!Workspace.UISourceCode} uiSourceCode - * @param {?Bindings.DebuggerSourceMapping} sourceMapping - */ - setSourceMapping(debuggerModel, uiSourceCode, sourceMapping) { - if (uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol] === sourceMapping) - return; - - if (sourceMapping) - uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol] = sourceMapping; - else - delete uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol]; - - this.dispatchEventToListeners(Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, { - uiSourceCode: uiSourceCode, - debuggerModel: debuggerModel, - isIdentity: sourceMapping ? sourceMapping.isIdentity() : false - }); - } - - /** * @param {!SDK.Script} script */ updateLocations(script) { @@ -117,8 +66,9 @@ * @return {!Bindings.DebuggerWorkspaceBinding.Location} */ createLiveLocation(rawLocation, updateDelegate, locationPool) { - var info = this._infoForScript(rawLocation.script()); - console.assert(info); + var script = /** @type {!SDK.Script} */ (rawLocation.script()); + console.assert(script); + var info = this._ensureInfoForScript(script); var location = new Bindings.DebuggerWorkspaceBinding.Location(info._script, rawLocation, this, updateDelegate, locationPool); info._addLocation(location); @@ -161,9 +111,13 @@ * @return {!Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { - var info = this._infoForScript(rawLocation.script()); - console.assert(info); - return info._rawLocationToUILocation(rawLocation); + for (var i = 0; i < this._sourceMappings.length; ++i) { + var uiLocation = this._sourceMappings[i].rawLocationToUILocation(rawLocation); + if (uiLocation) + return uiLocation; + } + var modelData = this._debuggerModelToData.get(rawLocation.debuggerModel); + return modelData._rawLocationToUILocation(rawLocation); } /** @@ -185,8 +139,18 @@ * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { - var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol]; - return sourceMapping && sourceMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + for (var i = 0; i < this._sourceMappings.length; ++i) { + var rawLocation = this._sourceMappings[i].uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + if (rawLocation) + return rawLocation; + } + + for (var modelData of this._debuggerModelToData.values()) { + var rawLocation = modelData._uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + if (rawLocation) + return rawLocation; + } + return null; } /** @@ -203,23 +167,6 @@ /** * @param {!Workspace.UISourceCode} uiSourceCode - * @param {number} lineNumber - * @return {boolean} - */ - uiLineHasMapping(uiSourceCode, lineNumber) { - var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol]; - return sourceMapping ? sourceMapping.uiLineHasMapping(uiSourceCode, lineNumber) : true; - } - - /** - * @param {!Workspace.UISourceCode} uiSourceCode - */ - _uiSourceCodeRemoved(uiSourceCode) { - delete uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol]; - } - - /** - * @param {!Workspace.UISourceCode} uiSourceCode * @param {!SDK.DebuggerModel} debuggerModel * @return {?Bindings.ResourceScriptFile} */ @@ -317,7 +264,6 @@ }; Bindings.DebuggerWorkspaceBinding._scriptInfoSymbol = Symbol('scriptDataMap'); -Bindings.DebuggerWorkspaceBinding._sourceMappingSymbol = Symbol('sourceMapping'); /** * @unrestricted @@ -351,6 +297,34 @@ } /** + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {!Workspace.UILocation} + */ + _rawLocationToUILocation(rawLocation) { + var uiLocation = null; + uiLocation = uiLocation || this._compilerMapping.rawLocationToUILocation(rawLocation); + uiLocation = uiLocation || this._resourceMapping.rawLocationToUILocation(rawLocation); + uiLocation = uiLocation || this._defaultMapping.rawLocationToUILocation(rawLocation); + // DefaultMapping ensures uiLocation for every rawLocation. + console.assert(uiLocation); + return /** @type {!Workspace.UILocation} */ (uiLocation); + } + + /** + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {number} lineNumber + * @param {number} columnNumber + * @return {?SDK.DebuggerModel.Location} + */ + _uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { + var rawLocation = null; + rawLocation = rawLocation || this._compilerMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + rawLocation = rawLocation || this._resourceMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + rawLocation = rawLocation || this._defaultMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + return rawLocation; + } + + /** * @param {!SDK.DebuggerPausedDetails} debuggerPausedDetails * @return {boolean} */ @@ -384,12 +358,6 @@ } }; -/** @enum {symbol} */ -Bindings.DebuggerWorkspaceBinding.Events = { - SourceMappingChanged: Symbol('SourceMappingChanged'), -}; - - /** * @unrestricted */ @@ -403,31 +371,6 @@ } /** - * @param {!Bindings.DebuggerSourceMapping} sourceMapping - */ - _pushSourceMapping(sourceMapping) { - if (this._sourceMapping) { - if (!this._backupMappings) { - /** @type {!Array.<!Bindings.DebuggerSourceMapping>} */ - this._backupMappings = []; - } - this._backupMappings.push(this._sourceMapping); - } - this._sourceMapping = sourceMapping; - this._updateLocations(); - } - - /** - * @return {!Bindings.DebuggerSourceMapping} - */ - _popSourceMapping() { - var sourceMapping = this._sourceMapping; - this._sourceMapping = this._backupMappings ? this._backupMappings.pop() : undefined; - this._updateLocations(); - return sourceMapping; - } - - /** * @param {!Bindings.LiveLocation} location */ _addLocation(location) { @@ -454,20 +397,6 @@ for (var location of this._locations) location.update(); } - - /** - * @param {!SDK.DebuggerModel.Location} rawLocation - * @return {!Workspace.UILocation} - */ - _rawLocationToUILocation(rawLocation) { - var uiLocation = this._sourceMapping ? this._sourceMapping.rawLocationToUILocation(rawLocation) : null; - if (!uiLocation && this._backupMappings) { - for (var i = this._backupMappings.length - 1; !uiLocation && i >= 0; --i) - uiLocation = this._backupMappings[i].rawLocationToUILocation(rawLocation); - } - console.assert(uiLocation, 'Script raw location cannot be mapped to any UI location.'); - return /** @type {!Workspace.UILocation} */ (uiLocation); - } }; /** @@ -599,18 +528,6 @@ * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) {}, - - /** - * @return {boolean} - */ - isIdentity() {}, - - /** - * @param {!Workspace.UISourceCode} uiSourceCode - * @param {number} lineNumber - * @return {boolean} - */ - uiLineHasMapping(uiSourceCode, lineNumber) {} }; /**
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js index c98dce7f..985de7d 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js
@@ -88,6 +88,8 @@ */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var script = uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol]; + if (!script) + return null; if (script.isInlineScriptWithSourceURL()) { return this._debuggerModel.createRawLocation( script, lineNumber + script.lineOffset, lineNumber ? columnNumber : columnNumber + script.columnOffset); @@ -106,9 +108,7 @@ uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol] = script; script[Bindings.DefaultScriptMapping._uiSourceCodeSymbol] = uiSourceCode; this._project.addUISourceCodeWithProvider(uiSourceCode, script, null, 'text/javascript'); - - this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); - this._debuggerWorkspaceBinding.pushSourceMapping(script, this); + this._debuggerWorkspaceBinding.updateLocations(script); } /** @@ -123,24 +123,6 @@ this._project.removeUISourceCode(uiSourceCode.url()); } - /** - * @override - * @return {boolean} - */ - isIdentity() { - return true; - } - - /** - * @override - * @param {!Workspace.UISourceCode} uiSourceCode - * @param {number} lineNumber - * @return {boolean} - */ - uiLineHasMapping(uiSourceCode, lineNumber) { - return true; - } - _debuggerReset() { this._project.reset(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js index fead041..4997760 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -87,7 +87,8 @@ */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var scripts = this._scriptsForUISourceCode(uiSourceCode); - console.assert(scripts.length); + if (!scripts.length) + return null; var script = scripts[scripts.length - 1]; if (script.isInlineScriptWithSourceURL()) { return this._debuggerModel.createRawLocationByURL( @@ -103,7 +104,6 @@ addScript(script) { if (script.isAnonymousScript()) return; - this._debuggerWorkspaceBinding.pushSourceMapping(script, this); var uiSourceCode = this._workspaceUISourceCodeForScript(script); if (!uiSourceCode) @@ -113,24 +113,6 @@ } /** - * @override - * @return {boolean} - */ - isIdentity() { - return true; - } - - /** - * @override - * @param {!Workspace.UISourceCode} uiSourceCode - * @param {number} lineNumber - * @return {boolean} - */ - uiLineHasMapping(uiSourceCode, lineNumber) { - return true; - } - - /** * @param {!Workspace.UISourceCode} uiSourceCode * @return {?Bindings.ResourceScriptFile} */ @@ -222,7 +204,6 @@ this._setScriptFile(uiSourceCode, scriptFile); for (var i = 0; i < scripts.length; ++i) this._debuggerWorkspaceBinding.updateLocations(scripts[i]); - this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); this._boundUISourceCodes.add(uiSourceCode); } @@ -235,8 +216,9 @@ scriptFile.dispose(); this._setScriptFile(uiSourceCode, null); } - this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, null); this._boundUISourceCodes.delete(uiSourceCode); + if (scriptFile._script) + this._debuggerWorkspaceBinding.updateLocations(scriptFile._script); } _debuggerReset() {
diff --git a/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js b/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js index 8670091..d56ad2c4 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js +++ b/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js
@@ -52,9 +52,9 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) {} + searchInContent(query, caseSensitive, isRegex) {} }; /**
diff --git a/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js b/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js index 6111e3b..337c3be 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js +++ b/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js
@@ -57,20 +57,10 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - /** - * @param {?string} content - */ - function performSearch(content) { - if (!content) { - callback(/** @type {!Array<!Common.ContentProvider.SearchMatch>} */ ([])); - return; - } - callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); - } - - this._lazyContent().then(performSearch); + async searchInContent(query, caseSensitive, isRegex) { + var content = await this._lazyContent(); + return content ? Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex) : []; } };
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js index 49c2cea..74a8a514 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -669,10 +669,8 @@ * @param {!Event} event */ _messagesClicked(event) { - var targetElement = event.deepElementFromPoint(); - // Do not focus prompt if messages have selection. - if (!targetElement || targetElement.isComponentSelectionCollapsed()) { + if (!this._messagesElement.hasSelection()) { var clickedOutsideMessageList = event.target === this._messagesElement; if (clickedOutsideMessageList) this._prompt.moveCaretToEndOfPrompt();
diff --git a/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js b/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js index 8f6733c..235438c 100644 --- a/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js +++ b/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js
@@ -266,16 +266,6 @@ /** * @return {boolean} */ -Node.prototype.isComponentSelectionCollapsed = function() { - // FIXME: crbug.com/447523, use selection.isCollapsed when it is fixed for shadow dom. - var selection = this.getComponentSelection(); - var range = selection && selection.rangeCount ? selection.getRangeAt(0) : null; - return range ? range.collapsed : true; -}; - -/** - * @return {boolean} - */ Node.prototype.hasSelection = function() { // TODO(luoe): use contains(node, {includeShadow: true}) when it is fixed for shadow dom. var contents = this.querySelectorAll('content'); @@ -283,23 +273,12 @@ if (Array.prototype.some.call(content.getDistributedNodes(), node => node.hasSelection())) return true; } - if (this.isComponentSelectionCollapsed()) + + var selection = this.getComponentSelection(); + if (selection.type !== 'Range') return false; - return this.getComponentSelection().containsNode(this, true); -}; - -/** - * @return {!Selection} - */ -Node.prototype.getDeepSelection = function() { - var activeElement = this.ownerDocument.activeElement; - var shadowRoot = null; - while (activeElement && activeElement.shadowRoot) { - shadowRoot = activeElement.shadowRoot; - activeElement = shadowRoot.activeElement; - } - - return shadowRoot ? shadowRoot.getSelection() : this.window().getSelection(); + return selection.containsNode(this, true) || selection.anchorNode.isSelfOrDescendant(this) || + selection.focusNode.isSelfOrDescendant(this); }; /**
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js index 40056c8a..9bde158 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js
@@ -32,9 +32,7 @@ */ Elements.ComputedStyleWidget = class extends UI.ThrottledWidget { constructor() { - super(); - this.element.classList.add('computed-style-sidebar-pane'); - + super(true); this.registerRequiredCSS('elements/computedStyleSidebarPane.css'); this._alwaysShowComputedProperties = {'display': true, 'height': true, 'width': true}; @@ -47,10 +45,10 @@ this._showInheritedComputedStylePropertiesSetting.addChangeListener( this._showInheritedComputedStyleChanged.bind(this)); - var hbox = this.element.createChild('div', 'hbox styles-sidebar-pane-toolbar'); + var hbox = this.contentElement.createChild('div', 'hbox styles-sidebar-pane-toolbar'); var filterContainerElement = hbox.createChild('div', 'styles-sidebar-pane-filter-box'); var filterInput = Elements.StylesSidebarPane.createPropertyFilterElement( - Common.UIString('Filter'), hbox, filterCallback.bind(this)); + Common.UIString('Filter'), hbox, filterCallback.bind(this), 'styles-filter-engaged'); UI.ARIAUtils.setAccessibleName(filterInput, Common.UIString('Filter Computed Styles')); filterContainerElement.appendChild(filterInput); @@ -60,9 +58,9 @@ this._propertiesOutline = new UI.TreeOutlineInShadow(); this._propertiesOutline.hideOverflow(); - this._propertiesOutline.registerRequiredCSS('elements/computedStyleSidebarPane.css'); + this._propertiesOutline.registerRequiredCSS('elements/computedStyleWidgetTree.css'); this._propertiesOutline.element.classList.add('monospace', 'computed-properties'); - this.element.appendChild(this._propertiesOutline.element); + this.contentElement.appendChild(this._propertiesOutline.element); this._linkifier = new Components.Linkifier(Elements.ComputedStyleWidget._maxLinkLength); @@ -76,7 +74,7 @@ } var fontsWidget = new Elements.PlatformFontsWidget(this._computedStyleModel); - fontsWidget.show(this.element); + fontsWidget.show(this.contentElement); } _showInheritedComputedStyleChanged() {
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js index fe79eb0..4b34527 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -27,6 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + /** * @implements {UI.Searchable} * @implements {SDK.SDKModelObserver<!SDK.DOMModel>} @@ -415,12 +416,9 @@ this._searchConfig = searchConfig; - var promises = []; + var showUAShadowDOM = Common.moduleSetting('showUAShadowDOM').get(); var domModels = SDK.targetManager.models(SDK.DOMModel); - for (var domModel of domModels) { - promises.push( - domModel.performSearchPromise(whitespaceTrimmedQuery, Common.moduleSetting('showUAShadowDOM').get())); - } + var promises = domModels.map(domModel => domModel.performSearch(whitespaceTrimmedQuery, showUAShadowDOM)); Promise.all(promises).then(resultCountCallback.bind(this)); /**
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js index decdc8a..67ec7d9 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js
@@ -192,7 +192,7 @@ var originalEvent = event['original']; // Don't prevent the normal copy if the user has a selection. - if (!originalEvent.target.isComponentSelectionCollapsed()) + if (originalEvent.target.hasSelection()) return; // Do not interfere with text editing. @@ -631,7 +631,7 @@ } _ondragstart(event) { - if (!event.target.isComponentSelectionCollapsed()) + if (event.target.hasSelection()) return false; if (event.target.nodeName === 'A') return false;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js index 85b15020..862c142 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -127,16 +127,17 @@ * @param {string} placeholder * @param {!Element} container * @param {function(?RegExp)} filterCallback + * @param {string} activeClassName * @return {!Element} */ - static createPropertyFilterElement(placeholder, container, filterCallback) { + static createPropertyFilterElement(placeholder, container, filterCallback, activeClassName) { var input = createElementWithClass('input'); input.placeholder = placeholder; function searchHandler() { var regex = input.value ? new RegExp(input.value.escapeForRegExp(), 'i') : null; filterCallback(regex); - container.classList.toggle('styles-filter-engaged', !!input.value); + container.classList.toggle(activeClassName, !!input.value); } input.addEventListener('input', searchHandler, false); @@ -531,7 +532,7 @@ var hbox = container.createChild('div', 'hbox styles-sidebar-pane-toolbar'); var filterContainerElement = hbox.createChild('div', 'styles-sidebar-pane-filter-box'); var filterInput = Elements.StylesSidebarPane.createPropertyFilterElement( - Common.UIString('Filter'), hbox, this._onFilterChanged.bind(this)); + Common.UIString('Filter'), hbox, this._onFilterChanged.bind(this), 'styles-filter-engaged'); UI.ARIAUtils.setAccessibleName(filterInput, Common.UIString('Filter Styles')); filterContainerElement.appendChild(filterInput); var toolbar = new UI.Toolbar('styles-pane-toolbar', hbox); @@ -1357,21 +1358,7 @@ * @param {!Event} event */ _handleEmptySpaceClick(event) { - if (!this.editable) - return; - - var targetElement = event.deepElementFromPoint(); - if (targetElement && !targetElement.isComponentSelectionCollapsed()) - return; - - if (!event.target.isComponentSelectionCollapsed()) - return; - - if (this.propertiesTreeOutline.element.shadowRoot.firstChild && - !this.propertiesTreeOutline.element.shadowRoot.firstChild.isComponentSelectionCollapsed()) - return; - - if (this._checkWillCancelEditing()) + if (!this.editable || this.element.hasSelection() || this._checkWillCancelEditing()) return; if (event.target.classList.contains('header') || this.element.classList.contains('read-only') || @@ -1682,7 +1669,7 @@ * @return {!Promise} */ _manuallySetHeight() { - this.element.style.height = this._innerElement.clientHeight + 'px'; + this.element.style.height = (this._innerElement.clientHeight + 1) + 'px'; this.element.style.contain = 'strict'; return Promise.resolve(); } @@ -2337,7 +2324,7 @@ * @param {!Event} event */ _mouseClick(event) { - if (!event.target.isComponentSelectionCollapsed()) + if (event.target.hasSelection()) return; event.consume(true);
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/computedStyleSidebarPane.css b/third_party/WebKit/Source/devtools/front_end/elements/computedStyleSidebarPane.css index a04c7aa..d6055ad 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/computedStyleSidebarPane.css +++ b/third_party/WebKit/Source/devtools/front_end/elements/computedStyleSidebarPane.css
@@ -9,112 +9,28 @@ flex-shrink: 0; } -.computed-style-property { - display: flex; - overflow: hidden; - flex: auto; -} - -.computed-style-property .property-name { - min-width: 5em; - text-overflow: ellipsis; - overflow: hidden; - flex-shrink: 1; - flex-basis: 16em; - flex-grow: 1; -} - -.computed-style-property .property-value { - margin-left: 2em; - position: relative; - display: flex; +.styles-sidebar-pane-toolbar { + border-bottom: 1px solid #eee; flex-shrink: 0; - flex-basis: 5em; - flex-grow: 10; } -.computed-style-property .property-value-text { - overflow: hidden; - text-overflow: ellipsis; +.styles-sidebar-pane-filter-box { + flex: auto; + display: flex; } -.tree-outline li:hover .goto-source-icon { - display: block; - margin-top: -2px; -} - -.goto-source-icon { - background-color: #5a5a5a; - display: none; - position: absolute; - left: -16px; -} - -.goto-source-icon:hover { - background-color: #333; -} - -.computed-style-property-inherited { - opacity: 0.5; -} - -.trace-link { - user-select: none; - float: right; - padding-left: 1em; - position: relative; - z-index: 1; -} - -.property-trace { - text-overflow: ellipsis; - overflow: hidden; - flex-grow: 1; -} - -.property-trace-selector { - color: gray; - padding-left: 2em; -} - -.property-trace-value { - position: relative; - display: inline-block; - margin-left: 2em; -} - -.property-trace-inactive .property-trace-value::before { - position: absolute; - content: "."; - border-bottom: 1px solid rgba(0, 0, 0, 0.35); - top: 0; - bottom: 5px; - left: 0; - right: 0; -} - -.tree-outline li.odd-row { - position: relative; - background-color: #F5F5F5; -} - -.tree-outline, .tree-outline ol { - padding-left: 0; -} - -.tree-outline li:hover { - background-color: rgb(235, 242, 252); - cursor: pointer; -} - -.tree-outline li::before { +.styles-sidebar-pane-filter-box > input { + outline: none !important; + border: none; + width: 100%; + background: transparent; margin-left: 4px; } -.delimeter { - color: transparent; +.styles-filter-engaged { + background-color: rgba(255, 255, 0, 0.5); } -.delimeter::selection { - color: transparent; +:host-context(.-theme-with-dark-background) .styles-filter-engaged { + background-color: hsla(133, 100%, 30%, 0.5); }
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/computedStyleWidgetTree.css b/third_party/WebKit/Source/devtools/front_end/elements/computedStyleWidgetTree.css new file mode 100644 index 0000000..f33a4aec0 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/elements/computedStyleWidgetTree.css
@@ -0,0 +1,115 @@ +/* + * Copyright (c) 2017 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +.computed-style-property { + display: flex; + overflow: hidden; + flex: auto; +} + +.computed-style-property .property-name { + min-width: 5em; + text-overflow: ellipsis; + overflow: hidden; + flex-shrink: 1; + flex-basis: 16em; + flex-grow: 1; +} + +.computed-style-property .property-value { + margin-left: 2em; + position: relative; + display: flex; + flex-shrink: 0; + flex-basis: 5em; + flex-grow: 10; +} + +.computed-style-property .property-value-text { + overflow: hidden; + text-overflow: ellipsis; +} + +.tree-outline li:hover .goto-source-icon { + display: block; + margin-top: -2px; +} + +.goto-source-icon { + background-color: #5a5a5a; + display: none; + position: absolute; + left: -16px; +} + +.goto-source-icon:hover { + background-color: #333; +} + +.computed-style-property-inherited { + opacity: 0.5; +} + +.trace-link { + user-select: none; + float: right; + padding-left: 1em; + position: relative; + z-index: 1; +} + +.property-trace { + text-overflow: ellipsis; + overflow: hidden; + flex-grow: 1; +} + +.property-trace-selector { + color: gray; + padding-left: 2em; +} + +.property-trace-value { + position: relative; + display: inline-block; + margin-left: 2em; +} + +.property-trace-inactive .property-trace-value::before { + position: absolute; + content: "."; + border-bottom: 1px solid rgba(0, 0, 0, 0.35); + top: 0; + bottom: 5px; + left: 0; + right: 0; +} + +.tree-outline li.odd-row { + position: relative; + background-color: #F5F5F5; +} + +.tree-outline, .tree-outline ol { + padding-left: 0; +} + +.tree-outline li:hover { + background-color: rgb(235, 242, 252); + cursor: pointer; +} + +.tree-outline li::before { + margin-left: 4px; +} + +.delimeter { + color: transparent; +} + +.delimeter::selection { + color: transparent; +}
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/module.json b/third_party/WebKit/Source/devtools/front_end/elements/module.json index e3f73299..5e1d48f 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/module.json +++ b/third_party/WebKit/Source/devtools/front_end/elements/module.json
@@ -273,6 +273,7 @@ "breadcrumbs.css", "classesPaneWidget.css", "computedStyleSidebarPane.css", + "computedStyleWidgetTree.css", "elementsPanel.css", "elementStatePaneWidget.css", "elementsTreeOutline.css",
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js index b881e357..5b8008b 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js
@@ -132,9 +132,9 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - this._request.searchInContent(query, caseSensitive, isRegex, callback); + searchInContent(query, caseSensitive, isRegex) { + return this._request.searchInContent(query, caseSensitive, isRegex); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js index 90c9904..7647bc2 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js
@@ -399,21 +399,20 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInFileContent(uiSourceCode, query, caseSensitive, isRegex, callback) { - var filePath = this._filePathForUISourceCode(uiSourceCode); - this._fileSystem.requestFileContent(filePath, contentCallback); + searchInFileContent(uiSourceCode, query, caseSensitive, isRegex) { + return new Promise(resolve => { + var filePath = this._filePathForUISourceCode(uiSourceCode); + this._fileSystem.requestFileContent(filePath, contentCallback); - /** - * @param {?string} content - */ - function contentCallback(content) { - var result = []; - if (content !== null) - result = Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex); - callback(result); - } + /** + * @param {?string} content + */ + function contentCallback(content) { + resolve(content ? Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex) : []); + } + }); } /** @@ -421,39 +420,23 @@ * @param {!Workspace.ProjectSearchConfig} searchConfig * @param {!Array.<string>} filesMathingFileQuery * @param {!Common.Progress} progress - * @param {function(!Array.<string>)} callback + * @return {!Promise<!Array<string>>} */ - findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress, callback) { + async findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress) { var result = filesMathingFileQuery; var queriesToRun = searchConfig.queries().slice(); if (!queriesToRun.length) queriesToRun.push(''); progress.setTotalWork(queriesToRun.length); - searchNextQuery.call(this); - /** - * @this {Persistence.FileSystemWorkspaceBinding.FileSystem} - */ - function searchNextQuery() { - if (!queriesToRun.length) { - progress.done(); - callback(result); - return; - } - var query = queriesToRun.shift(); - this._fileSystem.searchInPath(searchConfig.isRegex() ? '' : query, progress, innerCallback.bind(this)); - } - - /** - * @param {!Array.<string>} files - * @this {Persistence.FileSystemWorkspaceBinding.FileSystem} - */ - function innerCallback(files) { - files = files.sort(); + for (var query of queriesToRun) { + var files = await this._fileSystem.searchInPath(searchConfig.isRegex() ? '' : query, progress); + result = result.intersectOrdered(files.sort(), String.naturalOrderComparator); progress.worked(1); - result = result.intersectOrdered(files, String.naturalOrderComparator); - searchNextQuery.call(this); } + + progress.done(); + return result; } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/IsolatedFileSystem.js b/third_party/WebKit/Source/devtools/front_end/persistence/IsolatedFileSystem.js index 78ee358c..ae76a86 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/IsolatedFileSystem.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/IsolatedFileSystem.js
@@ -546,20 +546,21 @@ /** * @param {string} query * @param {!Common.Progress} progress - * @param {function(!Array.<string>)} callback + * @return {!Promise<!Array<string>>} */ - searchInPath(query, progress, callback) { - var requestId = this._manager.registerCallback(innerCallback); - InspectorFrontendHost.searchInPath(requestId, this._embedderPath, query); + searchInPath(query, progress) { + return new Promise(resolve => { + var requestId = this._manager.registerCallback(innerCallback); + InspectorFrontendHost.searchInPath(requestId, this._embedderPath, query); - /** - * @param {!Array.<string>} files - */ - function innerCallback(files) { - files = files.map(embedderPath => Common.ParsedURL.platformPathToURL(embedderPath)); - progress.worked(1); - callback(files); - } + /** + * @param {!Array<string>} files + */ + function innerCallback(files) { + resolve(files.map(path => Common.ParsedURL.platformPathToURL(path))); + progress.worked(1); + } + }); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/platform/utilities.js b/third_party/WebKit/Source/devtools/front_end/platform/utilities.js index baffe72..87159e46 100644 --- a/third_party/WebKit/Source/devtools/front_end/platform/utilities.js +++ b/third_party/WebKit/Source/devtools/front_end/platform/utilities.js
@@ -1292,64 +1292,6 @@ } /** - * @unrestricted - */ -var CallbackBarrier = class { - constructor() { - this._pendingIncomingCallbacksCount = 0; - } - - /** - * @param {function(...)=} userCallback - * @return {function(...)} - */ - createCallback(userCallback) { - console.assert( - !this._outgoingCallback, 'CallbackBarrier.createCallback() is called after CallbackBarrier.callWhenDone()'); - ++this._pendingIncomingCallbacksCount; - return this._incomingCallback.bind(this, userCallback); - } - - /** - * @param {function()} callback - */ - callWhenDone(callback) { - console.assert(!this._outgoingCallback, 'CallbackBarrier.callWhenDone() is called multiple times'); - this._outgoingCallback = callback; - if (!this._pendingIncomingCallbacksCount) - this._outgoingCallback(); - } - - /** - * @return {!Promise.<undefined>} - */ - donePromise() { - return new Promise(promiseConstructor.bind(this)); - - /** - * @param {function()} success - * @this {CallbackBarrier} - */ - function promiseConstructor(success) { - this.callWhenDone(success); - } - } - - /** - * @param {function(...)=} userCallback - */ - _incomingCallback(userCallback) { - console.assert(this._pendingIncomingCallbacksCount > 0); - if (userCallback) { - var args = Array.prototype.slice.call(arguments, 1); - userCallback.apply(null, args); - } - if (!--this._pendingIncomingCallbacksCount && this._outgoingCallback) - this._outgoingCallback(); - } -}; - -/** * @param {*} value */ function suppressUnused(value) {
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js index 40ff3b2..4dbb9d46 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js
@@ -49,7 +49,7 @@ } _messagesClicked() { - if (!this._prompt.isCaretInsidePrompt() && this.element.isComponentSelectionCollapsed()) + if (!this._prompt.isCaretInsidePrompt() && !this.element.hasSelection()) this._prompt.moveCaretToEndOfPrompt(); } @@ -104,7 +104,7 @@ */ function moveBackIfOutside() { delete this._selectionTimeout; - if (!this._prompt.isCaretInsidePrompt() && this.element.isComponentSelectionCollapsed()) + if (!this._prompt.isCaretInsidePrompt() && !this.element.hasSelection()) this._prompt.moveCaretToEndOfPrompt(); this._prompt.autoCompleteSoon(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js index 326de94..fc2d4a43 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
@@ -128,15 +128,11 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - function performSearch(content) { - callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); - } - - // searchInContent should call back later. - this.requestContent().then(performSearch); + async searchInContent(query, caseSensitive, isRegex) { + var content = await this.requestContent(); + return Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js b/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js index c6d0b0c..d18b0f9 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js
@@ -91,21 +91,12 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - this.requestContent().then(contentLoaded); - - /** - * @param {?string} content - */ - function contentLoaded(content) { - if (typeof content !== 'string') { - callback([]); - return; - } - - callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); - } + async searchInContent(query, caseSensitive, isRegex) { + var content = await this.requestContent(); + if (typeof content !== 'string') + return []; + return Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js index 7f2675a..0563c63e 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
@@ -1438,19 +1438,9 @@ /** * @param {string} query * @param {boolean} includeUserAgentShadowDOM - * @param {function(number)} searchCallback - */ - performSearch(query, includeUserAgentShadowDOM, searchCallback) { - SDK.DOMModel.cancelSearch(); - this.performSearchPromise(query, includeUserAgentShadowDOM).then(searchCallback); - } - - /** - * @param {string} query - * @param {boolean} includeUserAgentShadowDOM * @return {!Promise<number>} */ - async performSearchPromise(query, includeUserAgentShadowDOM) { + async performSearch(query, includeUserAgentShadowDOM) { var response = await this._agent.invoke_performSearch({query, includeUserAgentShadowDOM}); if (!response[Protocol.Error]) this._searchId = response.searchId;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js index 12c4ad84..b6c8a31 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
@@ -927,10 +927,10 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - callback([]); + searchInContent(query, caseSensitive, isRegex) { + return Promise.resolve([]); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js b/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js index 626ae2e..e554026 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js
@@ -212,17 +212,14 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - if (!this.frameId) { - callback([]); - return; - } - this._resourceTreeModel.target() - .pageAgent() - .searchInResource(this.frameId, this.url, query, caseSensitive, isRegex) - .then(result => callback(result || [])); + async searchInContent(query, caseSensitive, isRegex) { + if (!this.frameId) + return []; + var result = await this._resourceTreeModel.target().pageAgent().searchInResource( + this.frameId, this.url, query, caseSensitive, isRegex); + return result || []; } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js index 310b982..1077ccd1 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
@@ -156,23 +156,15 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Protocol.Debugger.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - if (!this.scriptId) { - callback([]); - return; - } + async searchInContent(query, caseSensitive, isRegex) { + if (!this.scriptId) + return []; - // Script failed to parse. - this.debuggerModel.target() - .debuggerAgent() - .searchInContent(this.scriptId, query, caseSensitive, isRegex) - .then(matches => { - var searchMatches = - (matches || []).map(match => new Common.ContentProvider.SearchMatch(match.lineNumber, match.lineContent)); - callback(searchMatches); - }); + var matches = + await this.debuggerModel.target().debuggerAgent().searchInContent(this.scriptId, query, caseSensitive, isRegex); + return (matches || []).map(match => new Common.ContentProvider.SearchMatch(match.lineNumber, match.lineContent)); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js index 86a7a58..cc8ee55f 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -407,8 +407,7 @@ parentTarget.registerTargetDispatcher(this); this._targetAgent.invoke_setAutoAttach({autoAttach: true, waitForDebuggerOnStart: true}); - var type = parentTarget[SDK.TargetManager._targetType]; - if ((type === 'page' || type === 'iframe') && Runtime.experiments.isEnabled('autoAttachToCrossProcessSubframes')) + if (Runtime.experiments.isEnabled('autoAttachToCrossProcessSubframes')) this._targetAgent.setAttachToFrames(true); if (!parentTarget.parentTarget()) @@ -523,7 +522,7 @@ var target = this._targetManager.createTarget( targetInfo.targetId, targetName, this._capabilitiesForType(targetInfo.type), this._createChildConnection.bind(this, this._targetAgent, targetInfo.targetId), this._parentTarget); - target[SDK.TargetManager._targetType] = targetInfo.type; + target[SDK.TargetManager._isWorkerSymbol] = targetInfo.type === 'worker'; // Only pause the new worker if debugging SW - we are going through the pause on start checkbox. if (!this._parentTarget.parentTarget() && Runtime.queryParam('isSharedWorker') && waitingForDebugger) { @@ -611,7 +610,7 @@ AvailableNodeTargetsChanged: Symbol('AvailableNodeTargetsChanged') }; -SDK.TargetManager._targetType = Symbol('SDK.TargetManager.TargetType'); +SDK.TargetManager._isWorkerSymbol = Symbol('SDK.TargetManager.IsWorker'); /** * @interface
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js index 585fb326..a6ed70a 100644 --- a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js +++ b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
@@ -30,6 +30,7 @@ /** * @unrestricted * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} + * @implements {Bindings.DebuggerSourceMapping} */ Snippets.ScriptSnippetModel = class extends Common.Object { /** @@ -50,6 +51,7 @@ this._project = new Snippets.SnippetsProject(workspace, this); this._loadSnippets(); SDK.targetManager.observeModels(SDK.DebuggerModel, this); + Bindings.debuggerWorkspaceBinding.addSourceMapping(this); } /** @@ -69,6 +71,34 @@ } /** + * @override + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {?Workspace.UILocation} + */ + rawLocationToUILocation(rawLocation) { + var mapping = this._mappingForDebuggerModel.get(rawLocation.debuggerModel); + if (!mapping) + return null; + return mapping.rawLocationToUILocation(rawLocation); + } + + /** + * @override + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {number} lineNumber + * @param {number} columnNumber + * @return {?SDK.DebuggerModel.Location} + */ + uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { + for (var mapping of this._mappingForDebuggerModel.values()) { + var rawLocation = mapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + if (rawLocation) + return rawLocation; + } + return null; + } + + /** * @param {!SDK.DebuggerModel} debuggerModel * @return {!Snippets.SnippetScriptMapping|undefined} */ @@ -337,7 +367,6 @@ Snippets.ScriptSnippetModel.snippetSourceURLPrefix = 'snippets:///'; /** - * @implements {Bindings.DebuggerSourceMapping} * @unrestricted */ Snippets.SnippetScriptMapping = class { @@ -403,7 +432,6 @@ } /** - * @override * @param {!SDK.DebuggerModel.Location} rawLocation * @return {?Workspace.UILocation} */ @@ -417,7 +445,6 @@ } /** - * @override * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber @@ -437,10 +464,9 @@ */ _addScript(script, uiSourceCode) { console.assert(!this._scriptForUISourceCode.get(uiSourceCode)); - Bindings.debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; this._scriptForUISourceCode.set(uiSourceCode, script); - Bindings.debuggerWorkspaceBinding.pushSourceMapping(script, this); + Bindings.debuggerWorkspaceBinding.updateLocations(script); } /** @@ -457,24 +483,6 @@ if (scriptUISourceCode) this._scriptSnippetModel._restoreBreakpoints(scriptUISourceCode, breakpointLocations); } - - /** - * @override - * @return {boolean} - */ - isIdentity() { - return false; - } - - /** - * @override - * @param {!Workspace.UISourceCode} uiSourceCode - * @param {number} lineNumber - * @return {boolean} - */ - uiLineHasMapping(uiSourceCode, lineNumber) { - return true; - } }; /** @@ -518,18 +526,10 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - /** - * @this {Snippets.SnippetContentProvider} - */ - function performSearch() { - callback(Common.ContentProvider.performSearchInContent(this._snippet.content, query, caseSensitive, isRegex)); - } - - // searchInContent should call back later. - window.setTimeout(performSearch.bind(this), 0); + async searchInContent(query, caseSensitive, isRegex) { + return Common.ContentProvider.performSearchInContent(this._snippet.content, query, caseSensitive, isRegex); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js index 27ac557..051298d8 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -94,8 +94,6 @@ /** @type {!Map.<number, !Element>} */ this._valueWidgets = new Map(); this.onBindingChanged(); - Bindings.debuggerWorkspaceBinding.addEventListener( - Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, this._onSourceMappingChanged, this); /** @type {?Map<!Object, !Function>} */ this._continueToLocationDecorations = null; } @@ -1351,21 +1349,13 @@ this._debuggerSourceCode = binding ? binding.network : this.uiSourceCode(); } - /** - * @param {!Common.Event} event - */ - _onSourceMappingChanged(event) { - var data = /** @type {{debuggerModel: !SDK.DebuggerModel, uiSourceCode: !Workspace.UISourceCode}} */ (event.data); - if (this._debuggerSourceCode !== data.uiSourceCode) - return; - this._updateScriptFile(data.debuggerModel); - this._updateLinesWithoutMappingHighlight(); - } - _updateLinesWithoutMappingHighlight() { + var isSourceMapSource = !!Bindings.CompilerScriptMapping.uiSourceCodeOrigin(this._debuggerSourceCode); + if (!isSourceMapSource) + return; var linesCount = this.textEditor.linesCount; for (var i = 0; i < linesCount; ++i) { - var lineHasMapping = Bindings.debuggerWorkspaceBinding.uiLineHasMapping(this._debuggerSourceCode, i); + var lineHasMapping = Bindings.CompilerScriptMapping.uiLineHasMapping(this._debuggerSourceCode, i); if (!lineHasMapping) this._hasLineWithoutMapping = true; if (this._hasLineWithoutMapping) @@ -1590,7 +1580,7 @@ * @param {boolean} enabled */ _setBreakpoint(lineNumber, columnNumber, condition, enabled) { - if (!Bindings.debuggerWorkspaceBinding.uiLineHasMapping(this._debuggerSourceCode, lineNumber)) + if (!Bindings.CompilerScriptMapping.uiLineHasMapping(this._debuggerSourceCode, lineNumber)) return; this._breakpointManager.setBreakpoint(this._debuggerSourceCode, lineNumber, columnNumber, condition, enabled); @@ -1610,8 +1600,6 @@ * @override */ dispose() { - Bindings.debuggerWorkspaceBinding.removeEventListener( - Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, this._onSourceMappingChanged, this); this._breakpointManager.removeEventListener( Bindings.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); this._breakpointManager.removeEventListener(
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js index 7912234..0e90ae7c 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
@@ -151,6 +151,10 @@ * @implements {Bindings.DebuggerSourceMapping} */ Sources.SourceFormatter.ScriptMapping = class { + constructor() { + Bindings.debuggerWorkspaceBinding.addSourceMapping(this); + } + /** * @override * @param {!SDK.DebuggerModel.Location} rawLocation @@ -186,24 +190,6 @@ } /** - * @override - * @return {boolean} - */ - isIdentity() { - return false; - } - - /** - * @override - * @param {!Workspace.UISourceCode} uiSourceCode - * @param {number} lineNumber - * @return {boolean} - */ - uiLineHasMapping(uiSourceCode, lineNumber) { - return true; - } - - /** * @param {!Sources.SourceFormatData} formatData * @param {boolean} enabled */ @@ -212,19 +198,14 @@ if (!scripts.length) return; if (enabled) { - for (var script of scripts) { + for (var script of scripts) script[Sources.SourceFormatData._formatDataSymbol] = formatData; - Bindings.debuggerWorkspaceBinding.pushSourceMapping(script, this); - } } else { - for (var script of scripts) { + for (var script of scripts) delete script[Sources.SourceFormatData._formatDataSymbol]; - Bindings.debuggerWorkspaceBinding.popSourceMapping(script); - } } - - Bindings.debuggerWorkspaceBinding.setSourceMapping( - scripts[0].debuggerModel, formatData.formattedSourceCode, enabled ? this : null); + for (var script of scripts) + Bindings.debuggerWorkspaceBinding.updateLocations(script); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js index 42ea08e..3c2df6e 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js
@@ -101,23 +101,22 @@ this._searchFinishedCallback = searchFinishedCallback; this._searchConfig = searchConfig; - var projects = this._projects(); - var barrier = new CallbackBarrier(); + var promises = []; var compositeProgress = new Common.CompositeProgress(progress); var searchContentProgress = compositeProgress.createSubProgress(); var findMatchingFilesProgress = new Common.CompositeProgress(compositeProgress.createSubProgress()); - for (var i = 0; i < projects.length; ++i) { - var project = projects[i]; + for (var project of this._projects()) { var weight = project.uiSourceCodes().length; var findMatchingFilesInProjectProgress = findMatchingFilesProgress.createSubProgress(weight); - var barrierCallback = barrier.createCallback(); var filesMathingFileQuery = this._projectFilesMatchingFileQuery(project, searchConfig); - var callback = this._processMatchingFilesForProject.bind( - this, this._searchId, project, filesMathingFileQuery, barrierCallback); - project.findFilesMatchingSearchRequest( - searchConfig, filesMathingFileQuery, findMatchingFilesInProjectProgress, callback); + var promise = + project + .findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, findMatchingFilesInProjectProgress) + .then(this._processMatchingFilesForProject.bind(this, this._searchId, project, filesMathingFileQuery)); + promises.push(promise); } - barrier.callWhenDone(this._processMatchingFiles.bind( + + Promise.all(promises).then(this._processMatchingFiles.bind( this, this._searchId, searchContentProgress, this._searchFinishedCallback.bind(this, true))); } @@ -149,11 +148,10 @@ /** * @param {number} searchId * @param {!Workspace.Project} project - * @param {!Array.<string>} filesMathingFileQuery - * @param {function()} callback - * @param {!Array.<string>} files + * @param {!Array<string>} filesMathingFileQuery + * @param {!Array<string>} files */ - _processMatchingFilesForProject(searchId, project, filesMathingFileQuery, callback, files) { + _processMatchingFilesForProject(searchId, project, filesMathingFileQuery, files) { if (searchId !== this._searchId) { this._searchFinishedCallback(false); return; @@ -165,19 +163,18 @@ files = files.mergeOrdered(dirtyFiles, String.naturalOrderComparator); var uiSourceCodes = []; - for (var i = 0; i < files.length; ++i) { - var uiSourceCode = project.uiSourceCodeForURL(files[i]); - if (uiSourceCode) { - var script = Bindings.DefaultScriptMapping.scriptForUISourceCode(uiSourceCode); - if (script && !script.isAnonymousScript()) - continue; - uiSourceCodes.push(uiSourceCode); - } + for (var file of files) { + var uiSourceCode = project.uiSourceCodeForURL(file); + if (!uiSourceCode) + continue; + var script = Bindings.DefaultScriptMapping.scriptForUISourceCode(uiSourceCode); + if (script && !script.isAnonymousScript()) + continue; + uiSourceCodes.push(uiSourceCode); } uiSourceCodes.sort(Sources.SourcesSearchScope._filesComparator); this._searchResultCandidates = this._searchResultCandidates.mergeOrdered(uiSourceCodes, Sources.SourcesSearchScope._filesComparator); - callback(); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js index 7a77aeaf..9649e8f5 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -1253,7 +1253,7 @@ this._progressLabel = progressLine.createChild('div', 'label'); this._progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator'); - this._stopButton = UI.createTextButton(Common.UIString('Stop'), stopCallback); + this._stopButton = UI.createTextButton(Common.UIString('Stop'), stopCallback, '', true); this.contentElement.createChild('div', 'stop-button').appendChild(this._stopButton); }
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/timelineStatusDialog.css b/third_party/WebKit/Source/devtools/front_end/timeline/timelineStatusDialog.css index 846e7f4d..8411fc4 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/timelineStatusDialog.css +++ b/third_party/WebKit/Source/devtools/front_end/timeline/timelineStatusDialog.css
@@ -7,13 +7,12 @@ .timeline-status-dialog { display: flex; flex-direction: column; - padding: 12px 16px; + padding: 16px 16px 12px 16px; align-self: center; background-color: white; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1); - margin-top: -1px; } .status-dialog-line { @@ -52,3 +51,7 @@ height: 100%; align-self: center; } + +.timeline-status-dialog .stop-button button { + min-width: 80px; +}
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js index fa6690cc..3e59064 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
@@ -499,24 +499,13 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { + searchInContent(query, caseSensitive, isRegex) { var content = this.content(); - if (!content) { - this._project.searchInFileContent(this, query, caseSensitive, isRegex, callback); - return; - } - - // searchInContent should call back later. - setTimeout(doSearch.bind(null, content), 0); - - /** - * @param {string} content - */ - function doSearch(content) { - callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); - } + if (!content) + return this._project.searchInFileContent(this, query, caseSensitive, isRegex); + return Promise.resolve(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); } /** @@ -803,10 +792,10 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInContent(query, caseSensitive, isRegex, callback) { - callback([]); + searchInContent(query, caseSensitive, isRegex) { + return Promise.resolve([]); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js b/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js index 04d31ea..85145c8 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js
@@ -164,17 +164,17 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback + * @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>} */ - searchInFileContent(uiSourceCode, query, caseSensitive, isRegex, callback) {}, + searchInFileContent(uiSourceCode, query, caseSensitive, isRegex) {}, /** * @param {!Workspace.ProjectSearchConfig} searchConfig * @param {!Array.<string>} filesMathingFileQuery * @param {!Common.Progress} progress - * @param {function(!Array.<string>)} callback + * @return {!Promise<!Array<string>>} */ - findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress, callback) {}, + findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress) {}, /** * @param {!Common.Progress} progress
diff --git a/third_party/WebKit/Source/modules/app_banner/BUILD.gn b/third_party/WebKit/Source/modules/app_banner/BUILD.gn index 8d3b77a..f02298c5 100644 --- a/third_party/WebKit/Source/modules/app_banner/BUILD.gn +++ b/third_party/WebKit/Source/modules/app_banner/BUILD.gn
@@ -12,5 +12,6 @@ "AppBannerPromptResult.h", "BeforeInstallPromptEvent.cpp", "BeforeInstallPromptEvent.h", + "DOMWindowInstallation.h", ] }
diff --git a/third_party/WebKit/Source/modules/app_banner/DOMWindowInstallation.h b/third_party/WebKit/Source/modules/app_banner/DOMWindowInstallation.h new file mode 100644 index 0000000..e3950ca --- /dev/null +++ b/third_party/WebKit/Source/modules/app_banner/DOMWindowInstallation.h
@@ -0,0 +1,21 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef DOMWindowInstallation_h +#define DOMWindowInstallation_h + +#include "core/EventTypeNames.h" +#include "core/events/EventTarget.h" + +namespace blink { + +class DOMWindowInstallation { + public: + DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(appinstalled); + DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(beforeinstallprompt); +}; + +} // namespace blink + +#endif // DOMWindowInstallation_h
diff --git a/third_party/WebKit/Source/modules/app_banner/WindowInstallation.idl b/third_party/WebKit/Source/modules/app_banner/WindowInstallation.idl new file mode 100644 index 0000000..3ceb8c2 --- /dev/null +++ b/third_party/WebKit/Source/modules/app_banner/WindowInstallation.idl
@@ -0,0 +1,12 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// https://www.w3.org/TR/appmanifest/#extensions-to-the-window-object + +[ + ImplementedAs=DOMWindowInstallation, +] partial interface Window { + attribute EventHandler onappinstalled; + attribute EventHandler onbeforeinstallprompt; +};
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp index 60e69cdf8..ba875b3 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -41,7 +41,6 @@ #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityPolicy.h" -#include "platform/weborigin/Suborigin.h" #include "platform/wtf/HashSet.h" #include "platform/wtf/Vector.h" #include "platform/wtf/text/WTFString.h" @@ -267,7 +266,7 @@ FetchRequestData*, bool is_isolated_world); - void PerformBasicFetch(); + void PerformSchemeFetch(); void PerformNetworkError(const String& message); void PerformHTTPFetch(bool cors_flag, bool cors_preflight_flag); void PerformDataFetch(); @@ -339,7 +338,7 @@ if (response.Url().ProtocolIs("blob") && response.HttpStatusCode() == 404) { // "If |blob| is null, return a network error." - // https://fetch.spec.whatwg.org/#concept-basic-fetch + // https://fetch.spec.whatwg.org/#concept-scheme-fetch PerformNetworkError("Blob not found."); return; } @@ -482,7 +481,7 @@ // An "Access-Control-Allow-Origin" header is added for data: URLs // but no headers except for "Content-Type" should exist, // according to the spec: - // https://fetch.spec.whatwg.org/#concept-basic-fetch + // https://fetch.spec.whatwg.org/#concept-scheme-fetch // "... return a response whose header list consist of a single header // whose name is `Content-Type` and value is the MIME type and // parameters returned from obtaining a resource" @@ -604,8 +603,8 @@ (request_->Url().ProtocolIsData() && request_->SameOriginDataURLFlag()) || (request_->Url().ProtocolIsAbout()) || (request_->Mode() == WebURLRequest::kFetchRequestModeNavigate)) { - // "The result of performing a basic fetch using request." - PerformBasicFetch(); + // "The result of performing a scheme fetch using request." + PerformSchemeFetch(); return; } @@ -623,8 +622,8 @@ if (request_->Mode() == WebURLRequest::kFetchRequestModeNoCORS) { // "Set |request|'s response tainting to |opaque|." request_->SetResponseTainting(FetchRequestData::kOpaqueTainting); - // "The result of performing a basic fetch using |request|." - PerformBasicFetch(); + // "The result of performing a scheme fetch using |request|." + PerformSchemeFetch(); return; } @@ -676,8 +675,8 @@ execution_context_ = nullptr; } -void FetchManager::Loader::PerformBasicFetch() { - // "To perform a basic fetch using |request|, switch on |request|'s url's +void FetchManager::Loader::PerformSchemeFetch() { + // "To perform a scheme fetch using |request|, switch on |request|'s url's // scheme, and run the associated steps:" if (SchemeRegistry::ShouldTreatURLSchemeAsSupportingFetchAPI( request_->Url().Protocol())) { @@ -767,34 +766,30 @@ // "5. Let |credentials flag| be set if either |HTTPRequest|'s credentials // mode is |include|, or |HTTPRequest|'s credentials mode is |same-origin| - // and the |CORS flag| is unset, and unset otherwise. + // and the |CORS flag| is unset, and unset otherwise." + + // TODO(tyoshino): It's wrong to use |cors_flag| here, now. The credentials + // mode must work even with the no-cors. See the following issues: + // - https://github.com/whatwg/fetch/issues/130 + // - https://github.com/whatwg/fetch/issues/169 // - // Also, for the last case, // https://w3c.github.io/webappsec-suborigins/#security-model-opt-outs: // "request's credentials mode is "same-origin" and request's environment // settings object has the suborigin unsafe credentials flag set and the // request’s current url is same-physical-origin with request origin." - bool suborigin_forces_credentials = - (request_->Credentials() == - WebURLRequest::kFetchCredentialsModeSameOrigin && - request_->Origin()->HasSuborigin() && - request_->Origin()->GetSuborigin()->PolicyContains( - Suborigin::SuboriginPolicyOptions::kUnsafeCredentials) && - SecurityOrigin::Create(request_->Url()) - ->IsSameSchemeHostPort(request_->Origin().Get())); StoredCredentials allow_credentials = kDoNotAllowStoredCredentials; - if (request_->Credentials() == WebURLRequest::kFetchCredentialsModeInclude || - request_->Credentials() == WebURLRequest::kFetchCredentialsModePassword || - (request_->Credentials() == + if ((request_->Credentials() == WebURLRequest::kFetchCredentialsModeSameOrigin && - !cors_flag) || - suborigin_forces_credentials) { + (!cors_flag || + request_->Origin()->HasSuboriginAndShouldAllowCredentialsFor( + request_->Url()))) || + request_->Credentials() == WebURLRequest::kFetchCredentialsModeInclude || + request_->Credentials() == WebURLRequest::kFetchCredentialsModePassword) { allow_credentials = kAllowStoredCredentials; } CredentialRequest credentials_requested = kClientDidNotRequestCredentials; if (request_->Credentials() == WebURLRequest::kFetchCredentialsModeInclude || - request_->Credentials() == WebURLRequest::kFetchCredentialsModePassword || - suborigin_forces_credentials) { + request_->Credentials() == WebURLRequest::kFetchCredentialsModePassword) { credentials_requested = kClientRequestedCredentials; } ResourceLoaderOptions resource_loader_options(allow_credentials,
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp index c9f52b30..9bf2b7bd7 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
@@ -42,6 +42,7 @@ #include "core/frame/UseCounter.h" #include "core/html/HTMLMediaElement.h" #include "core/html/HTMLVideoElement.h" +#include "core/html/media/AutoplayPolicy.h" #include "core/html/media/HTMLMediaElementControlsList.h" #include "core/html/track/TextTrackContainer.h" #include "core/html/track/TextTrackList.h" @@ -726,15 +727,16 @@ return; } - // The reason for the autoplay test is that some pages (e.g. vimeo.com) have - // an autoplay background video, which doesn't autoplay on Chrome for Android - // (we prevent it) so starts paused. In such cases we don't want to - // automatically show the cast button, since it looks strange and is unlikely - // to correspond with anything the user wants to do. If a user does want to - // cast a paused autoplay video then they can still do so by touching or - // clicking on the video, which will cause the cast button to appear. - if (!MediaElement().ShouldShowControls() && !MediaElement().Autoplay() && - MediaElement().paused()) { + // The reason for the autoplay muted test is that some pages (e.g. vimeo.com) + // have an autoplay background video which has to be muted on Android to play. + // In such cases we don't want to automatically show the cast button, since + // it looks strange and is unlikely to correspond with anything the user wants + // to do. If a user does want to cast a muted autoplay video then they can + // still do so by touching or clicking on the video, which will cause the cast + // button to appear. Note that this concerns various animated images websites + // too. + if (!MediaElement().ShouldShowControls() && + !MediaElement().GetAutoplayPolicy().IsOrWillBeAutoplayingMuted()) { // Note that this is a case where we add the overlay cast button // without wanting the panel cast button. We depend on the fact // that computeWhichControlsFit() won't change overlay cast button @@ -969,12 +971,12 @@ UpdatePlayState(); timeline_->SetPosition(MediaElement().currentTime()); UpdateCurrentTimeDisplay(); - - StartHideMediaControlsTimer(); } void MediaControlsImpl::OnPlaying() { timeline_->OnPlaying(); + + StartHideMediaControlsTimer(); } void MediaControlsImpl::OnPause() {
diff --git a/third_party/WebKit/Source/modules/modules_idl_files.gni b/third_party/WebKit/Source/modules/modules_idl_files.gni index f4d09dfc..25f7705 100644 --- a/third_party/WebKit/Source/modules/modules_idl_files.gni +++ b/third_party/WebKit/Source/modules/modules_idl_files.gni
@@ -579,6 +579,7 @@ modules_dependency_idl_files = get_path_info( [ + "app_banner/WindowInstallation.idl", "audio_output_devices/HTMLMediaElementAudioOutputDevice.idl", "background_fetch/ServiceWorkerGlobalScopeBackgroundFetch.idl", "background_fetch/ServiceWorkerRegistrationBackgroundFetch.idl",
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp index 6b9ea74..a8be752 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -29,7 +29,6 @@ #include <cmath> #include <memory> #include <utility> -#include "SkImageFilter.h" #include "SkMatrix44.h" #include "base/trace_event/trace_event_argument.h" #include "cc/layers/layer.h" @@ -44,7 +43,6 @@ #include "platform/graphics/Image.h" #include "platform/graphics/LinkHighlight.h" #include "platform/graphics/paint/DrawingRecorder.h" -#include "platform/graphics/paint/PaintCanvas.h" #include "platform/graphics/paint/PaintController.h" #include "platform/graphics/paint/RasterInvalidationTracking.h" #include "platform/instrumentation/tracing/TraceEvent.h" @@ -278,14 +276,15 @@ GraphicsContext::DisabledMode disabled_mode) { if (PaintWithoutCommit(interest_rect, disabled_mode)) { GetPaintController().CommitNewDisplayItems(); - if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { - sk_sp<PaintRecord> record = CaptureRecord(); - CheckPaintUnderInvalidations(record); - RasterInvalidationTracking& tracking = - GetRasterInvalidationTrackingMap().Add(this); - tracking.last_painted_record = std::move(record); - tracking.last_interest_rect = previous_interest_rect_; - tracking.invalidation_region_since_last_paint = Region(); + if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() && + DrawsContent()) { + auto& tracking = GetRasterInvalidationTrackingMap().Add(this); + tracking.CheckUnderInvalidations(DebugName(), CaptureRecord(), + InterestRect()); + if (tracking.under_invalidation_record) { + GetPaintController().AppendDebugDrawingAfterCommit( + *this, tracking.under_invalidation_record, InterestRect()); + } } } } @@ -1191,104 +1190,6 @@ return graphics_context.EndRecording(); } -static bool PixelComponentsDiffer(int c1, int c2) { - // Compare strictly for saturated values. - if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) - return c1 != c2; - // Tolerate invisible differences that may occur in gradients etc. - return abs(c1 - c2) > 2; -} - -static bool PixelsDiffer(SkColor p1, SkColor p2) { - return PixelComponentsDiffer(SkColorGetA(p1), SkColorGetA(p2)) || - PixelComponentsDiffer(SkColorGetR(p1), SkColorGetR(p2)) || - PixelComponentsDiffer(SkColorGetG(p1), SkColorGetG(p2)) || - PixelComponentsDiffer(SkColorGetB(p1), SkColorGetB(p2)); -} - -// This method is used to graphically verify any under invalidation when -// RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled is being -// used. It compares the last recording made by GraphicsLayer::Paint against -// |new_record|, by rastering both into bitmaps. Any differences are colored -// as dark red. -void GraphicsLayer::CheckPaintUnderInvalidations( - sk_sp<PaintRecord> new_record) { - if (!DrawsContent()) - return; - - RasterInvalidationTracking* tracking = - GetRasterInvalidationTrackingMap().Find(this); - if (!tracking) - return; - - if (!tracking->last_painted_record) - return; - - IntRect rect = Intersection(tracking->last_interest_rect, InterestRect()); - if (rect.IsEmpty()) - return; - - SkBitmap old_bitmap; - old_bitmap.allocPixels( - SkImageInfo::MakeN32Premul(rect.Width(), rect.Height())); - { - SkiaPaintCanvas canvas(old_bitmap); - canvas.clear(SK_ColorTRANSPARENT); - canvas.translate(-rect.X(), -rect.Y()); - canvas.drawPicture(tracking->last_painted_record); - } - - SkBitmap new_bitmap; - new_bitmap.allocPixels( - SkImageInfo::MakeN32Premul(rect.Width(), rect.Height())); - { - SkiaPaintCanvas canvas(new_bitmap); - canvas.clear(SK_ColorTRANSPARENT); - canvas.translate(-rect.X(), -rect.Y()); - canvas.drawPicture(std::move(new_record)); - } - - int mismatching_pixels = 0; - static const int kMaxMismatchesToReport = 50; - for (int bitmap_y = 0; bitmap_y < rect.Height(); ++bitmap_y) { - int layer_y = bitmap_y + rect.Y(); - for (int bitmap_x = 0; bitmap_x < rect.Width(); ++bitmap_x) { - int layer_x = bitmap_x + rect.X(); - SkColor old_pixel = old_bitmap.getColor(bitmap_x, bitmap_y); - SkColor new_pixel = new_bitmap.getColor(bitmap_x, bitmap_y); - if (PixelsDiffer(old_pixel, new_pixel) && - !tracking->invalidation_region_since_last_paint.Contains( - IntPoint(layer_x, layer_y))) { - if (mismatching_pixels < kMaxMismatchesToReport) { - UnderRasterInvalidation under_invalidation = {layer_x, layer_y, - old_pixel, new_pixel}; - tracking->under_invalidations.push_back(under_invalidation); - LOG(ERROR) << DebugName() - << " Uninvalidated old/new pixels mismatch at " << layer_x - << "," << layer_y << " old:" << std::hex << old_pixel - << " new:" << new_pixel; - } else if (mismatching_pixels == kMaxMismatchesToReport) { - LOG(ERROR) << "and more..."; - } - ++mismatching_pixels; - *new_bitmap.getAddr32(bitmap_x, bitmap_y) = - SkColorSetARGB(0xFF, 0xA0, 0, 0); // Dark red. - } else { - *new_bitmap.getAddr32(bitmap_x, bitmap_y) = SK_ColorTRANSPARENT; - } - } - } - - // Visualize under-invalidations by overlaying the new bitmap (containing red - // pixels indicating under-invalidations, and transparent pixels otherwise) - // onto the painting. - PaintRecorder recorder; - recorder.beginRecording(rect); - recorder.getRecordingCanvas()->drawBitmap(new_bitmap, rect.X(), rect.Y()); - sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); - GetPaintController().AppendDebugDrawingAfterCommit(*this, record, rect); -} - } // namespace blink #ifndef NDEBUG
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h index 1d174bec..0cd3939 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
@@ -325,7 +325,6 @@ RenderingContextMap&) const; sk_sp<PaintRecord> CaptureRecord(); - void CheckPaintUnderInvalidations(sk_sp<PaintRecord>); GraphicsLayerClient* client_;
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp index a5cd7946..63be6501 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -158,6 +158,8 @@ return paint_chunk.id && id_ == *paint_chunk.id; } + const String& DebugName() const { return debug_name_; } + private: PaintChunk::Id id_; String debug_name_; @@ -267,7 +269,6 @@ const PendingLayer& pending_layer, gfx::Vector2dF& layer_offset, Vector<std::unique_ptr<ContentLayerClientImpl>>& new_content_layer_clients, - RasterInvalidationTrackingMap<const PaintChunk>* tracking_map, bool store_debug_info) { DCHECK(pending_layer.paint_chunks.size()); const PaintChunk& first_paint_chunk = *pending_layer.paint_chunks[0]; @@ -287,14 +288,6 @@ gfx::Rect cc_combined_bounds(EnclosingIntRect(pending_layer.bounds)); layer_offset = cc_combined_bounds.OffsetFromOrigin(); - scoped_refptr<cc::DisplayItemList> display_list = - PaintChunksToCcLayer::Convert( - pending_layer.paint_chunks, pending_layer.property_tree_state, - layer_offset, paint_artifact.GetDisplayItemList()); - content_layer_client->SetDisplayList(std::move(display_list)); - content_layer_client->SetPaintableRegion( - gfx::Rect(cc_combined_bounds.size())); - scoped_refptr<cc::PictureLayer> cc_picture_layer = content_layer_client->CcPictureLayer(); cc_picture_layer->SetBounds(cc_combined_bounds.size()); @@ -311,10 +304,9 @@ DisplayItemList::kShownOnlyDisplayItemTypes)); } - auto* raster_tracking = - tracking_map ? tracking_map->Find(paint_chunk) : nullptr; - DCHECK(!raster_tracking || paint_chunk->raster_invalidation_rects.size() == - raster_tracking->invalidations.size()); + DCHECK(paint_chunk->raster_invalidation_tracking.IsEmpty() || + paint_chunk->raster_invalidation_rects.size() == + paint_chunk->raster_invalidation_tracking.size()); for (size_t i = 0; i < paint_chunk->raster_invalidation_rects.size(); ++i) { auto rect = MapRasterInvalidationRectFromChunkToLayer( @@ -324,17 +316,33 @@ continue; content_layer_client->SetNeedsDisplayRect(rect); - if (!raster_tracking) + if (paint_chunk->raster_invalidation_tracking.IsEmpty()) continue; auto& cc_tracking = content_layer_client->EnsureRasterInvalidationTracking(); - auto info = raster_tracking->invalidations[i]; + auto info = paint_chunk->raster_invalidation_tracking[i]; info.rect = rect; cc_tracking.invalidations.push_back(info); cc_tracking.invalidation_region_since_last_paint.Unite(rect); } } + Optional<RasterUnderInvalidationCheckingParams> params; + if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { + params.emplace( + content_layer_client->EnsureRasterInvalidationTracking(), + IntRect(0, 0, cc_combined_bounds.width(), cc_combined_bounds.height()), + content_layer_client->DebugName()); + } + + auto display_list = PaintChunksToCcLayer::Convert( + pending_layer.paint_chunks, pending_layer.property_tree_state, + layer_offset, paint_artifact.GetDisplayItemList(), + params ? &*params : nullptr); + content_layer_client->SetDisplayList(std::move(display_list)); + content_layer_client->SetPaintableRegion( + gfx::Rect(cc_combined_bounds.size())); + new_content_layer_clients.push_back(std::move(content_layer_client)); return cc_picture_layer; } @@ -625,7 +633,6 @@ void PaintArtifactCompositor::Update( const PaintArtifact& paint_artifact, - RasterInvalidationTrackingMap<const PaintChunk>* raster_chunk_invalidations, bool store_debug_info, CompositorElementIdSet& composited_element_ids) { #ifndef NDEBUG @@ -671,7 +678,7 @@ gfx::Vector2dF layer_offset; scoped_refptr<cc::Layer> layer = CompositedLayerForPendingLayer( paint_artifact, pending_layer, layer_offset, new_content_layer_clients, - raster_chunk_invalidations, store_debug_info); + store_debug_info); const auto* transform = pending_layer.property_tree_state.Transform(); int transform_id =
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h index bc271933..812d82e 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
@@ -57,8 +57,6 @@ // the layers that will be output as part of a call to layersAsJSON // (if LayerTreeIncludesDebugInfo is specified). void Update(const PaintArtifact&, - RasterInvalidationTrackingMap<const PaintChunk>* - paint_chunk_invalidations, bool store_debug_info, CompositorElementIdSet& composited_element_ids); @@ -166,7 +164,6 @@ gfx::Vector2dF& layer_offset, Vector<std::unique_ptr<ContentLayerClientImpl>>& new_content_layer_clients, - RasterInvalidationTrackingMap<const PaintChunk>*, bool store_debug_info); // Finds a client among the current vector of clients that matches the paint
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp index 60749c7..55485850 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -130,7 +130,7 @@ void Update(const PaintArtifact& artifact, CompositorElementIdSet& element_ids) { - paint_artifact_compositor_->Update(artifact, nullptr, false, element_ids); + paint_artifact_compositor_->Update(artifact, false, element_ids); web_layer_tree_view_->GetLayerTreeHost()->LayoutAndUpdateLayers(); }
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp index b6db16a..33da1532 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp
@@ -13,6 +13,7 @@ #include "platform/graphics/paint/GeometryMapper.h" #include "platform/graphics/paint/PaintChunk.h" #include "platform/graphics/paint/PropertyTreeState.h" +#include "platform/graphics/paint/RasterInvalidationTracking.h" namespace blink { @@ -228,7 +229,8 @@ const Vector<const PaintChunk*>& paint_chunks, const PropertyTreeState& layer_state, const gfx::Vector2dF& layer_offset, - const DisplayItemList& display_items) { + const DisplayItemList& display_items, + RasterUnderInvalidationCheckingParams* under_invalidation_checking_params) { auto cc_list = make_scoped_refptr(new cc::DisplayItemList); bool need_translate = !layer_offset.IsZero(); @@ -270,6 +272,25 @@ cc_list->EndPaintOfPairedEnd(); } + if (under_invalidation_checking_params) { + auto& params = *under_invalidation_checking_params; + PaintRecorder recorder; + recorder.beginRecording(params.interest_rect); + // Create a complete cloned list for under-invalidation checking. We can't + // use cc_list because it is not finalized yet. + auto list_clone = + Convert(paint_chunks, layer_state, layer_offset, display_items); + recorder.getRecordingCanvas()->drawDisplayItemList(list_clone); + params.tracking.CheckUnderInvalidations(params.debug_name, + recorder.finishRecordingAsPicture(), + params.interest_rect); + if (auto record = params.tracking.under_invalidation_record) { + cc::PaintOpBuffer* buffer = cc_list->StartPaint(); + buffer->push<cc::DrawRecordOp>(record); + cc_list->EndPaintOfUnpaired(g_large_rect); + } + } + cc_list->Finalize(); return cc_list; }
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.h b/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.h index 481e8461..1f47ce6 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.h +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.h
@@ -7,7 +7,9 @@ #include "base/memory/ref_counted.h" #include "platform/PlatformExport.h" +#include "platform/geometry/IntRect.h" #include "platform/wtf/Vector.h" +#include "platform/wtf/text/WTFString.h" namespace cc { class DisplayItemList; @@ -22,6 +24,20 @@ class DisplayItemList; struct PaintChunk; class PropertyTreeState; +struct RasterInvalidationTracking; + +struct RasterUnderInvalidationCheckingParams { + RasterUnderInvalidationCheckingParams(RasterInvalidationTracking& tracking, + const IntRect& interest_rect, + const String& debug_name) + : tracking(tracking), + interest_rect(interest_rect), + debug_name(debug_name) {} + + RasterInvalidationTracking& tracking; + IntRect interest_rect; + String debug_name; +}; class PLATFORM_EXPORT PaintChunksToCcLayer { public: @@ -29,7 +45,8 @@ const Vector<const PaintChunk*>&, const PropertyTreeState& layer_state, const gfx::Vector2dF& layer_offset, - const DisplayItemList&); + const DisplayItemList&, + RasterUnderInvalidationCheckingParams* = nullptr); }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h index 413825f..2399fb0 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
@@ -9,6 +9,7 @@ #include "platform/geometry/FloatRect.h" #include "platform/graphics/paint/DisplayItem.h" #include "platform/graphics/paint/PaintChunkProperties.h" +#include "platform/graphics/paint/RasterInvalidationTracking.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/Optional.h" #include "platform/wtf/Vector.h" @@ -99,6 +100,8 @@ // SPv2 only. Rectangles that need to be re-rasterized in this chunk, in the // coordinate space of the containing transform node. Vector<FloatRect> raster_invalidation_rects; + + Vector<RasterInvalidationInfo> raster_invalidation_tracking; }; inline bool operator==(const PaintChunk& a, const PaintChunk& b) {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp index 9095fb1..e3e690e 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -19,8 +19,7 @@ namespace blink { void PaintController::SetTracksRasterInvalidations(bool value) { - if (value || - RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { + if (value) { raster_invalidation_tracking_info_ = WTF::MakeUnique<RasterInvalidationTrackingInfo>(); @@ -31,9 +30,20 @@ raster_invalidation_tracking_info_->old_client_debug_names.Set( &item.Client(), item.Client().DebugName()); } - } else { + } else if (!RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { raster_invalidation_tracking_info_ = nullptr; } + + for (auto& chunk : current_paint_artifact_.PaintChunks()) + chunk.raster_invalidation_tracking.clear(); +} + +void PaintController::SetupRasterUnderInvalidationChecking() { + if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() && + !raster_invalidation_tracking_info_) { + raster_invalidation_tracking_info_ = + WTF::MakeUnique<RasterInvalidationTrackingInfo>(); + } } const PaintArtifact& PaintController::GetPaintArtifact() const { @@ -582,10 +592,6 @@ // The new list will not be appended to again so we can release unused memory. new_display_item_list_.ShrinkToFit(); - if (raster_invalidation_tracking_info_) { - for (const auto& chunk : current_paint_artifact_.PaintChunks()) - raster_invalidation_tracking_info_->map.Remove(&chunk); - } current_paint_artifact_ = PaintArtifact(std::move(new_display_item_list_), new_paint_chunks_.ReleasePaintChunks()); @@ -647,6 +653,7 @@ const DisplayItemClient& display_item_client, sk_sp<PaintRecord> record, const FloatRect& record_bounds) { + DCHECK(!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); DCHECK(new_display_item_list_.IsEmpty()); DrawingDisplayItem& display_item = current_paint_artifact_.GetDisplayItemList() @@ -743,8 +750,7 @@ info.client_debug_name = client.DebugName(); } - raster_invalidation_tracking_info_->map.Add(&chunk).invalidations.push_back( - info); + chunk.raster_invalidation_tracking.push_back(info); } void PaintController::GenerateRasterInvalidationsComparingChunks(
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h index 5185f436..d156a90a 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
@@ -199,12 +199,7 @@ #endif void SetTracksRasterInvalidations(bool value); - RasterInvalidationTrackingMap<const PaintChunk>* - PaintChunksRasterInvalidationTrackingMap() { - return raster_invalidation_tracking_info_ - ? &raster_invalidation_tracking_info_->map - : nullptr; - } + void SetupRasterUnderInvalidationChecking(); bool LastDisplayItemIsSubsequenceEnd() const; @@ -228,9 +223,6 @@ under_invalidation_checking_end_(0), last_cached_subsequence_end_(0) { ResetCurrentListIndices(); - SetTracksRasterInvalidations( - RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()); - // frame_first_paints_ should have one null frame since the beginning, so // that PaintController is robust even if it paints outside of BeginFrame // and EndFrame cycles. It will also enable us to combine the first paint @@ -424,7 +416,6 @@ String under_invalidation_message_prefix_; struct RasterInvalidationTrackingInfo { - RasterInvalidationTrackingMap<const PaintChunk> map; using ClientDebugNamesMap = HashMap<const DisplayItemClient*, String>; ClientDebugNamesMap new_client_debug_names; ClientDebugNamesMap old_client_debug_names;
diff --git a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.cpp b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.cpp index 0b13563..52d731e8 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.cpp
@@ -4,8 +4,11 @@ #include "platform/graphics/paint/RasterInvalidationTracking.h" +#include "SkImageFilter.h" #include "platform/geometry/LayoutRect.h" #include "platform/graphics/Color.h" +#include "platform/graphics/paint/PaintCanvas.h" +#include "platform/graphics/paint/PaintRecorder.h" namespace blink { @@ -83,4 +86,102 @@ } } +static bool PixelComponentsDiffer(int c1, int c2) { + // Compare strictly for saturated values. + if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) + return c1 != c2; + // Tolerate invisible differences that may occur in gradients etc. + return abs(c1 - c2) > 2; +} + +static bool PixelsDiffer(SkColor p1, SkColor p2) { + return PixelComponentsDiffer(SkColorGetA(p1), SkColorGetA(p2)) || + PixelComponentsDiffer(SkColorGetR(p1), SkColorGetR(p2)) || + PixelComponentsDiffer(SkColorGetG(p1), SkColorGetG(p2)) || + PixelComponentsDiffer(SkColorGetB(p1), SkColorGetB(p2)); +} + +void RasterInvalidationTracking::CheckUnderInvalidations( + const String& layer_debug_name, + sk_sp<PaintRecord> new_record, + const IntRect& new_interest_rect) { + auto old_interest_rect = last_interest_rect; + auto invalidation_region = invalidation_region_since_last_paint; + auto old_record = std::move(last_painted_record); + + last_painted_record = new_record; + last_interest_rect = new_interest_rect; + invalidation_region_since_last_paint = Region(); + + if (!old_record) + return; + + IntRect rect = Intersection(old_interest_rect, new_interest_rect); + // Avoid too big area as the following code is slow. + rect.Intersect(IntRect(0, 0, 1200, 1200)); + if (rect.IsEmpty()) + return; + + SkBitmap old_bitmap; + old_bitmap.allocPixels( + SkImageInfo::MakeN32Premul(rect.Width(), rect.Height())); + { + SkiaPaintCanvas canvas(old_bitmap); + canvas.clear(SK_ColorTRANSPARENT); + canvas.translate(-rect.X(), -rect.Y()); + canvas.drawPicture(std::move(old_record)); + } + + SkBitmap new_bitmap; + new_bitmap.allocPixels( + SkImageInfo::MakeN32Premul(rect.Width(), rect.Height())); + { + SkiaPaintCanvas canvas(new_bitmap); + canvas.clear(SK_ColorTRANSPARENT); + canvas.translate(-rect.X(), -rect.Y()); + canvas.drawPicture(std::move(new_record)); + } + + int mismatching_pixels = 0; + static const int kMaxMismatchesToReport = 50; + for (int bitmap_y = 0; bitmap_y < rect.Height(); ++bitmap_y) { + int layer_y = bitmap_y + rect.Y(); + for (int bitmap_x = 0; bitmap_x < rect.Width(); ++bitmap_x) { + int layer_x = bitmap_x + rect.X(); + SkColor old_pixel = old_bitmap.getColor(bitmap_x, bitmap_y); + SkColor new_pixel = new_bitmap.getColor(bitmap_x, bitmap_y); + if (PixelsDiffer(old_pixel, new_pixel) && + !invalidation_region.Contains(IntPoint(layer_x, layer_y))) { + if (mismatching_pixels < kMaxMismatchesToReport) { + RasterUnderInvalidation under_invalidation = {layer_x, layer_y, + old_pixel, new_pixel}; + under_invalidations.push_back(under_invalidation); + LOG(ERROR) << layer_debug_name + << " Uninvalidated old/new pixels mismatch at " << layer_x + << "," << layer_y << " old:" << std::hex << old_pixel + << " new:" << new_pixel; + } else if (mismatching_pixels == kMaxMismatchesToReport) { + LOG(ERROR) << "and more..."; + } + ++mismatching_pixels; + *new_bitmap.getAddr32(bitmap_x, bitmap_y) = + SkColorSetARGB(0xFF, 0xA0, 0, 0); // Dark red. + } else { + *new_bitmap.getAddr32(bitmap_x, bitmap_y) = SK_ColorTRANSPARENT; + } + } + } + + if (!mismatching_pixels) + return; + + PaintRecorder recorder; + recorder.beginRecording(rect); + auto* canvas = recorder.getRecordingCanvas(); + if (under_invalidation_record) + canvas->drawPicture(std::move(under_invalidation_record)); + canvas->drawBitmap(new_bitmap, rect.X(), rect.Y()); + under_invalidation_record = recorder.finishRecordingAsPicture(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h index bbc0d74..b466811 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h +++ b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h
@@ -36,7 +36,7 @@ return a.rect == b.rect; } -struct UnderRasterInvalidation { +struct RasterUnderInvalidation { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); int x; int y; @@ -48,11 +48,22 @@ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); Vector<RasterInvalidationInfo> invalidations; - // The following fields are for under-raster-invalidation detection. + // The following fields are for raster under-invalidation detection. sk_sp<PaintRecord> last_painted_record; IntRect last_interest_rect; Region invalidation_region_since_last_paint; - Vector<UnderRasterInvalidation> under_invalidations; + Vector<RasterUnderInvalidation> under_invalidations; + // Records under-invalidated pixels in dark red, accumulated. + sk_sp<PaintRecord> under_invalidation_record; + + // Compares the last recording against |new_record|, by rastering both into + // bitmaps. If there are any differences outside of invalidated regions, + // the corresponding pixels in under_invalidation_record will be drawn in + // dark red. The caller can overlay under_invalidation_record onto the + // original drawings to show the under raster invalidations. + void CheckUnderInvalidations(const String& layer_debug_name, + sk_sp<PaintRecord> new_record, + const IntRect& new_interest_rect); void AsJSON(JSONObject*); }; @@ -89,6 +100,8 @@ InvalidationTrackingMap map_; }; +void ResetTrackedRasterInvalidations(); + } // namespace blink #endif // RasterInvalidationTracking_h
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp index fe812f2..f5aee5c 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp
@@ -29,7 +29,6 @@ #include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" -#include "platform/weborigin/Suborigin.h" namespace blink { @@ -58,29 +57,26 @@ SecurityOrigin* origin, CrossOriginAttributeValue cross_origin) { DCHECK_NE(cross_origin, kCrossOriginAttributeNotSet); + // Per https://w3c.github.io/webappsec-suborigins/#security-model-opt-outs, // credentials are forced when credentials mode is "same-origin", the // 'unsafe-credentials' option is set, and the request's physical origin is // the same as the URL's. - const bool suborigin_policy_forces_credentials = - origin->HasSuborigin() && - origin->GetSuborigin()->PolicyContains( - Suborigin::SuboriginPolicyOptions::kUnsafeCredentials) && - SecurityOrigin::Create(Url())->IsSameSchemeHostPort(origin); - const bool use_credentials = - cross_origin == kCrossOriginAttributeUseCredentials || - suborigin_policy_forces_credentials; + const bool is_same_origin_request = - origin && origin->CanRequestNoSuborigin(resource_request_.Url()); + origin && (origin->CanRequestNoSuborigin(resource_request_.Url()) || + origin->HasSuboriginAndShouldAllowCredentialsFor(Url())); // Currently FetchParametersMode and FetchCredentialsMode are only used when // the request goes to Service Worker. resource_request_.SetFetchRequestMode(WebURLRequest::kFetchRequestModeCORS); resource_request_.SetFetchCredentialsMode( - use_credentials ? WebURLRequest::kFetchCredentialsModeInclude - : WebURLRequest::kFetchCredentialsModeSameOrigin); + cross_origin == kCrossOriginAttributeUseCredentials + ? WebURLRequest::kFetchCredentialsModeInclude + : WebURLRequest::kFetchCredentialsModeSameOrigin); - if (is_same_origin_request || use_credentials) { + if (is_same_origin_request || + cross_origin == kCrossOriginAttributeUseCredentials) { options_.allow_credentials = kAllowStoredCredentials; resource_request_.SetAllowStoredCredentials(true); } else { @@ -89,9 +85,10 @@ } options_.cors_enabled = kIsCORSEnabled; options_.security_origin = origin; - options_.credentials_requested = use_credentials - ? kClientRequestedCredentials - : kClientDidNotRequestCredentials; + options_.credentials_requested = + cross_origin == kCrossOriginAttributeUseCredentials + ? kClientRequestedCredentials + : kClientDidNotRequestCredentials; // TODO: Credentials should be removed only when the request is cross origin. resource_request_.RemoveUserAndPassFromURL();
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp index 03d60e88..ee5af3a 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
@@ -49,7 +49,7 @@ : url_(url), cache_policy_(WebCachePolicy::kUseProtocolCachePolicy), timeout_interval_(default_timeout_interval_), - requestor_origin_(SecurityOrigin::CreateUnique()), + requestor_origin_(nullptr), http_method_(HTTPNames::GET), allow_stored_credentials_(true), report_upload_progress_(false),
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp index d769c49..68a9d8a 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp
@@ -15,12 +15,6 @@ namespace blink { -TEST(ResourceRequestTest, RequestorOriginNonNull) { - ResourceRequest req; - EXPECT_NE(nullptr, req.RequestorOrigin().Get()); - EXPECT_TRUE(req.RequestorOrigin()->IsUnique()); -} - TEST(ResourceRequestTest, CrossThreadResourceRequestData) { ResourceRequest original; original.SetURL(KURL(kParsedURLString, "http://www.example.com/test.htm"));
diff --git a/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h b/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h index 8f1240fa..05879f3 100644 --- a/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h +++ b/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h
@@ -36,14 +36,14 @@ // ScrollAnimatorCompositorCoordinator implementation. void ResetAnimationState() override; void CancelAnimation() override; - void TakeOverCompositorAnimation() override{}; + void TakeOverCompositorAnimation() override {} ScrollableArea* GetScrollableArea() const override { return scrollable_area_; } void TickAnimation(double monotonic_time) override; void UpdateCompositorAnimations() override; void NotifyCompositorAnimationFinished(int group_id) override; - void NotifyCompositorAnimationAborted(int group_id) override{}; + void NotifyCompositorAnimationAborted(int group_id) override {} void LayerForCompositedScrollingDidChange( CompositorAnimationTimeline*) override;
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h index 40a972d..4f04683 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h
@@ -74,14 +74,14 @@ ScrollableArea* GetScrollableArea() const override { return scrollable_area_; } - void TickAnimation(double monotonic_time) override{}; + void TickAnimation(double monotonic_time) override {} void CancelAnimation() override {} void TakeOverCompositorAnimation() override {} - void UpdateCompositorAnimations() override{}; - void NotifyCompositorAnimationFinished(int group_id) override{}; - void NotifyCompositorAnimationAborted(int group_id) override{}; + void UpdateCompositorAnimations() override {} + void NotifyCompositorAnimationFinished(int group_id) override {} + void NotifyCompositorAnimationAborted(int group_id) override {} void LayerForCompositedScrollingDidChange( - CompositorAnimationTimeline*) override{}; + CompositorAnimationTimeline*) override {} virtual void ContentAreaWillPaint() const {} virtual void MouseEnteredContentArea() const {}
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h index fdcef7d..baa2958d 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
@@ -148,7 +148,7 @@ void NotifyAnimationAborted(double monotonic_time, int group) override; void NotifyAnimationTakeover(double monotonic_time, double animation_start_time, - std::unique_ptr<cc::AnimationCurve>) override{}; + std::unique_ptr<cc::AnimationCurve>) override {} // CompositorAnimationPlayerClient implementation. CompositorAnimationPlayer* CompositorPlayer() const override;
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp index 7aac587..f2134c9 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
@@ -139,8 +139,8 @@ public: TestScrollAnimator(ScrollableArea* scrollable_area, WTF::TimeFunction timing_function) - : ScrollAnimator(scrollable_area, timing_function){}; - ~TestScrollAnimator() override{}; + : ScrollAnimator(scrollable_area, timing_function) {} + ~TestScrollAnimator() override {} void SetShouldSendToCompositor(bool send) { should_send_to_compositor_ = send;
diff --git a/third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp b/third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp index d2fa1de..2a99de2 100644 --- a/third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp +++ b/third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp
@@ -42,11 +42,11 @@ const String& text) override {} void WillUseRange(const FontDescription&, const AtomicString& family_name, - const FontDataForRangeSet&) override{}; + const FontDataForRangeSet&) override {} unsigned Version() const override { return 0; } void FontCacheInvalidated() override {} - void ReportNotDefGlyph() const override{}; + void ReportNotDefGlyph() const override {} private: TestFontSelector(PassRefPtr<FontCustomPlatformData> custom_platform_data)
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp index 8b6c9226..1f96326 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
@@ -221,6 +221,17 @@ return false; } +bool SecurityOrigin::HasSameSuboriginAs(const SecurityOrigin* other) const { + if (HasSuborigin() != other->HasSuborigin()) + return false; + + if (HasSuborigin() && + GetSuborigin()->GetName() != other->GetSuborigin()->GetName()) + return false; + + return true; +} + bool SecurityOrigin::CanAccess(const SecurityOrigin* other) const { if (universal_access_) return true; @@ -231,11 +242,7 @@ if (IsUnique() || other->IsUnique()) return false; - if (HasSuborigin() != other->HasSuborigin()) - return false; - - if (HasSuborigin() && - GetSuborigin()->GetName() != other->GetSuborigin()->GetName()) + if (!HasSameSuboriginAs(other)) return false; // document.domain handling, as per @@ -562,11 +569,23 @@ bool SecurityOrigin::IsSameSchemeHostPortAndSuborigin( const SecurityOrigin* other) const { - bool same_suborigins = - (HasSuborigin() == other->HasSuborigin()) && - (!HasSuborigin() || - (GetSuborigin()->GetName() == other->GetSuborigin()->GetName())); - return IsSameSchemeHostPort(other) && same_suborigins; + if (!HasSameSuboriginAs(other)) + return false; + + return IsSameSchemeHostPort(other); +} + +bool SecurityOrigin::HasSuboriginAndShouldAllowCredentialsFor( + const KURL& url) const { + if (!HasSuborigin()) + return false; + + if (!GetSuborigin()->PolicyContains( + Suborigin::SuboriginPolicyOptions::kUnsafeCredentials)) + return false; + + RefPtr<SecurityOrigin> other = SecurityOrigin::Create(url); + return IsSameSchemeHostPort(other.Get()); } bool SecurityOrigin::AreSameSchemeHostPort(const KURL& a, const KURL& b) {
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h index 4aa9292..6c14ed9 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h
@@ -207,6 +207,11 @@ const Suborigin* GetSuborigin() const { return &suborigin_; } void AddSuborigin(const Suborigin&); + // Returns true when this SecurityOrigin has a suborigin, its policy + // allows sending credentials to the same physical origin, and the specified + // origin is the same physical origin. + bool HasSuboriginAndShouldAllowCredentialsFor(const KURL&) const; + // By default 'file:' URLs may access other 'file:' URLs. This method // denies access. If either SecurityOrigin sets this flag, the access // check will fail. @@ -286,6 +291,8 @@ String&, String&); + bool HasSameSuboriginAs(const SecurityOrigin* other) const; + String protocol_; String host_; String domain_;
diff --git a/third_party/WebKit/Source/web/BUILD.gn b/third_party/WebKit/Source/web/BUILD.gn index 8bd8a0f..e4247ca 100644 --- a/third_party/WebKit/Source/web/BUILD.gn +++ b/third_party/WebKit/Source/web/BUILD.gn
@@ -61,18 +61,12 @@ "MediaKeysClientImpl.h", "NavigatorContentUtilsClientImpl.cpp", "NavigatorContentUtilsClientImpl.h", - "OpenedFrameTracker.cpp", - "OpenedFrameTracker.h", "PageOverlay.cpp", "PageOverlay.h", "PopupMenuImpl.cpp", "PopupMenuImpl.h", "PrerendererClientImpl.cpp", "PrerendererClientImpl.h", - "RemoteFrameClientImpl.cpp", - "RemoteFrameClientImpl.h", - "RemoteFrameOwner.cpp", - "RemoteFrameOwner.h", "ServiceWorkerGlobalScopeClientImpl.cpp", "ServiceWorkerGlobalScopeClientImpl.h", "ServiceWorkerGlobalScopeProxy.cpp", @@ -96,7 +90,6 @@ "WebFactoryImpl.h", "WebFormElementObserverImpl.cpp", "WebFormElementObserverImpl.h", - "WebFrame.cpp", "WebFrameSerializer.cpp", "WebFrameSerializerImpl.cpp", "WebFrameSerializerImpl.h", @@ -120,8 +113,6 @@ "WebPepperSocketImpl.cpp", "WebPepperSocketImpl.h", "WebPluginDocument.cpp", - "WebRemoteFrameImpl.cpp", - "WebRemoteFrameImpl.h", "WebScopedWindowFocusAllowedIndicator.cpp", "WebSearchableFormData.cpp", "WebSurroundingText.cpp",
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp index 68b3156..0aaf2954 100644 --- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp +++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -41,6 +41,7 @@ #include "core/events/WebInputEventConversion.h" #include "core/exported/WebFileChooserCompletionImpl.h" #include "core/exported/WebPluginContainerBase.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/exported/WebSettingsImpl.h" #include "core/exported/WebViewBase.h" #include "core/frame/LocalFrameView.h" @@ -123,7 +124,6 @@ #include "web/PopupMenuImpl.h" #include "web/WebFrameWidgetImpl.h" #include "web/WebLocalFrameImpl.h" -#include "web/WebRemoteFrameImpl.h" namespace blink { @@ -184,8 +184,8 @@ return new ChromeClientImpl(web_view); } -void* ChromeClientImpl::WebView() const { - return static_cast<void*>(web_view_); +WebViewBase* ChromeClientImpl::GetWebView() const { + return web_view_; } void ChromeClientImpl::ChromeDestroyed() {
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.h b/third_party/WebKit/Source/web/ChromeClientImpl.h index 502fd04..f00b2d7 100644 --- a/third_party/WebKit/Source/web/ChromeClientImpl.h +++ b/third_party/WebKit/Source/web/ChromeClientImpl.h
@@ -52,7 +52,7 @@ static ChromeClientImpl* Create(WebViewBase*); ~ChromeClientImpl() override; - void* WebView() const override; + WebViewBase* GetWebView() const override; // ChromeClient methods: void ChromeDestroyed() override;
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp index 00e1a649..b7d7dc8 100644 --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
@@ -62,13 +62,13 @@ void ServiceWorkerGlobalScopeClientImpl::OpenWindowForClients( const WebURL& url, std::unique_ptr<WebServiceWorkerClientCallbacks> callbacks) { - client_.OpenWindowForClients(url, std::move(callbacks)); + client_.OpenNewTab(url, std::move(callbacks)); } void ServiceWorkerGlobalScopeClientImpl::OpenWindowForPaymentHandler( const WebURL& url, std::unique_ptr<WebServiceWorkerClientCallbacks> callbacks) { - client_.OpenWindowForPaymentHandler(url, std::move(callbacks)); + client_.OpenNewPopup(url, std::move(callbacks)); } void ServiceWorkerGlobalScopeClientImpl::SetCachedMetadata(const WebURL& url,
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImplTest.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImplTest.cpp index 86a6efba..2a8860d 100644 --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImplTest.cpp +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImplTest.cpp
@@ -59,14 +59,12 @@ std::unique_ptr<WebServiceWorkerClientsCallbacks>) override { NOTREACHED(); } - void OpenWindowForClients( - const WebURL&, - std::unique_ptr<WebServiceWorkerClientCallbacks>) override { + void OpenNewTab(const WebURL&, + std::unique_ptr<WebServiceWorkerClientCallbacks>) override { NOTREACHED(); } - void OpenWindowForPaymentHandler( - const WebURL&, - std::unique_ptr<WebServiceWorkerClientCallbacks>) override { + void OpenNewPopup(const WebURL&, + std::unique_ptr<WebServiceWorkerClientCallbacks>) override { NOTREACHED(); } void PostMessageToClient(const WebString& uuid,
diff --git a/third_party/WebKit/Source/web/WebFrameSerializer.cpp b/third_party/WebKit/Source/web/WebFrameSerializer.cpp index 5ae9b75..fce3201 100644 --- a/third_party/WebKit/Source/web/WebFrameSerializer.cpp +++ b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
@@ -34,6 +34,7 @@ #include "core/InputTypeNames.h" #include "core/dom/Document.h" #include "core/dom/Element.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/frame/Frame.h" #include "core/frame/FrameSerializer.h" #include "core/frame/LocalFrame.h" @@ -73,7 +74,6 @@ #include "public/web/WebFrameSerializerCacheControlPolicy.h" #include "public/web/WebFrameSerializerClient.h" #include "web/WebFrameSerializerImpl.h" -#include "web/WebRemoteFrameImpl.h" namespace blink {
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp index bee7b60..6c62292 100644 --- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp +++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -42,6 +42,7 @@ #include "core/editing/PlainTextRange.h" #include "core/events/WebInputEventConversion.h" #include "core/exported/WebPluginContainerBase.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/exported/WebViewBase.h" #include "core/frame/LocalFrameView.h" #include "core/frame/RemoteFrame.h" @@ -74,7 +75,6 @@ #include "public/web/WebWidgetClient.h" #include "web/WebDevToolsAgentImpl.h" #include "web/WebPagePopupImpl.h" -#include "web/WebRemoteFrameImpl.h" namespace blink {
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 3bd043c..aae2a40 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -124,11 +124,13 @@ #include "core/exported/WebAssociatedURLLoaderImpl.h" #include "core/exported/WebDataSourceImpl.h" #include "core/exported/WebPluginContainerBase.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/exported/WebViewBase.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrameView.h" #include "core/frame/PageScaleConstraintsSet.h" #include "core/frame/RemoteFrame.h" +#include "core/frame/RemoteFrameOwner.h" #include "core/frame/ScreenOrientationController.h" #include "core/frame/Settings.h" #include "core/frame/SmartClip.h" @@ -227,11 +229,9 @@ #include "public/web/WebSerializedScriptValue.h" #include "public/web/WebTreeScopeType.h" #include "skia/ext/platform_canvas.h" -#include "web/RemoteFrameOwner.h" #include "web/TextFinder.h" #include "web/WebDevToolsAgentImpl.h" #include "web/WebFrameWidgetImpl.h" -#include "web/WebRemoteFrameImpl.h" namespace blink { @@ -1809,7 +1809,7 @@ WebViewBase* WebLocalFrameImpl::ViewImpl() const { if (!GetFrame()) return nullptr; - return WebViewBase::FromPage(GetFrame()->GetPage()); + return GetFrame()->GetPage()->GetChromeClient().GetWebView(); } WebDataSourceImpl* WebLocalFrameImpl::DataSourceImpl() const {
diff --git a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp index 5a6fa555..fab006a 100644 --- a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp +++ b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
@@ -4,7 +4,6 @@ * 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 @@ -154,7 +153,7 @@ : WebScreenInfo(); } - void* WebView() const override { return popup_->web_view_; } + WebViewBase* GetWebView() const override { return popup_->web_view_; } IntSize MinimumWindowSize() const override { return IntSize(0, 0); }
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 3d69245..458a596 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -54,6 +54,7 @@ #include "core/events/WheelEvent.h" #include "core/exported/WebFactory.h" #include "core/exported/WebPluginContainerBase.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/exported/WebSettingsImpl.h" #include "core/frame/BrowserControls.h" #include "core/frame/EventHandlerRegistry.h" @@ -171,7 +172,6 @@ #include "web/PrerendererClientImpl.h" #include "web/StorageQuotaClientImpl.h" #include "web/WebDevToolsAgentImpl.h" -#include "web/WebRemoteFrameImpl.h" #if USE(DEFAULT_RENDER_THEME) #include "core/layout/LayoutThemeDefault.h" @@ -1764,15 +1764,6 @@ return page_ ? page_->GetFocusController().FocusedOrMainFrame() : nullptr; } -WebViewBase* WebViewBase::FromPage(Page* page) { - return WebViewImpl::FromPage(page); -} - -WebViewBase* WebViewImpl::FromPage(Page* page) { - return page ? static_cast<WebViewBase*>(page->GetChromeClient().WebView()) - : nullptr; -} - // WebWidget ------------------------------------------------------------------ void WebViewImpl::Close() { @@ -2033,10 +2024,10 @@ DocumentLifecycle::AllowThrottlingScope throttling_scope( MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle()); - UpdateLayerTreeBackgroundColor(); PageWidgetDelegate::UpdateAllLifecyclePhases(*page_, *MainFrameImpl()->GetFrame()); + UpdateLayerTreeBackgroundColor(); if (WebDevToolsAgentImpl* devtools = MainFrameDevToolsAgentImpl()) devtools->PaintOverlay();
diff --git a/third_party/WebKit/Source/web/WebViewImpl.h b/third_party/WebKit/Source/web/WebViewImpl.h index 3983a30..e531993 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.h +++ b/third_party/WebKit/Source/web/WebViewImpl.h
@@ -286,8 +286,6 @@ // Returns the currently focused Element or null if no element has focus. Element* FocusedElement() const override; - static WebViewBase* FromPage(Page*); - WebViewClient* Client() override { return client_; } WebSpellCheckClient* SpellCheckClient() override {
diff --git a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp index fff97d9d..d45d2f7 100644 --- a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp +++ b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
@@ -30,6 +30,7 @@ #include "web/tests/FrameTestHelpers.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/frame/WebLocalFrameBase.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" @@ -49,7 +50,6 @@ #include "public/web/WebSettings.h" #include "public/web/WebTreeScopeType.h" #include "public/web/WebViewClient.h" -#include "web/WebRemoteFrameImpl.h" namespace blink { namespace FrameTestHelpers {
diff --git a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp index 1405ee4..8d52a0a 100644 --- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp +++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -4,6 +4,7 @@ #include "bindings/core/v8/NodeOrString.h" #include "core/dom/ClientRect.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/frame/BrowserControls.h" #include "core/frame/LocalFrameView.h" #include "core/frame/RootFrameViewport.h" @@ -31,7 +32,6 @@ #include "public/web/WebScriptSource.h" #include "public/web/WebSettings.h" #include "testing/gtest/include/gtest/gtest.h" -#include "web/WebRemoteFrameImpl.h" #include "web/tests/FrameTestHelpers.h" using blink::testing::RunPendingTasks;
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index 40466d6..9171bd5c 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -58,6 +58,7 @@ #include "core/editing/spellcheck/IdleSpellCheckCallback.h" #include "core/editing/spellcheck/SpellChecker.h" #include "core/events/MouseEvent.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/exported/WebViewBase.h" #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameView.h" @@ -154,7 +155,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "v8/include/v8.h" #include "web/TextFinder.h" -#include "web/WebRemoteFrameImpl.h" #include "web/WebViewImpl.h" #include "web/tests/FrameTestHelpers.h" #include "web/tests/sim/SimDisplayItemList.h" @@ -11804,6 +11804,26 @@ class WebFrameSimTest : public SimTest {}; +TEST_F(WebFrameSimTest, ChangeBackgroundColor) { + SimRequest main_resource("https://example.com/test.html", "text/html"); + + LoadURL("https://example.com/test.html"); + main_resource.Complete("<!DOCTYPE html><body></body>"); + + Element* body = GetDocument().QuerySelector("body"); + EXPECT_TRUE(!!body); + + Compositor().BeginFrame(); + // White is the default background of a web page. + EXPECT_EQ(SK_ColorWHITE, Compositor().background_color()); + + // Setting the background of the body to red will cause the background + // color of the WebView to switch to red. + body->SetInlineStyleProperty(CSSPropertyBackgroundColor, "red"); + Compositor().BeginFrame(); + EXPECT_EQ(SK_ColorRED, Compositor().background_color()); +} + TEST_F(WebFrameSimTest, DisplayNoneIFrameHasNoLayoutObjects) { SimRequest main_resource("https://example.com/test.html", "text/html"); SimRequest frame_resource("https://example.com/frame.html", "text/html");
diff --git a/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp index c39f5c5e..4f50bf0 100644 --- a/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp +++ b/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp
@@ -6,6 +6,7 @@ #include "bindings/core/v8/ScriptSourceCode.h" #include "core/dom/Document.h" #include "core/dom/Element.h" +#include "core/exported/WebRemoteFrameImpl.h" #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameView.h" #include "core/frame/WebLocalFrameBase.h" @@ -25,7 +26,6 @@ #include "public/web/WebHitTestResult.h" #include "public/web/WebSettings.h" #include "testing/gtest/include/gtest/gtest.h" -#include "web/WebRemoteFrameImpl.h" #include "web/tests/sim/SimCompositor.h" #include "web/tests/sim/SimDisplayItemList.h" #include "web/tests/sim/SimRequest.h"
diff --git a/third_party/WebKit/Source/web/tests/sim/SimCompositor.h b/third_party/WebKit/Source/web/tests/sim/SimCompositor.h index 65e9074a..38d8a9f 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimCompositor.h +++ b/third_party/WebKit/Source/web/tests/sim/SimCompositor.h
@@ -38,6 +38,12 @@ bool HasSelection() const { return has_selection_; } + void SetBackgroundColor(WebColor background_color) override { + background_color_ = background_color; + } + + WebColor background_color() { return background_color_; } + private: void SetNeedsBeginFrame() override; void SetDeferCommits(bool) override; @@ -49,6 +55,7 @@ bool has_selection_; WebViewBase* web_view_; double last_frame_time_monotonic_; + WebColor background_color_; }; } // namespace blink
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/gerrit.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/gerrit.py index 9447eb50..70c4140 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/gerrit.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/gerrit.py
@@ -48,7 +48,7 @@ def query_exportable_open_cls(self, limit=200): path = ('/changes/?q=project:\"chromium/src\"+status:open' '&o=CURRENT_FILES&o=CURRENT_REVISION&o=COMMIT_FOOTERS' - '&o=DETAILED_ACCOUNTS&n={}').format(limit) + '&o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&n={}').format(limit) open_cls_data = self.get(path) open_cls = [GerritCL(data, self) for data in open_cls_data] @@ -80,6 +80,10 @@ return self._data['owner']['email'] @property + def reviewers(self): + return self._data['reviewers'] + + @property def current_revision_sha(self): return self._data['current_revision']
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py index 194a2b1..be0d919 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py
@@ -56,6 +56,10 @@ for cl in gerrit_cls: _log.info('Found Gerrit in-flight CL: "%s" %s', cl.subject, cl.url) + if not cl.reviewers: + _log.info('CL has no reviewers, skipping.') + continue + # Check if CL already has a corresponding PR pull_request = self.wpt_github.pr_with_change_id(cl.change_id)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py index cd2404db..dbf6059 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py
@@ -168,6 +168,7 @@ 'subject': 'subject', '_number': '1', 'current_revision': '1', + 'reviewers': ['rutabaga'], 'revisions': { '1': {'commit_with_footers': 'a commit with footers'} }, @@ -203,6 +204,7 @@ 'subject': 'subject', '_number': '1', 'current_revision': '1', + 'reviewers': ['rutabaga'], 'revisions': { '1': {'commit_with_footers': 'a commit with footers'} }, @@ -232,6 +234,7 @@ 'subject': 'subject', '_number': '1', 'current_revision': '2', + 'reviewers': ['rutabaga'], 'revisions': { '1': { 'commit_with_footers': 'a commit with footers 1', @@ -287,3 +290,35 @@ ]) self.assertEqual(test_exporter.wpt_github.pull_requests_created, []) self.assertEqual(test_exporter.wpt_github.pull_requests_merged, [1234]) + + def test_does_not_create_pr_if_cl_has_no_reviewers(self): + host = MockHost() + test_exporter = TestExporter(host, 'gh-username', 'gh-token', gerrit_user=None, + gerrit_token=None, dry_run=False) + test_exporter.wpt_github = MockWPTGitHub(pull_requests=[]) + test_exporter.get_exportable_commits = lambda limit: [] + test_exporter.gerrit = MockGerritAPI(host, 'gerrit-username', 'gerrit-token') + test_exporter.gerrit.get = lambda path, raw: base64.b64encode('sample diff') # pylint: disable=unused-argument + test_exporter.gerrit.query_exportable_open_cls = lambda: [ + GerritCL(data={ + 'change_id': '1', + 'subject': 'subject', + '_number': '1', + 'current_revision': '2', + 'reviewers': [], + 'revisions': { + '1': { + 'commit_with_footers': 'a commit with footers 1', + 'description': 'subject 1', + }, + '2': { + 'commit_with_footers': 'a commit with footers 2', + 'description': 'subject 2', + }, + }, + 'owner': {'email': 'test@chromium.org'}, + }, api=test_exporter.gerrit), + ] + test_exporter.run() + self.assertEqual(test_exporter.wpt_github.calls, []) + self.assertEqual(test_exporter.wpt_github.pull_requests_created, [])
diff --git a/third_party/WebKit/public/web/WebFrame.h b/third_party/WebKit/public/web/WebFrame.h index 30caf918..4b95fb4 100644 --- a/third_party/WebKit/public/web/WebFrame.h +++ b/third_party/WebKit/public/web/WebFrame.h
@@ -35,6 +35,7 @@ #include "WebIconURL.h" #include "WebNode.h" #include "public/platform/WebCanvas.h" +#include "public/platform/WebCommon.h" #include "public/platform/WebFeaturePolicy.h" #include "public/platform/WebInsecureRequestPolicy.h" #include "public/web/WebFrameLoadType.h" @@ -82,7 +83,7 @@ // WebFrame is the base class for both WebLocalFrame and WebRemoteFrame and // contains methods that are valid on both local and remote frames, such as // getting a frame's parent or its opener. -class WebFrame { +class BLINK_EXPORT WebFrame { public: // FIXME: We already have blink::TextGranularity. For now we support only // a part of blink::TextGranularity. @@ -97,14 +98,14 @@ }; // Returns the number of live WebFrame objects, used for leak checking. - BLINK_EXPORT static int InstanceCount(); + static int InstanceCount(); virtual bool IsWebLocalFrame() const = 0; virtual WebLocalFrame* ToWebLocalFrame() = 0; virtual bool IsWebRemoteFrame() const = 0; virtual WebRemoteFrame* ToWebRemoteFrame() = 0; - BLINK_EXPORT bool Swap(WebFrame*); + bool Swap(WebFrame*); // This method closes and deletes the WebFrame. This is typically called by // the embedder in response to a frame detached callback to the WebFrame @@ -113,7 +114,7 @@ // Called by the embedder when it needs to detach the subtree rooted at this // frame. - BLINK_EXPORT void Detach(); + void Detach(); // Basic properties --------------------------------------------------- @@ -126,25 +127,25 @@ virtual void SetName(const WebString&) = 0; // The security origin of this frame. - BLINK_EXPORT WebSecurityOrigin GetSecurityOrigin() const; + WebSecurityOrigin GetSecurityOrigin() const; // Updates the snapshotted policy attributes (sandbox flags and feature policy // container policy) in the frame's FrameOwner. This is used when this frame's // parent is in another process and it dynamically updates this frame's // sandbox flags or container policy. The new policy won't take effect until // the next navigation. - BLINK_EXPORT void SetFrameOwnerPolicy(WebSandboxFlags, - const blink::WebParsedFeaturePolicy&); + void SetFrameOwnerPolicy(WebSandboxFlags, + const blink::WebParsedFeaturePolicy&); // The frame's insecure request policy. - BLINK_EXPORT WebInsecureRequestPolicy GetInsecureRequestPolicy() const; + WebInsecureRequestPolicy GetInsecureRequestPolicy() const; // Updates this frame's FrameOwner properties, such as scrolling, margin, // or allowfullscreen. This is used when this frame's parent is in // another process and it dynamically updates these properties. // TODO(dcheng): Currently, the update only takes effect on next frame // navigation. This matches the in-process frame behavior. - BLINK_EXPORT void SetFrameOwnerProperties(const WebFrameOwnerProperties&); + void SetFrameOwnerProperties(const WebFrameOwnerProperties&); // Geometry ----------------------------------------------------------- @@ -170,7 +171,7 @@ // Whether to collapse the frame's owner element in the embedder document, // that is, to remove it from the layout as if it did not exist. Only works // for <iframe> owner elements. - BLINK_EXPORT void Collapse(bool); + void Collapse(bool); // Hierarchy ---------------------------------------------------------- @@ -178,32 +179,32 @@ virtual WebView* View() const = 0; // Returns the frame that opened this frame or 0 if there is none. - BLINK_EXPORT WebFrame* Opener() const; + WebFrame* Opener() const; // Sets the frame that opened this one or 0 if there is none. - BLINK_EXPORT void SetOpener(WebFrame*); + void SetOpener(WebFrame*); // Reset the frame that opened this frame to 0. // This is executed between layout tests runs - void ClearOpener() { SetOpener(0); } + void ClearOpener(); // Returns the parent frame or 0 if this is a top-most frame. // TODO(sashab): "Virtual" is needed here temporarily to resolve linker errors // in core/. Remove the "virtual" keyword once WebFrame and WebLocalFrameImpl // have been moved to core/. - BLINK_EXPORT virtual WebFrame* Parent() const; + virtual WebFrame* Parent() const; // Returns the top-most frame in the hierarchy containing this frame. - BLINK_EXPORT WebFrame* Top() const; + WebFrame* Top() const; // Returns the first child frame. - BLINK_EXPORT WebFrame* FirstChild() const; + WebFrame* FirstChild() const; // Returns the next sibling frame. - BLINK_EXPORT WebFrame* NextSibling() const; + WebFrame* NextSibling() const; // Returns the next frame in "frame traversal order". - BLINK_EXPORT WebFrame* TraverseNext() const; + WebFrame* TraverseNext() const; // Content ------------------------------------------------------------ @@ -280,7 +281,7 @@ // Returns true if the WebFrame currently executing JavaScript has access // to the given WebFrame, or false otherwise. - BLINK_EXPORT static bool ScriptCanAccess(WebFrame*); + static bool ScriptCanAccess(WebFrame*); // Navigation ---------------------------------------------------------- // TODO(clamy): Remove the reload, reloadWithOverrideURL, and loadRequest @@ -373,12 +374,12 @@ // Returns the frame inside a given frame or iframe element. Returns 0 if // the given element is not a frame, iframe or if the frame is empty. - BLINK_EXPORT static WebFrame* FromFrameOwnerElement(const WebElement&); + static WebFrame* FromFrameOwnerElement(const WebElement&); #if BLINK_IMPLEMENTATION // TODO(mustaq): Should be named FromCoreFrame instead. static WebFrame* FromFrame(Frame*); - BLINK_EXPORT static Frame* ToCoreFrame(const WebFrame&); + static Frame* ToCoreFrame(const WebFrame&); bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; }
diff --git a/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h b/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h index a640e770..3509832 100644 --- a/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h +++ b/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h
@@ -272,12 +272,11 @@ // should delete the callbacks after calling either onSuccess or onError. // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are // passed to the WebServiceWorkerClientsCallbacks implementation. - virtual void OpenWindowForClients( - const WebURL&, - std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; + virtual void OpenNewTab(const WebURL&, + std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; - // Similar like OpenWindowForClients above. - virtual void OpenWindowForPaymentHandler( + // Similar to OpenNewTab above. + virtual void OpenNewPopup( const WebURL&, std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0;
diff --git a/third_party/closure_compiler/externs/automation.js b/third_party/closure_compiler/externs/automation.js index 128d92f..6bcb195c 100644 --- a/third_party/closure_compiler/externs/automation.js +++ b/third_party/closure_compiler/externs/automation.js
@@ -954,6 +954,34 @@ chrome.automation.AutomationNode.prototype.colorValue; /** + * Indicates node text is bold. + * @type {boolean} + * @see https://developer.chrome.com/extensions/automation#type-bold + */ +chrome.automation.AutomationNode.prototype.bold; + +/** + * Indicates node text is italic. + * @type {boolean} + * @see https://developer.chrome.com/extensions/automation#type-italic + */ +chrome.automation.AutomationNode.prototype.italic; + +/** + * Indicates node text is underline. + * @type {boolean} + * @see https://developer.chrome.com/extensions/automation#type-underline + */ +chrome.automation.AutomationNode.prototype.underline; + +/** + * Indicates node text is line through. + * @type {boolean} + * @see https://developer.chrome.com/extensions/automation#type-lineThrough + */ +chrome.automation.AutomationNode.prototype.lineThrough; + +/** * Walking the tree. * @type {!Array<!chrome.automation.AutomationNode>} * @see https://developer.chrome.com/extensions/automation#type-children
diff --git a/tools/clang/move_raw/CMakeLists.txt b/tools/clang/move_raw/CMakeLists.txt new file mode 100644 index 0000000..3375a58 --- /dev/null +++ b/tools/clang/move_raw/CMakeLists.txt
@@ -0,0 +1,28 @@ +set(LLVM_LINK_COMPONENTS + BitReader + MCParser + Option + X86AsmParser + X86CodeGen + ) + +add_llvm_executable(move_raw + MoveRaw.cpp + ) + +target_link_libraries(move_raw + clangAST + clangASTMatchers + clangAnalysis + clangBasic + clangDriver + clangEdit + clangFrontend + clangLex + clangParse + clangSema + clangSerialization + clangTooling + ) + +cr_install(TARGETS move_raw RUNTIME DESTINATION bin)
diff --git a/tools/clang/move_raw/MoveRaw.cpp b/tools/clang/move_raw/MoveRaw.cpp new file mode 100644 index 0000000..516b5075 --- /dev/null +++ b/tools/clang/move_raw/MoveRaw.cpp
@@ -0,0 +1,97 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// Clang tool to find where std::move is called on a raw pointer. +// Calling std::move on a raw pointer has no useful effect and is likely a +// sign of an error (e.g., mistaking a raw pointer for a smart pointer). +// TODO(crbug.com/731577): Make this a clang-tidy check instead. + +#include <memory> +#include <set> +#include <string> + +#include "clang/AST/ASTContext.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/ASTMatchers/ASTMatchersMacros.h" +#include "clang/Basic/SourceManager.h" +#include "clang/Frontend/FrontendActions.h" +#include "clang/Lex/Lexer.h" +#include "clang/Tooling/CommonOptionsParser.h" +#include "clang/Tooling/Refactoring.h" +#include "clang/Tooling/Tooling.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/TargetSelect.h" + +using namespace clang::ast_matchers; +using clang::tooling::CommonOptionsParser; + +namespace { + +class MoveCallCollector : public MatchFinder::MatchCallback { + public: + explicit MoveCallCollector( + std::set<clang::tooling::Replacement>* replacements) + : replacements_(replacements) {} + virtual void run(const MatchFinder::MatchResult& result) override; + + private: + std::set<clang::tooling::Replacement>* const replacements_; +}; + +void MoveCallCollector::run(const MatchFinder::MatchResult& result) { + const clang::Expr* callsite = + result.Nodes.getNodeAs<clang::Expr>("move_call"); + replacements_->insert(clang::tooling::Replacement( + *result.SourceManager, + result.SourceManager->getSpellingLoc(callsite->getLocStart()), 0, + "/*This tries to move a raw pointer!*/")); +} + +} // namespace + +static llvm::cl::extrahelp common_help(CommonOptionsParser::HelpMessage); + +int main(int argc, const char* argv[]) { + // TODO(dcheng): Clang tooling should do this itself. + // https://llvm.org/bugs/show_bug.cgi?id=21627 + llvm::InitializeNativeTarget(); + llvm::InitializeNativeTargetAsmParser(); + llvm::cl::OptionCategory category( + "Catching red flags: calling std::move on raw pointers"); + CommonOptionsParser options(argc, argv, category); + clang::tooling::ClangTool tool(options.getCompilations(), + options.getSourcePathList()); + + MatchFinder match_finder; + std::set<clang::tooling::Replacement> replacements; + + StatementMatcher move_on_raw_matcher = + callExpr(argumentCountIs(1), callee(functionDecl(hasName("::std::move"))), + hasArgument(0, hasType(pointerType()))) + .bind("move_call"); + MoveCallCollector callback(&replacements); + match_finder.addMatcher(move_on_raw_matcher, &callback); + + std::unique_ptr<clang::tooling::FrontendActionFactory> factory = + clang::tooling::newFrontendActionFactory(&match_finder); + int result = tool.run(factory.get()); + if (result != 0) + return result; + + if (replacements.empty()) + return 0; + + // Serialization format is documented in tools/clang/scripts/run_tool.py + llvm::outs() << "==== BEGIN EDITS ====\n"; + for (const auto& r : replacements) { + std::string replacement_text = r.getReplacementText().str(); + std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0'); + llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() + << ":::" << r.getLength() << ":::" << replacement_text << "\n"; + } + llvm::outs() << "==== END EDITS ====\n"; + + return 0; +}
diff --git a/tools/clang/move_raw/tests/test-expected.cc b/tools/clang/move_raw/tests/test-expected.cc new file mode 100644 index 0000000..1432d33a --- /dev/null +++ b/tools/clang/move_raw/tests/test-expected.cc
@@ -0,0 +1,40 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +namespace std { + +// This is the move that should be flagged. Representes the unary std::move. +template <typename T> +T move(T t) { + return t; +} + +// This represents the algorithm std::move, it should not be flagged. +template <class InputIt, class OutputIt> +OutputIt move(InputIt first, InputIt last, OutputIt d_first) { + return d_first; +} + +} // namespace std + +// This represents some non-std move. It should not be flagged. +template <typename T> +T move(T t) { + return t; +} + +void Test() { + int x = 3; + + // Should not be flagged: x is not a pointer. + int y = std::move(x); + + int* p = &x; + + // Calling std::move on a raw pointer should be flagged. + int* q = /*This tries to move a raw pointer!*/ std::move(p); + + // Calling non-std move should not be flagged. + q = move(p); +}
diff --git a/tools/clang/move_raw/tests/test-original.cc b/tools/clang/move_raw/tests/test-original.cc new file mode 100644 index 0000000..0b3b5a7 --- /dev/null +++ b/tools/clang/move_raw/tests/test-original.cc
@@ -0,0 +1,40 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +namespace std { + +// This is the move that should be flagged. Representes the unary std::move. +template <typename T> +T move(T t) { + return t; +} + +// This represents the algorithm std::move, it should not be flagged. +template <class InputIt, class OutputIt> +OutputIt move(InputIt first, InputIt last, OutputIt d_first) { + return d_first; +} + +} // namespace std + +// This represents some non-std move. It should not be flagged. +template <typename T> +T move(T t) { + return t; +} + +void Test() { + int x = 3; + + // Should not be flagged: x is not a pointer. + int y = std::move(x); + + int* p = &x; + + // Calling std::move on a raw pointer should be flagged. + int* q = std::move(p); + + // Calling non-std move should not be flagged. + q = move(p); +}
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 28241ea3..4d914829 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -3457,6 +3457,11 @@ <int value="1" label="Memory low, tabs discarded"/> </enum> +<enum name="BooleanTabDiscardFastShutdown" type="int"> + <int value="0" label="Fast shutdown failed"/> + <int value="1" label="Fast shutdown succeeded"/> +</enum> + <enum name="BooleanTablet" type="int"> <int value="0" label="Non tablet"/> <int value="1" label="Tablet"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 3d4e3da..2947589b 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -49467,6 +49467,16 @@ </histogram> <histogram + name="PageLoad.Experimental.PaintTiming.ForegroundToFirstMeaningfulPaint" + units="ms"> + <owner>ksakamoto@chromium.org</owner> + <summary> + Measures the time from a background tab being switched to the foreground to + the time the first meaningful paint is performed, for main frame documents. + </summary> +</histogram> + +<histogram name="PageLoad.Experimental.PaintTiming.NavigationToFirstMeaningfulPaint" units="ms"> <owner>ksakamoto@chromium.org</owner> @@ -49753,6 +49763,15 @@ </summary> </histogram> +<histogram name="PageLoad.PaintTiming.ForegroundToFirstContentfulPaint" + units="ms"> + <owner>ksakamoto@chromium.org</owner> + <summary> + Measures the time from a background tab being switched to the foreground to + the time the first contentful paint is performed, for main frame documents. + </summary> +</histogram> + <histogram name="PageLoad.PaintTiming.ForegroundToFirstPaint" units="ms"> <owner>pkotwicz@chromium.org</owner> <summary> @@ -67106,16 +67125,18 @@ <owner>horo@chromium.org</owner> <summary> The time taken for the browser to find and possibly start an active worker - to dispatch a FetchEvent for a main frame resource request. For context, a - FetchEvent can only be dispatched to an ACTIVATED worker that is running (it - has been successfully started). The measurements starts when the browser - process receives the request. The browser then finds the worker appropriate - for this request (if there is none, this metric is not recorded). If that - worker is already started, the browser process can send the request to it, - so the measurement ends quickly. Otherwise the browser process has to start - the worker and the measurement ends when the worker is successfully started - (we do not include in the time it takes for the worker to become ACTIVATED). - The metric is not recorded in the following situations: 1) The worker was in + to dispatch a FetchEvent for a main frame resource request. BEWARE: This + metric includes the time taken for redirects. It starts when the URLRequest + is created, and ends when the worker is ready. For context, a FetchEvent can + only be dispatched to an ACTIVATED worker that is running (it has been + successfully started). The measurements starts when the browser process + receives the request. The browser then finds the worker appropriate for this + request (if there is none, this metric is not recorded). If that worker is + already started, the browser process can send the request to it, so the + measurement ends quickly. Otherwise the browser process has to start the + worker and the measurement ends when the worker is successfully started (we + do not include in the time it takes for the worker to become ACTIVATED). The + metric is not recorded in the following situations: 1) The worker was in state INSTALLED or ACTIVATING, and the browser had to wait for it to become ACTIVATED. This is to avoid including the time to execute the activate event handlers in the worker's script. 2) The worker was started for the fetch AND @@ -67557,6 +67578,10 @@ </histogram> <histogram name="ServiceWorker.NavigationPreload.ConcurrentTime" units="ms"> + <obsolete> + Deprecated June 2017 in favor of ServiceWorker.NavPreload.ConcurrentTime, + see https://crbug.com/728035. + </obsolete> <owner>falken@chromium.org</owner> <summary> The duration of time when both (1) a service worker is being found and @@ -67574,6 +67599,10 @@ <histogram name="ServiceWorker.NavigationPreload.FinishedBeforeStartWorker" enum="BooleanNavPreloadFinishedFirst"> + <obsolete> + Deprecated June 2017 in favor of ServiceWorker.NavPreload.FinishedFirst, see + https://crbug.com/728035. + </obsolete> <owner>falken@chromium.org</owner> <summary> Whether the navigation preload response arrived before the activated and @@ -67596,6 +67625,9 @@ <histogram name="ServiceWorker.NavigationPreload.NavPreloadAfterSWStart" units="ms"> + <obsolete> + Deprecated June 2017. No replacement exists. See https://crbug.com/728035. + </obsolete> <owner>falken@chromium.org</owner> <summary> This is recorded in the case where the activated and running service worker @@ -67612,6 +67644,10 @@ </histogram> <histogram name="ServiceWorker.NavigationPreload.ResponseTime" units="ms"> + <obsolete> + Deprecated June 2017 in favor of ServiceWorker.NavPreload.ResponseTime. See + https://crbug.com/728035. + </obsolete> <owner>falken@chromium.org</owner> <summary> The time taken for the navigation preload response to start, i.e., when @@ -67625,6 +67661,10 @@ <histogram name="ServiceWorker.NavigationPreload.SWStartAfterNavPreload" units="ms"> + <obsolete> + Deprecated June 2017 in favor of ServiceWorker.NavPreload.WorkerWaitTime. + See https://crbug.com/728035. + </obsolete> <owner>falken@chromium.org</owner> <summary> This is recorded in the case where the navigation preload response arrived @@ -67639,6 +67679,62 @@ </summary> </histogram> +<histogram name="ServiceWorker.NavPreload.ConcurrentTime" units="ms"> + <owner>falken@chromium.org</owner> + <summary> + The duration of time when both (1) a service worker is being found and + possibly started up, (2) the navigation preload request is in-flight. The + measurement ends once either the worker is prepared, or the navigation + preload response is received (OnReceiveResponse() is called). This is a + rough estimate of the performance win of using navigation preload, ignoring + concurrency overhead. This histogram is recorded when a navigation preload + response is succesfully forwarded to the service worker's fetch event, with + the same restrictions enumerated 1) through 3) for + ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time. The sample is + only recorded to the appropriate suffixed histograms. + </summary> +</histogram> + +<histogram name="ServiceWorker.NavPreload.FinishedFirst" + enum="BooleanNavPreloadFinishedFirst"> + <owner>falken@chromium.org</owner> + <summary> + Whether the navigation preload response arrived before the activated and + running service worker was prepared. This histogram is recorded when a + navigation preload response is succesfully forwarded to the service worker's + fetch event, with the same restrictions numbered 1) through 3) for + ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time. The sample is + only recorded to the appropriate suffixed histograms. + </summary> +</histogram> + +<histogram name="ServiceWorker.NavPreload.ResponseTime" units="ms"> + <owner>falken@chromium.org</owner> + <summary> + The time taken for the navigation preload response to start, i.e., when + OnReceiveResponse() is called. This histogram is recorded when a navigation + preload response is successfully forwarded to the service worker's fetch + event, with the same restrictions numbered 1) through 3) for + ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time. The sample is + only recorded to the appropriate suffixed histograms. + </summary> +</histogram> + +<histogram name="ServiceWorker.NavPreload.WorkerWaitTime" units="ms"> + <owner>falken@chromium.org</owner> + <summary> + This is recorded in the case where the navigation preload response arrived + before the activated and running service worker was prepared. It is the + remaining time it took to prepare the worker after the response arrived. + + This histogram is recorded when a navigation preload response is succesfully + forwarded to the service worker's fetch event (for the case mentioned + above), with the same restrictions numbered 1) through 3) as for + ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time. The sample is + only recorded to the appropriate suffixed histograms. + </summary> +</histogram> + <histogram name="ServiceWorker.NotificationClickEvent.Time" units="ms"> <owner>peter@chromium.org</owner> <summary> @@ -76475,6 +76571,15 @@ </summary> </histogram> +<histogram name="TabManager.Discarding.DiscardedTabCouldFastShutdown" + enum="BooleanTabDiscardFastShutdown"> + <owner>oysteine@chromium.org</owner> + <summary> + Recorded for each discarding, allowing us to know whether the discarded tab + succeeded in doing a render process fast shutdown. + </summary> +</histogram> + <histogram name="TabManager.Discarding.DiscardedTabHasBeforeUnloadHandler" enum="Boolean"> <owner>georgesak@chromium.org</owner> @@ -89324,6 +89429,14 @@ <affected-histogram name="Media.Audio.InputStartupSuccessMac"/> </histogram_suffixes> +<histogram_suffixes name="MainFrameNavigation" separator="_"> + <suffix name="MainFrame" label="Main frame navigation."/> + <affected-histogram name="ServiceWorker.NavPreload.ConcurrentTime"/> + <affected-histogram name="ServiceWorker.NavPreload.FinishedFirst"/> + <affected-histogram name="ServiceWorker.NavPreload.ResponseTime"/> + <affected-histogram name="ServiceWorker.NavPreload.WorkerWaitTime"/> +</histogram_suffixes> + <histogram_suffixes name="ManifestProperties" separator="."> <suffix name="name"/> <suffix name="short_name"/> @@ -89722,6 +89835,9 @@ </histogram_suffixes> <histogram_suffixes name="NavigationPreloadOrWorkerFirst" separator="_"> + <obsolete> + Deprecated as of June 2017. + </obsolete> <suffix name="SWStartFirst" label="The service worker finished preparing before the navigation preload response arrived."/> @@ -92123,6 +92239,24 @@ <affected-histogram name="PageLoad.Experimental.Bytes.Total"/> </histogram_suffixes> +<histogram_suffixes name="PageLoadMetricsClientsNoServiceWorkerSpecialApps" + separator="."> + <suffix name="search" + label="Custom histogram for the Google Search results page."/> + <affected-histogram + name="PageLoad.Clients.NoServiceWorker.DocumentTiming.NavigationToDOMContentLoadedEventFired"/> + <affected-histogram + name="PageLoad.Clients.NoServiceWorker.DocumentTiming.NavigationToLoadEventFired"/> + <affected-histogram + name="PageLoad.Clients.NoServiceWorker.Experimental.PaintTiming.NavigationToFirstMeaningfulPaint"/> + <affected-histogram + name="PageLoad.Clients.NoServiceWorker.Experimental.PaintTiming.ParseStartToFirstMeaningfulPaint"/> + <affected-histogram + name="PageLoad.Clients.NoServiceWorker.PaintTiming.NavigationToFirstContentfulPaint"/> + <affected-histogram + name="PageLoad.Clients.NoServiceWorker.PaintTiming.ParseStartToFirstContentfulPaint"/> +</histogram_suffixes> + <histogram_suffixes name="PageLoadMetricsClientsOfflinePages" separator="." ordering="prefix"> <suffix name="Clients.Previews.OfflinePages" @@ -92210,6 +92344,10 @@ <suffix name="Clients.ServiceWorker" label="PageLoadMetrics from a page that is controlled by a Service Worker"/> + <suffix name="Clients.NoServiceWorker" + label="PageLoadMetrics from a page that is not controlled by a Service + Worker. This is intended to understand the performance impact of + service workers on special apps using Clients.ServiceWorker"/> <affected-histogram name="PageLoad.DocumentTiming.NavigationToDOMContentLoadedEventFired"/> <affected-histogram @@ -92233,7 +92371,8 @@ <histogram_suffixes name="PageLoadMetricsClientsServiceWorkerSpecialApps" separator="."> <suffix name="inbox" label="Custom histogram for Inbox"/> - <suffix name="search" label="Custom histogram for Search"/> + <suffix name="search" + label="Custom histogram for the Google Search results page"/> <affected-histogram name="PageLoad.Clients.ServiceWorker.DocumentTiming.NavigationToDOMContentLoadedEventFired"/> <affected-histogram @@ -94742,6 +94881,9 @@ </histogram_suffixes> <histogram_suffixes name="StartWorkerExistingProcess" separator="_"> + <obsolete> + Deprecated as of June 2017. + </obsolete> <suffix name="StartWorkerExistingProcess" label="The worker started up in an existing process"/> <affected-histogram name="ServiceWorker.NavigationPreload.ConcurrentTime"/> @@ -94757,6 +94899,15 @@ name="ServiceWorker.NavigationPreload.SWStartAfterNavPreload"/> </histogram_suffixes> +<histogram_suffixes name="StartWorkerExistingProcess2" separator="_"> + <suffix name="StartWorkerExistingProcess" + label="The worker started up in an existing process"/> + <affected-histogram name="ServiceWorker.NavPreload.ConcurrentTime_MainFrame"/> + <affected-histogram name="ServiceWorker.NavPreload.FinishedFirst_MainFrame"/> + <affected-histogram name="ServiceWorker.NavPreload.ResponseTime_MainFrame"/> + <affected-histogram name="ServiceWorker.NavPreload.WorkerWaitTime_MainFrame"/> +</histogram_suffixes> + <histogram_suffixes name="Storage.BlobAppendableItems" separator="."> <suffix name="Bytes" label="Appending bytes."/> <suffix name="File" label="Appending a file with a known size."/>
diff --git a/tools/variations/fieldtrial_util.py b/tools/variations/fieldtrial_util.py index 74de88e..8fea8fb 100644 --- a/tools/variations/fieldtrial_util.py +++ b/tools/variations/fieldtrial_util.py
@@ -103,7 +103,10 @@ def main(): if len(sys.argv) < 3: print 'Usage: fieldtrial_util.py [config_path] [platform]' + print 'Optionally pass \'shell_cmd\' as an extra argument to print' + print 'quoted command line arguments.' exit(-1) + print_shell_cmd = len(sys.argv) >= 4 and sys.argv[3] == 'shell_cmd' supported_platforms = ['android', 'chromeos', 'ios', 'linux', 'mac', 'win'] if sys.argv[2] not in supported_platforms: @@ -111,7 +114,11 @@ (sys.argv[2], supported_platforms)) exit(-1) - print GenerateArgs(sys.argv[1], sys.argv[2]) + generated_args = GenerateArgs(sys.argv[1], sys.argv[2]) + if print_shell_cmd: + print " ".join(map((lambda arg: '"{0}"'.format(arg)), generated_args)) + else: + print generated_args if __name__ == '__main__': main()
diff --git a/ui/base/ime/input_method_auralinux.h b/ui/base/ime/input_method_auralinux.h index 00f92c6..85dcd77 100644 --- a/ui/base/ime/input_method_auralinux.h +++ b/ui/base/ime/input_method_auralinux.h
@@ -39,7 +39,7 @@ void OnCommit(const base::string16& text) override; void OnPreeditChanged(const CompositionText& composition_text) override; void OnPreeditEnd() override; - void OnPreeditStart() override{}; + void OnPreeditStart() override {} protected: // Overridden from InputMethodBase.
diff --git a/ui/base/ime/input_method_auralinux_unittest.cc b/ui/base/ime/input_method_auralinux_unittest.cc index 2f8e215..7424f5f 100644 --- a/ui/base/ime/input_method_auralinux_unittest.cc +++ b/ui/base/ime/input_method_auralinux_unittest.cc
@@ -154,8 +154,8 @@ class InputMethodDelegateForTesting : public internal::InputMethodDelegate { public: - InputMethodDelegateForTesting(){}; - ~InputMethodDelegateForTesting() override{}; + InputMethodDelegateForTesting() {} + ~InputMethodDelegateForTesting() override {} ui::EventDispatchDetails DispatchKeyEventPostIME( ui::KeyEvent* key_event) override {
diff --git a/ui/base/l10n/l10n_util_mac.h b/ui/base/l10n/l10n_util_mac.h index 6521797..9d7c42e 100644 --- a/ui/base/l10n/l10n_util_mac.h +++ b/ui/base/l10n/l10n_util_mac.h
@@ -54,6 +54,12 @@ const base::string16& b, const base::string16& c, const base::string16& d); +UI_BASE_EXPORT NSString* GetNSStringF(int message_id, + const base::string16& a, + const base::string16& b, + const base::string16& c, + const base::string16& d, + const base::string16& e); // Variants that return the offset(s) of the replaced parameters. (See // app/l10n_util.h for more details.)
diff --git a/ui/base/l10n/l10n_util_mac.mm b/ui/base/l10n/l10n_util_mac.mm index eee461f0..6347acb9 100644 --- a/ui/base/l10n/l10n_util_mac.mm +++ b/ui/base/l10n/l10n_util_mac.mm
@@ -159,6 +159,16 @@ NSString* GetNSStringF(int message_id, const base::string16& a, const base::string16& b, + const base::string16& c, + const base::string16& d, + const base::string16& e) { + return base::SysUTF16ToNSString( + l10n_util::GetStringFUTF16(message_id, a, b, c, d, e)); +} + +NSString* GetNSStringF(int message_id, + const base::string16& a, + const base::string16& b, std::vector<size_t>* offsets) { return base::SysUTF16ToNSString(l10n_util::GetStringFUTF16(message_id, a, b, offsets));
diff --git a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc index 72dc025..92d7c85 100644 --- a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc +++ b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc
@@ -115,7 +115,7 @@ CursorDelegateEvdev* cursor, const EventDeviceInfo& devinfo, DeviceEventDispatcherEvdev* dispatcher); - ~MockTabletEventConverterEvdev() override {}; + ~MockTabletEventConverterEvdev() override {} void ConfigureReadMock(struct input_event* queue, long read_this_many,
diff --git a/ui/file_manager/file_manager/background/js/device_handler_unittest.html b/ui/file_manager/file_manager/background/js/device_handler_unittest.html index 6ba64e1f..fb223a6 100644 --- a/ui/file_manager/file_manager/background/js/device_handler_unittest.html +++ b/ui/file_manager/file_manager/background/js/device_handler_unittest.html
@@ -7,6 +7,7 @@ <html> <body> +<script src="../../../../../ui/webui/resources/js/assert.js"></script> <script src="../../../../../ui/webui/resources/js/cr.js"></script> <script src="../../../../../ui/webui/resources/js/cr/event_target.js"></script> <script src="../../../../../ui/webui/resources/js/cr/ui/array_data_model.js"></script>
diff --git a/ui/file_manager/file_manager/background/js/file_operation_handler_unittest.html b/ui/file_manager/file_manager/background/js/file_operation_handler_unittest.html index 0dd960c3..a009f22 100644 --- a/ui/file_manager/file_manager/background/js/file_operation_handler_unittest.html +++ b/ui/file_manager/file_manager/background/js/file_operation_handler_unittest.html
@@ -7,6 +7,7 @@ <html> <body> +<script src="../../../../../ui/webui/resources/js/assert.js"></script> <script src="../../../../../ui/webui/resources/js/cr.js"></script> <script src="../../../../../ui/webui/resources/js/cr/event_target.js"></script> <script src="../../../../../ui/webui/resources/js/load_time_data.js"></script>
diff --git a/ui/file_manager/file_manager/foreground/js/progress_center_item_group_unittest.html b/ui/file_manager/file_manager/foreground/js/progress_center_item_group_unittest.html index b029763e..3cd056d 100644 --- a/ui/file_manager/file_manager/foreground/js/progress_center_item_group_unittest.html +++ b/ui/file_manager/file_manager/foreground/js/progress_center_item_group_unittest.html
@@ -6,6 +6,7 @@ <html> <body> +<script src="../../../../webui/resources/js/assert.js"></script> <script src="../../../../webui/resources/js/cr.js"></script> <script src="../../../../webui/resources/js/cr/event_target.js"></script> <script src="../../../../webui/resources/js/load_time_data.js"></script>
diff --git a/ui/file_manager/file_manager/foreground/js/task_controller.js b/ui/file_manager/file_manager/foreground/js/task_controller.js index 8126570..c7457d1 100644 --- a/ui/file_manager/file_manager/foreground/js/task_controller.js +++ b/ui/file_manager/file_manager/foreground/js/task_controller.js
@@ -90,6 +90,11 @@ */ this.tasks_ = null; + /** + * @private {!Array<!Entry>} + */ + this.lastSelectedEntries_ = []; + ui.taskMenuButton.addEventListener( 'select', this.onTaskItemClicked_.bind(this)); this.selectionHandler_.addEventListener( @@ -267,14 +272,18 @@ // FileSelectionHandler.EventType.CHANGE if (this.dialogType_ === DialogType.FULL_PAGE && (selection.directoryCount > 0 || selection.fileCount > 0)) { - // Show disabled items for position calculation of the menu. They will be - // overridden in this.updateFileSelectionAsync(). - this.updateContextMenuTaskItems_( - [TaskController.createTemporaryDisabledTaskItem_()]); + // Compare entries while ignoring changes inside directories. + if (!util.isSameEntries(this.lastSelectedEntries_, selection.entries)) { + // Show disabled items for position calculation of the menu. They will be + // overridden in this.updateTasks_(). + this.updateContextMenuTaskItems_( + [TaskController.createTemporaryDisabledTaskItem_()]); + } } else { // Update context menu. this.updateContextMenuTaskItems_([]); } + this.lastSelectedEntries_ = selection.entries; }; /**
diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc index a5a02c8..8a3c096 100644 --- a/ui/keyboard/keyboard_controller_unittest.cc +++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -140,7 +140,7 @@ } ui::InputMethod* GetInputMethod() override { return input_method_; } void SetUpdateInputType(ui::TextInputType type) override {} - void ReloadKeyboardIfNeeded() override {}; + void ReloadKeyboardIfNeeded() override {} void InitInsets(const gfx::Rect& keyboard_bounds) override {} void ResetInsets() override {}
diff --git a/ui/views/controls/combobox/combobox_unittest.cc b/ui/views/controls/combobox/combobox_unittest.cc index c2f6085..31a0c15 100644 --- a/ui/views/controls/combobox/combobox_unittest.cc +++ b/ui/views/controls/combobox/combobox_unittest.cc
@@ -137,7 +137,7 @@ class EvilListener : public ComboboxListener { public: EvilListener() : deleted_(false) {} - ~EvilListener() override{}; + ~EvilListener() override {} // ComboboxListener: void OnPerformAction(Combobox* combobox) override {
diff --git a/ui/views/controls/menu/menu_runner_unittest.cc b/ui/views/controls/menu/menu_runner_unittest.cc index 7c40fe9..2ad600a 100644 --- a/ui/views/controls/menu/menu_runner_unittest.cc +++ b/ui/views/controls/menu/menu_runner_unittest.cc
@@ -33,7 +33,7 @@ class DeletingTestViewsDelegate : public views::TestViewsDelegate { public: DeletingTestViewsDelegate() : menu_runner_(nullptr) {} - ~DeletingTestViewsDelegate() override{}; + ~DeletingTestViewsDelegate() override {} void set_menu_runner(views::internal::MenuRunnerImpl* menu_runner) { menu_runner_ = menu_runner;
diff --git a/ui/webui/resources/html/load_time_data.html b/ui/webui/resources/html/load_time_data.html index cc650cd..627fdf9 100644 --- a/ui/webui/resources/html/load_time_data.html +++ b/ui/webui/resources/html/load_time_data.html
@@ -1 +1,2 @@ +<script src="chrome://resources/js/assert.js"></script> <script src="chrome://resources/js/load_time_data.js"></script>
diff --git a/ui/webui/resources/js/compiled_resources2.gyp b/ui/webui/resources/js/compiled_resources2.gyp index 1316c15..5f710c3 100644 --- a/ui/webui/resources/js/compiled_resources2.gyp +++ b/ui/webui/resources/js/compiled_resources2.gyp
@@ -56,7 +56,10 @@ }, { 'target_name': 'load_time_data', - 'dependencies': ['<(DEPTH)/third_party/jstemplate/compiled_resources2.gyp:jstemplate'], + 'dependencies': [ + '<(DEPTH)/third_party/jstemplate/compiled_resources2.gyp:jstemplate', + 'assert' + ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, {
diff --git a/ui/webui/resources/js/load_time_data.js b/ui/webui/resources/js/load_time_data.js index 38b4721e..3282b68 100644 --- a/ui/webui/resources/js/load_time_data.js +++ b/ui/webui/resources/js/load_time_data.js
@@ -87,13 +87,63 @@ if (!value) return ''; + var args = Array.prototype.slice.call(arguments); + args[0] = value; + return this.substituteString.apply(this, args); + }, + + /** + * Returns a formatted localized string where $1 to $9 are replaced by the + * second to the tenth argument. Any standalone $ signs must be escaped as + * $$. + * @param {string} label The label to substitute through. + * This is not an resource ID. + * @param {...(string|number)} var_args The extra values to include in the + * formatted output. + * @return {string} The formatted string. + */ + substituteString: function(label, var_args) { var varArgs = arguments; - return value.replace(/\$[$1-9]/g, function(m) { + return label.replace(/\$(.|$|\n)/g, function(m) { + assert(m.match(/\$[$1-9]/), 'Unescaped $ found in localized string.'); return m == '$$' ? '$' : varArgs[m[1]]; }); }, /** + * Returns a formatted string where $1 to $9 are replaced by the second to + * tenth argument, split apart into a list of pieces describing how the + * substitution was performed. Any standalone $ signs must be escaped as $$. + * @param {string} label A localized string to substitute through. + * This is not an resource ID. + * @param {...(string|number)} var_args The extra values to include in the + * formatted output. + * @return {!Array<!{value: string, arg: (null|string)}>} The formatted + * string pieces. + */ + getSubstitutedStringPieces: function(label, var_args) { + var varArgs = arguments; + // Split the string by separately matching all occurrences of $1-9 and of + // non $1-9 pieces. + var pieces = (label.match(/(\$[1-9])|(([^$]|\$([^1-9]|$))+)/g) || + []).map(function(p) { + // Pieces that are not $1-9 should be returned after replacing $$ + // with $. + if (!p.match(/^\$[1-9]$/)) { + assert( + (p.match(/\$/g) || []).length % 2 == 0, + 'Unescaped $ found in localized string.'); + return {value: p.replace(/\$\$/g, '$'), arg: null}; + } + + // Otherwise, return the substitution value. + return {value: varArgs[p[1]], arg: p}; + }); + + return pieces; + }, + + /** * As above, but also makes sure that the value is a boolean. * @param {string} id The key that identifies the desired boolean. * @return {boolean} The corresponding boolean value.
diff --git a/ui/webui/resources/webui_resources.grd b/ui/webui/resources/webui_resources.grd index 346e256e..9aaf327 100644 --- a/ui/webui/resources/webui_resources.grd +++ b/ui/webui/resources/webui_resources.grd
@@ -18,7 +18,7 @@ <include name="IDR_WEBUI_ANALYTICS_JS" file="js/analytics.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_WEBUI_MOJO_BINDINGS_JS" file="${root_gen_dir}\mojo\public\js\mojo_bindings.js" - flattenhtml="true" type="BINDATA" use_base_dir="false" /> + flattenhtml="true" type="BINDATA" use_base_dir="false" compress="gzip" /> <!-- Roboto Font. Roboto-Regular and Roboto-Light is already available on Android, and Roboto-Medium is not used on Android. All 6 weights of Roboto are available on Chrome OS.-->