diff --git a/DEPS b/DEPS index 61496b2..0b94e37 100644 --- a/DEPS +++ b/DEPS
@@ -133,11 +133,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'f0ced62f913f99e5fc0805e283dd8e49ff7d6880', + 'skia_revision': 'c6568afa0b634d47596557960ccf756962b9aab3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '9eb5d77ec8d2d0de8a192e4917c853ce8f3c9514', + 'v8_revision': '8e003ab0c8aac7afc5c48931fa6f8ed667942621', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -145,15 +145,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '60cc751a8db16f257f869884042dd63ead0ec356', + 'angle_revision': '04e389d154819234ae1d4abb92102ebdffa8de8c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': '3ff0e8c51451dbb5b3da7df1952b27287af75af5', + 'swiftshader_revision': '6cf65f671c1d62283819253b7d03d37134ed22fa', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '0a79453af68f705c02c02040f2ea8ffe3d5ec7ee', + 'pdfium_revision': '31136552bc0ca1848addede014d518a5ef6be646', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -196,7 +196,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '89ec6c772dbe1f6069051fb4210b31b5376324bf', + 'catapult_revision': '72ee2533b189d865435d3d712fdd15a72a61491e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -1177,7 +1177,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '10c98fe0cfae669f71610d97e9da94260a6da173', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '7cac1ef36965995c9e4c4bc5f924934548fd1ecb', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + 'ac0d98b5cee6c024b0cffeb4f8f45b6fc5ccdb78', @@ -1345,7 +1345,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '6f0b34abee8dba611c253738d955c59f703c147a', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'f2047874785a18bc2653ea8ab119945142f49ac2', + Var('webrtc_git') + '/src.git' + '@' + 'f0792ce4107c5eca12fff033ee6f16d37e69033a', 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -1386,7 +1386,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@ec4b448207cd7788876c96c965530014e2814604', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@6901330cf32ab3d5cb308c808fd84e340973ed81', 'condition': 'checkout_src_internal', },
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 279ae36b..8a635b8 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -767,6 +767,20 @@ True, (), ), + ( + 'mojo::ConvertTo', + ( + 'mojo::ConvertTo and TypeConverter are deprecated. Please consider', + 'StructTraits / UnionTraits / EnumTraits / ArrayTraits / MapTraits /', + 'StringTraits if you would like to convert between custom types and', + 'the wire format of mojom types.' + ), + True, + ( + r'^third_party/blink/.*\.(cc|h)$', + r'^content/renderer/.*\.(cc|h)$', + ), + ), )
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index 970cc30..ca56b809 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py
@@ -1926,17 +1926,26 @@ input_api.files = [ MockFile('some/cpp/problematic/file.cc', ['mojo::DataPipe();']), + MockFile('some/cpp/problematic/file2.cc', + ['mojo::ConvertTo<>']), MockFile('some/cpp/ok/file.cc', ['CreateDataPipe();']), MockFile('some/cpp/ok/file2.cc', ['mojo::DataPipeDrainer();']), + MockFile('third_party/blink/ok/file3.cc', + ['mojo::ConvertTo<>']), + MockFile('content/renderer/ok/file3.cc', + ['mojo::ConvertTo<>']), ] errors = PRESUBMIT._CheckNoBannedFunctions(input_api, MockOutputApi()) self.assertEqual(1, len(errors)) self.assertTrue('some/cpp/problematic/file.cc' in errors[0].message) + self.assertTrue('some/cpp/problematic/file2.cc' in errors[0].message) self.assertTrue('some/cpp/ok/file.cc' not in errors[0].message) self.assertTrue('some/cpp/ok/file2.cc' not in errors[0].message) + self.assertTrue('third_party/blink/ok/file3.cc' not in errors[0].message) + self.assertTrue('content/renderer/ok/file3.cc' not in errors[0].message) class NoProductionCodeUsingTestOnlyFunctionsTest(unittest.TestCase):
diff --git a/android_webview/browser/aw_autofill_client.cc b/android_webview/browser/aw_autofill_client.cc index 9b4c32bc..2253222 100644 --- a/android_webview/browser/aw_autofill_client.cc +++ b/android_webview/browser/aw_autofill_client.cc
@@ -53,13 +53,13 @@ autofill::AutocompleteHistoryManager* AwAutofillClient::GetAutocompleteHistoryManager() { - return AwContentBrowserClient::GetAwBrowserContext() + return AwBrowserContext::FromWebContents(web_contents_) ->GetAutocompleteHistoryManager(); } PrefService* AwAutofillClient::GetPrefs() { return user_prefs::UserPrefs::Get( - AwContentBrowserClient::GetAwBrowserContext()); + AwBrowserContext::FromWebContents(web_contents_)); } syncer::SyncService* AwAutofillClient::GetSyncService() {
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 33a25b4..c77b05b 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -259,11 +259,6 @@ } // static -AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { - return AwBrowserContext::GetDefault(); -} - -// static void AwContentBrowserClient::set_check_cleartext_permitted(bool permitted) { #if DCHECK_IS_ON() DCHECK(!g_created_network_context_params); @@ -964,15 +959,16 @@ int render_process_id, int render_frame_id, NonNetworkURLLoaderFactoryMap* factories) { - AwSettings* aw_settings = - AwSettings::FromWebContents(content::WebContents::FromRenderFrameHost( - content::RenderFrameHost::FromID(render_process_id, - render_frame_id))); + WebContents* web_contents = content::WebContents::FromRenderFrameHost( + content::RenderFrameHost::FromID(render_process_id, render_frame_id)); + AwSettings* aw_settings = AwSettings::FromWebContents(web_contents); if (aw_settings && aw_settings->GetAllowFileAccess()) { + AwBrowserContext* aw_browser_context = + AwBrowserContext::FromWebContents(web_contents); auto file_factory = CreateFileURLLoaderFactory( - AwBrowserContext::GetDefault()->GetPath(), - AwBrowserContext::GetDefault()->GetSharedCorsOriginAccessList()); + aw_browser_context->GetPath(), + aw_browser_context->GetSharedCorsOriginAccessList()); factories->emplace(url::kFileScheme, std::move(file_factory)); } }
diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h index 30da0a0..aa34c17a 100644 --- a/android_webview/browser/aw_content_browser_client.h +++ b/android_webview/browser/aw_content_browser_client.h
@@ -42,9 +42,6 @@ // This is what AwContentBrowserClient::GetAcceptLangs uses. static std::string GetAcceptLangsImpl(); - // Deprecated: use AwBrowserContext::GetDefault() instead. - static AwBrowserContext* GetAwBrowserContext(); - // Sets whether the net stack should check the cleartext policy from the // platform. For details, see // https://developer.android.com/reference/android/security/NetworkSecurityPolicy.html#isCleartextTrafficPermitted().
diff --git a/android_webview/browser/aw_form_database.cc b/android_webview/browser/aw_form_database.cc index 4c1a67521..c751fd2 100644 --- a/android_webview/browser/aw_form_database.cc +++ b/android_webview/browser/aw_form_database.cc
@@ -17,7 +17,7 @@ namespace { AwFormDatabaseService* GetFormDatabaseService() { - AwBrowserContext* context = AwContentBrowserClient::GetAwBrowserContext(); + AwBrowserContext* context = AwBrowserContext::GetDefault(); AwFormDatabaseService* service = context->GetFormDatabaseService(); return service; }
diff --git a/android_webview/browser/aw_quota_manager_bridge.cc b/android_webview/browser/aw_quota_manager_bridge.cc index dde9606..9ea0175 100644 --- a/android_webview/browser/aw_quota_manager_bridge.cc +++ b/android_webview/browser/aw_quota_manager_bridge.cc
@@ -156,8 +156,7 @@ // static jlong JNI_AwQuotaManagerBridge_GetDefaultNativeAwQuotaManagerBridge( JNIEnv* env) { - AwBrowserContext* browser_context = - AwContentBrowserClient::GetAwBrowserContext(); + AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); AwQuotaManagerBridge* bridge = static_cast<AwQuotaManagerBridge*>( browser_context->GetQuotaManagerBridge());
diff --git a/android_webview/browser/gfx/browser_view_renderer.cc b/android_webview/browser/gfx/browser_view_renderer.cc index bf71fa0..38d599a 100644 --- a/android_webview/browser/gfx/browser_view_renderer.cc +++ b/android_webview/browser/gfx/browser_view_renderer.cc
@@ -149,16 +149,30 @@ ReleaseHardware(); } -void BrowserViewRenderer::UpdateMemoryPolicy() { +gfx::Rect BrowserViewRenderer::ComputeTileRectAndUpdateMemoryPolicy() { if (!compositor_) { - return; + return gfx::Rect(); } if (!hardware_enabled_) { compositor_->SetMemoryPolicy(0u); - return; + return gfx::Rect(); } + gfx::Transform transform_for_tile_priority = + external_draw_constraints_.transform; + + gfx::Rect viewport_rect_for_tile_priority_in_view_space; + gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); + if (transform_for_tile_priority.GetInverse(&screen_to_view)) { + // Convert from screen space to view space. + viewport_rect_for_tile_priority_in_view_space = + cc::MathUtil::ProjectEnclosingClippedRect( + screen_to_view, + gfx::Rect(external_draw_constraints_.viewport_size)); + } + viewport_rect_for_tile_priority_in_view_space.Intersect(gfx::Rect(size_)); + size_t bytes_limit = 0u; if (g_memory_override_in_bytes) { bytes_limit = static_cast<size_t>(g_memory_override_in_bytes); @@ -166,9 +180,25 @@ // Note we are using |last_on_draw_global_visible_rect_| rather than // |external_draw_constraints_.viewport_size|. This is to reduce budget // for a webview that's much smaller than the surface it's rendering. - gfx::Rect interest_rect = offscreen_pre_raster_ - ? gfx::Rect(size_) - : last_on_draw_global_visible_rect_; + gfx::Rect interest_rect; + if (offscreen_pre_raster_) { + interest_rect = gfx::Rect(size_); + } else { + // Re-compute screen-space rect for computing tile budget, since tile is + // rastered in screen space. + gfx::Rect viewport_rect_for_tile_priority_in_screen_space = + cc::MathUtil::ProjectEnclosingClippedRect( + transform_for_tile_priority, + viewport_rect_for_tile_priority_in_view_space); + // Intersect by viewport size again, in case axis-aligning operations made + // the rect bigger than necessary. + viewport_rect_for_tile_priority_in_screen_space.Intersect( + gfx::Rect(external_draw_constraints_.viewport_size)); + interest_rect = viewport_rect_for_tile_priority_in_screen_space.IsEmpty() + ? last_on_draw_global_visible_rect_ + : viewport_rect_for_tile_priority_in_screen_space; + } + size_t width = interest_rect.width(); size_t height = interest_rect.height(); bytes_limit = kMemoryMultiplier * kBytesPerPixel * width * height; @@ -178,6 +208,7 @@ } compositor_->SetMemoryPolicy(bytes_limit); + return viewport_rect_for_tile_priority_in_view_space; } content::SynchronousCompositor* BrowserViewRenderer::FindCompositor( @@ -223,25 +254,12 @@ hardware_enabled_ = true; DoUpdateParentDrawData(); - UpdateMemoryPolicy(); - - gfx::Transform transform_for_tile_priority = - external_draw_constraints_.transform; - // Do not override (ie leave empty) for offscreen raster. gfx::Size viewport_size_for_tile_priority = offscreen_pre_raster_ ? gfx::Size() : external_draw_constraints_.viewport_size; - - gfx::Rect viewport_rect_for_tile_priority_in_view_space; - gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); - if (transform_for_tile_priority.GetInverse(&screen_to_view)) { - // Convert from screen space to view space. - viewport_rect_for_tile_priority_in_view_space = - cc::MathUtil::ProjectEnclosingClippedRect( - screen_to_view, gfx::Rect(viewport_size_for_tile_priority)); - } - viewport_rect_for_tile_priority_in_view_space.Intersect(gfx::Rect(size_)); + gfx::Rect viewport_rect_for_tile_priority_in_view_space = + ComputeTileRectAndUpdateMemoryPolicy(); // Explanation for the various viewports and transforms. There are: // * "default" viewport" (and identity transform) that's normally used by @@ -266,7 +284,7 @@ scoped_refptr<content::SynchronousCompositor::FrameFuture> future = compositor_->DemandDrawHwAsync( size_, viewport_rect_for_tile_priority_in_view_space, - transform_for_tile_priority); + external_draw_constraints_.transform); CopyOutputRequestQueue requests; copy_requests_.swap(requests); for (auto& copy_request_ptr : requests) { @@ -275,7 +293,8 @@ } std::unique_ptr<ChildFrame> child_frame = std::make_unique<ChildFrame>( std::move(future), compositor_id_, viewport_size_for_tile_priority, - transform_for_tile_priority, offscreen_pre_raster_, std::move(requests)); + external_draw_constraints_.transform, offscreen_pre_raster_, + std::move(requests)); ReturnUnusedResource( current_compositor_frame_consumer_->SetFrameOnUI(std::move(child_frame))); @@ -290,7 +309,7 @@ if (!DoUpdateParentDrawData()) return; PostInvalidate(compositor_); - UpdateMemoryPolicy(); + ComputeTileRectAndUpdateMemoryPolicy(); } bool BrowserViewRenderer::DoUpdateParentDrawData() { @@ -412,7 +431,7 @@ void BrowserViewRenderer::SetOffscreenPreRaster(bool enable) { if (offscreen_pre_raster_ != enable) { offscreen_pre_raster_ = enable; - UpdateMemoryPolicy(); + ComputeTileRectAndUpdateMemoryPolicy(); } } @@ -453,7 +472,7 @@ height); size_.SetSize(width, height); if (offscreen_pre_raster_) - UpdateMemoryPolicy(); + ComputeTileRectAndUpdateMemoryPolicy(); } void BrowserViewRenderer::OnAttachedToWindow(int width, int height) { @@ -468,7 +487,7 @@ size_.SetSize(width, height); if (offscreen_pre_raster_) - UpdateMemoryPolicy(); + ComputeTileRectAndUpdateMemoryPolicy(); } void BrowserViewRenderer::OnDetachedFromWindow() { @@ -498,7 +517,7 @@ } hardware_enabled_ = false; has_rendered_frame_ = false; - UpdateMemoryPolicy(); + ComputeTileRectAndUpdateMemoryPolicy(); } bool BrowserViewRenderer::IsVisible() const { @@ -574,7 +593,7 @@ compositor_ = compositor; copy_requests_.clear(); if (compositor_) { - UpdateMemoryPolicy(); + ComputeTileRectAndUpdateMemoryPolicy(); compositor_->DidBecomeActive(); } }
diff --git a/android_webview/browser/gfx/browser_view_renderer.h b/android_webview/browser/gfx/browser_view_renderer.h index 506c9c7..9b0c619 100644 --- a/android_webview/browser/gfx/browser_view_renderer.h +++ b/android_webview/browser/gfx/browser_view_renderer.h
@@ -186,7 +186,8 @@ gfx::Vector2d max_scroll_offset() const; - void UpdateMemoryPolicy(); + // Return the tile rect in view space. + gfx::Rect ComputeTileRectAndUpdateMemoryPolicy(); content::SynchronousCompositor* FindCompositor( const CompositorID& compositor_id) const;
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc index c5baee3..505c868 100644 --- a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc +++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
@@ -159,7 +159,8 @@ content::RenderFrameHost* frame_host) { registry_.AddInterface(base::BindRepeating( &web_restrictions::WebRestrictionsMojoImplementation::Create, - AwBrowserContext::GetDefault()->GetWebRestrictionProvider())); + AwBrowserContext::FromWebContents(web_contents()) + ->GetWebRestrictionProvider())); if (!frame_host->GetParent()) { frame_host->Send(new AwViewMsg_SetBackgroundColor( frame_host->GetRoutingID(), background_color_));
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 9aaab474..584ce69 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -231,8 +231,6 @@ "display/display_error_observer.h", "display/display_move_window_util.cc", "display/display_move_window_util.h", - "display/display_output_protection.cc", - "display/display_output_protection.h", "display/display_prefs.cc", "display/display_shutdown_observer.cc", "display/display_shutdown_observer.h", @@ -1856,6 +1854,7 @@ "wm/overview/cleanup_animation_observer_unittest.cc", "wm/overview/delayed_animation_observer_impl_unittest.cc", "wm/overview/overview_controller_unittest.cc", + "wm/overview/overview_grid_unittest.cc", "wm/overview/overview_session_unittest.cc", "wm/overview/scoped_overview_transform_window_unittest.cc", "wm/pip/pip_positioner_unittest.cc",
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index a7273995..cc22f138 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -143,8 +143,10 @@ shell->voice_interaction_controller()->AddLocalObserver(this); shell->window_tree_host_manager()->AddObserver(this); shell->mru_window_tracker()->AddObserver(this); - if (app_list_features::IsEmbeddedAssistantUIEnabled()) + if (app_list_features::IsEmbeddedAssistantUIEnabled()) { + shell->assistant_controller()->AddObserver(this); shell->assistant_controller()->ui_controller()->AddModelObserver(this); + } shell->home_screen_controller()->home_launcher_gesture_handler()->AddObserver( this); } @@ -676,6 +678,10 @@ UpdateExpandArrowVisibility(); } +void AppListControllerImpl::OnAssistantReady() { + UpdateAssistantVisibility(); +} + void AppListControllerImpl::OnUiVisibilityChanged( AssistantVisibility new_visibility, AssistantVisibility old_visibility, @@ -941,7 +947,7 @@ "search results (ie. search results in the search result page) not " "chips."; app_list::RecordSearchResultOpenTypeHistogram( - app_list::ASSISTANT_OMNIBOX_RESULT, IsTabletMode()); + launched_from, app_list::ASSISTANT_OMNIBOX_RESULT, IsTabletMode()); Shell::Get()->assistant_controller()->ui_controller()->ShowUi( AssistantEntryPoint::kLauncherSearchResult); Shell::Get()->assistant_controller()->OpenUrl( @@ -1381,8 +1387,10 @@ shell->home_screen_controller() ->home_launcher_gesture_handler() ->RemoveObserver(this); - if (app_list_features::IsEmbeddedAssistantUIEnabled()) + if (app_list_features::IsEmbeddedAssistantUIEnabled()) { + shell->assistant_controller()->RemoveObserver(this); shell->assistant_controller()->ui_controller()->RemoveModelObserver(this); + } shell->mru_window_tracker()->RemoveObserver(this); shell->window_tree_host_manager()->RemoveObserver(this); shell->voice_interaction_controller()->RemoveLocalObserver(this);
diff --git a/ash/app_list/app_list_controller_impl.h b/ash/app_list/app_list_controller_impl.h index 8c6e478..e56de73 100644 --- a/ash/app_list/app_list_controller_impl.h +++ b/ash/app_list/app_list_controller_impl.h
@@ -16,6 +16,7 @@ #include "ash/app_list/model/search/search_model.h" #include "ash/app_list/presenter/app_list_presenter_impl.h" #include "ash/ash_export.h" +#include "ash/assistant/assistant_controller_observer.h" #include "ash/assistant/model/assistant_ui_model_observer.h" #include "ash/display/window_tree_host_manager.h" #include "ash/home_screen/home_launcher_gesture_handler_observer.h" @@ -63,6 +64,7 @@ public DefaultVoiceInteractionObserver, public WindowTreeHostManager::Observer, public ash::MruWindowTracker::Observer, + public AssistantControllerObserver, public AssistantUiModelObserver, public HomeLauncherGestureHandlerObserver, public HomeScreenDelegate { @@ -255,6 +257,9 @@ // MruWindowTracker::Observer: void OnWindowUntracked(aura::Window* untracked_window) override; + // AssistantControllerObserver: + void OnAssistantReady() override; + // AssistantUiModelObserver: void OnUiVisibilityChanged( AssistantVisibility new_visibility,
diff --git a/ash/app_list/views/app_list_folder_view.cc b/ash/app_list/views/app_list_folder_view.cc index e2b0dcc5..c7f1070 100644 --- a/ash/app_list/views/app_list_folder_view.cc +++ b/ash/app_list/views/app_list_folder_view.cc
@@ -549,6 +549,10 @@ return false; } +const char* AppListFolderView::GetClassName() const { + return "AppListFolderView"; +} + void AppListFolderView::OnAppListItemWillBeDeleted(AppListItem* item) { if (item == folder_item_) { items_grid_view_->OnFolderItemRemoved();
diff --git a/ash/app_list/views/app_list_folder_view.h b/ash/app_list/views/app_list_folder_view.h index 91be81af..db9ce60 100644 --- a/ash/app_list/views/app_list_folder_view.h +++ b/ash/app_list/views/app_list_folder_view.h
@@ -67,6 +67,7 @@ gfx::Size CalculatePreferredSize() const override; void Layout() override; bool OnKeyPressed(const ui::KeyEvent& event) override; + const char* GetClassName() const override; // AppListModelObserver void OnAppListItemWillBeDeleted(AppListItem* item) override;
diff --git a/ash/app_list/views/app_list_page.cc b/ash/app_list/views/app_list_page.cc index 0cfee26..91704a6 100644 --- a/ash/app_list/views/app_list_page.cc +++ b/ash/app_list/views/app_list_page.cc
@@ -75,4 +75,8 @@ return contents_view_->GetDefaultContentsBounds(); } +const char* AppListPage::GetClassName() const { + return "AppListPage"; +} + } // namespace app_list
diff --git a/ash/app_list/views/app_list_page.h b/ash/app_list/views/app_list_page.h index 2c0d837..65a30da 100644 --- a/ash/app_list/views/app_list_page.h +++ b/ash/app_list/views/app_list_page.h
@@ -80,6 +80,9 @@ // below the search box. gfx::Rect GetDefaultContentsBounds() const; + // views::View: + const char* GetClassName() const override; + private: ContentsView* contents_view_;
diff --git a/ash/app_list/views/app_list_view.cc b/ash/app_list/views/app_list_view.cc index ba28075..e2db38b 100644 --- a/ash/app_list/views/app_list_view.cc +++ b/ash/app_list/views/app_list_view.cc
@@ -122,6 +122,9 @@ return search_box_widget_; } + // views::View: + const char* GetClassName() const override { return "SearchBoxFocusHost"; } + private: views::Widget* search_box_widget_; @@ -438,6 +441,10 @@ SkColor GetColorForTest() const { return color_; } + const char* GetClassName() const override { + return "AppListBackgroundShieldView"; + } + private: SkColor color_; int corner_radius_;
diff --git a/ash/app_list/views/expand_arrow_view.cc b/ash/app_list/views/expand_arrow_view.cc index 17216359..1e8169ac 100644 --- a/ash/app_list/views/expand_arrow_view.cc +++ b/ash/app_list/views/expand_arrow_view.cc
@@ -246,6 +246,10 @@ Button::OnBlur(); } +const char* ExpandArrowView::GetClassName() const { + return "ExpandArrowView"; +} + std::unique_ptr<views::InkDrop> ExpandArrowView::CreateInkDrop() { std::unique_ptr<views::InkDropImpl> ink_drop = Button::CreateDefaultInkDropImpl();
diff --git a/ash/app_list/views/expand_arrow_view.h b/ash/app_list/views/expand_arrow_view.h index f0e10ff..ac7064f 100644 --- a/ash/app_list/views/expand_arrow_view.h +++ b/ash/app_list/views/expand_arrow_view.h
@@ -44,6 +44,7 @@ bool OnKeyPressed(const ui::KeyEvent& event) override; void OnFocus() override; void OnBlur() override; + const char* GetClassName() const override; // Overridden from views::InkDropHost: std::unique_ptr<views::InkDrop> CreateInkDrop() override;
diff --git a/ash/app_list/views/folder_background_view.cc b/ash/app_list/views/folder_background_view.cc index b9d3c27..f5818cd9 100644 --- a/ash/app_list/views/folder_background_view.cc +++ b/ash/app_list/views/folder_background_view.cc
@@ -14,6 +14,10 @@ FolderBackgroundView::~FolderBackgroundView() = default; +const char* FolderBackgroundView::GetClassName() const { + return "FolderBackgroundView"; +} + bool FolderBackgroundView::OnMousePressed(const ui::MouseEvent& event) { HandleClickOrTap(); return true;
diff --git a/ash/app_list/views/folder_background_view.h b/ash/app_list/views/folder_background_view.h index 489bcdff..3453efe0 100644 --- a/ash/app_list/views/folder_background_view.h +++ b/ash/app_list/views/folder_background_view.h
@@ -22,8 +22,11 @@ folder_view_ = folder_view; } + // views::View: + const char* GetClassName() const override; + private: - // views::View overrides: + // views::View: bool OnMousePressed(const ui::MouseEvent& event) override; void OnGestureEvent(ui::GestureEvent* event) override;
diff --git a/ash/app_list/views/folder_header_view.cc b/ash/app_list/views/folder_header_view.cc index 4a45d86..877309c 100644 --- a/ash/app_list/views/folder_header_view.cc +++ b/ash/app_list/views/folder_header_view.cc
@@ -188,6 +188,10 @@ folder_name_view_->GetPreferredSize().height()); } +const char* FolderHeaderView::GetClassName() const { + return "FolderHeaderView"; +} + views::View* FolderHeaderView::GetFolderNameViewForTest() const { return folder_name_view_; }
diff --git a/ash/app_list/views/folder_header_view.h b/ash/app_list/views/folder_header_view.h index df24346..477c12b 100644 --- a/ash/app_list/views/folder_header_view.h +++ b/ash/app_list/views/folder_header_view.h
@@ -39,8 +39,9 @@ bool is_tablet_mode() const { return is_tablet_mode_; } void set_tablet_mode(bool started) { is_tablet_mode_ = started; } - // Overridden from views::View: + // views::View: gfx::Size CalculatePreferredSize() const override; + const char* GetClassName() const override; views::View* GetFolderNameViewForTest() const; @@ -66,7 +67,7 @@ // Returns elided folder name from |folder_name|. base::string16 GetElidedFolderName(const base::string16& folder_name) const; - // views::View overrides: + // views::View: void Layout() override; // views::TextfieldController overrides:
diff --git a/ash/app_list/views/ghost_image_view.cc b/ash/app_list/views/ghost_image_view.cc index 96c7e835..d0da458f 100644 --- a/ash/app_list/views/ghost_image_view.cc +++ b/ash/app_list/views/ghost_image_view.cc
@@ -72,6 +72,10 @@ SetPosition(drop_target_bounds_.origin() + transition_offset); } +const char* GhostImageView::GetClassName() const { + return "GhostImageView"; +} + void GhostImageView::DoAnimation(bool hide) { ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); animation.SetTransitionDuration(kGhostFadeInOutLength);
diff --git a/ash/app_list/views/ghost_image_view.h b/ash/app_list/views/ghost_image_view.h index 61e3f8d..dbc5468 100644 --- a/ash/app_list/views/ghost_image_view.h +++ b/ash/app_list/views/ghost_image_view.h
@@ -39,6 +39,9 @@ // Returns the page number which this view belongs to. int page() const { return page_; } + // views::View: + const char* GetClassName() const override; + private: // Start the animation for showing or for hiding the GhostImageView. void DoAnimation(bool hide);
diff --git a/ash/app_list/views/horizontal_page.cc b/ash/app_list/views/horizontal_page.cc index 6ed2d87..129e5cd 100644 --- a/ash/app_list/views/horizontal_page.cc +++ b/ash/app_list/views/horizontal_page.cc
@@ -28,6 +28,10 @@ return true; } +const char* HorizontalPage::GetClassName() const { + return "HorizontalPage"; +} + HorizontalPage::HorizontalPage() = default; HorizontalPage::~HorizontalPage() = default;
diff --git a/ash/app_list/views/horizontal_page.h b/ash/app_list/views/horizontal_page.h index 0222206..edbc9cfb 100644 --- a/ash/app_list/views/horizontal_page.h +++ b/ash/app_list/views/horizontal_page.h
@@ -30,6 +30,9 @@ // Returns true if the search box should be shown in this page. virtual bool ShouldShowSearchBox() const; + // views::View: + const char* GetClassName() const override; + protected: HorizontalPage(); ~HorizontalPage() override;
diff --git a/ash/app_list/views/horizontal_page_container.cc b/ash/app_list/views/horizontal_page_container.cc index 2e2ca7ea..4f5c840 100644 --- a/ash/app_list/views/horizontal_page_container.cc +++ b/ash/app_list/views/horizontal_page_container.cc
@@ -68,6 +68,10 @@ event->SetHandled(); } +const char* HorizontalPageContainer::GetClassName() const { + return "HorizontalPageContainer"; +} + void HorizontalPageContainer::OnWillBeHidden() { GetSelectedPage()->OnWillBeHidden(); }
diff --git a/ash/app_list/views/horizontal_page_container.h b/ash/app_list/views/horizontal_page_container.h index a1b27cf..2fad9ca 100644 --- a/ash/app_list/views/horizontal_page_container.h +++ b/ash/app_list/views/horizontal_page_container.h
@@ -36,6 +36,7 @@ gfx::Size CalculatePreferredSize() const override; void Layout() override; void OnGestureEvent(ui::GestureEvent* event) override; + const char* GetClassName() const override; // AppListPage overrides: void OnWillBeHidden() override;
diff --git a/ash/app_list/views/page_switcher.cc b/ash/app_list/views/page_switcher.cc index fa80d30..98602506 100644 --- a/ash/app_list/views/page_switcher.cc +++ b/ash/app_list/views/page_switcher.cc
@@ -234,6 +234,10 @@ buttons_->SetBoundsRect(rect); } +const char* PageSwitcher::GetClassName() const { + return "PageSwitcher"; +} + void PageSwitcher::ButtonPressed(views::Button* sender, const ui::Event& event) { if (!model_ || ignore_button_press_)
diff --git a/ash/app_list/views/page_switcher.h b/ash/app_list/views/page_switcher.h index 494373e..53e40f0 100644 --- a/ash/app_list/views/page_switcher.h +++ b/ash/app_list/views/page_switcher.h
@@ -28,6 +28,7 @@ // Overridden from views::View: gfx::Size CalculatePreferredSize() const override; void Layout() override; + const char* GetClassName() const override; void set_ignore_button_press(bool ignore) { ignore_button_press_ = ignore; } void set_is_tablet_mode(bool started) { is_tablet_mode_ = started; }
diff --git a/ash/app_list/views/pulsing_block_view.cc b/ash/app_list/views/pulsing_block_view.cc index 65f838d..c909f7d 100644 --- a/ash/app_list/views/pulsing_block_view.cc +++ b/ash/app_list/views/pulsing_block_view.cc
@@ -84,6 +84,10 @@ PulsingBlockView::~PulsingBlockView() {} +const char* PulsingBlockView::GetClassName() const { + return "PulsingBlockView"; +} + void PulsingBlockView::OnStartDelayTimer() { SchedulePulsingAnimation(layer()); }
diff --git a/ash/app_list/views/pulsing_block_view.h b/ash/app_list/views/pulsing_block_view.h index ead3425..03c1c08 100644 --- a/ash/app_list/views/pulsing_block_view.h +++ b/ash/app_list/views/pulsing_block_view.h
@@ -24,6 +24,9 @@ PulsingBlockView(const gfx::Size& size, bool start_delay); ~PulsingBlockView() override; + // views::View: + const char* GetClassName() const override; + private: void OnStartDelayTimer();
diff --git a/ash/app_list/views/remove_query_confirmation_dialog.cc b/ash/app_list/views/remove_query_confirmation_dialog.cc index 8186c1d..bdc20f7 100644 --- a/ash/app_list/views/remove_query_confirmation_dialog.cc +++ b/ash/app_list/views/remove_query_confirmation_dialog.cc
@@ -55,6 +55,10 @@ GetWidget()->Show(); } +const char* RemoveQueryConfirmationDialog::GetClassName() const { + return "RemoveQueryConfirmationDialog"; +} + base::string16 RemoveQueryConfirmationDialog::GetWindowTitle() const { return l10n_util::GetStringUTF16(IDS_REMOVE_ZERO_STATE_SUGGESTION_TITLE); }
diff --git a/ash/app_list/views/remove_query_confirmation_dialog.h b/ash/app_list/views/remove_query_confirmation_dialog.h index ad75bea..1cbef2e 100644 --- a/ash/app_list/views/remove_query_confirmation_dialog.h +++ b/ash/app_list/views/remove_query_confirmation_dialog.h
@@ -32,6 +32,9 @@ // Shows the dialog with |parent|. void Show(gfx::NativeWindow parent); + // views::View: + const char* GetClassName() const override; + private: // views::WidgetDelegate: base::string16 GetWindowTitle() const override;
diff --git a/ash/app_list/views/search_box_view.cc b/ash/app_list/views/search_box_view.cc index 27f2bf5..de355873 100644 --- a/ash/app_list/views/search_box_view.cc +++ b/ash/app_list/views/search_box_view.cc
@@ -205,6 +205,10 @@ } } +const char* SearchBoxView::GetClassName() const { + return "SearchBoxView"; +} + // static int SearchBoxView::GetFocusRingSpacing() { return kSearchBoxFocusRingWidth + kSearchBoxFocusRingPadding;
diff --git a/ash/app_list/views/search_box_view.h b/ash/app_list/views/search_box_view.h index 9c5576e..5198637 100644 --- a/ash/app_list/views/search_box_view.h +++ b/ash/app_list/views/search_box_view.h
@@ -59,6 +59,7 @@ bool OnMouseWheel(const ui::MouseWheelEvent& event) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void OnPaintBackground(gfx::Canvas* canvas) override; + const char* GetClassName() const override; // Overridden from views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override;
diff --git a/ash/app_list/views/search_result_actions_view.cc b/ash/app_list/views/search_result_actions_view.cc index f8a697e..25a4a0b59 100644 --- a/ash/app_list/views/search_result_actions_view.cc +++ b/ash/app_list/views/search_result_actions_view.cc
@@ -251,6 +251,10 @@ UpdateButtonsOnStateChanged(); } +const char* SearchResultActionsView::GetClassName() const { + return "SearchResultActionsView"; +} + void SearchResultActionsView::CreateImageButton( const SearchResult::Action& action) { SearchResultImageButton* button = new SearchResultImageButton(this, action);
diff --git a/ash/app_list/views/search_result_actions_view.h b/ash/app_list/views/search_result_actions_view.h index a717c4f..bcc1960 100644 --- a/ash/app_list/views/search_result_actions_view.h +++ b/ash/app_list/views/search_result_actions_view.h
@@ -38,6 +38,9 @@ // Called when one of the action buttons changes state. void ActionButtonStateChanged(); + // views::View: + const char* GetClassName() const override; + private: void CreateImageButton(const SearchResult::Action& action);
diff --git a/ash/app_list/views/search_result_base_view.cc b/ash/app_list/views/search_result_base_view.cc index 8ec35d0b..c76bff1 100644 --- a/ash/app_list/views/search_result_base_view.cc +++ b/ash/app_list/views/search_result_base_view.cc
@@ -22,6 +22,10 @@ return false; } +const char* SearchResultBaseView::GetClassName() const { + return "SearchResultBaseView"; +} + void SearchResultBaseView::SetBackgroundHighlighted(bool enabled) { background_highlighted_ = enabled; SchedulePaint();
diff --git a/ash/app_list/views/search_result_base_view.h b/ash/app_list/views/search_result_base_view.h index 0b8e689..eedd78b 100644 --- a/ash/app_list/views/search_result_base_view.h +++ b/ash/app_list/views/search_result_base_view.h
@@ -51,6 +51,9 @@ // views::Button: bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; + // views::View: + const char* GetClassName() const override; + protected: ~SearchResultBaseView() override;
diff --git a/ash/app_list/views/top_icon_animation_view.cc b/ash/app_list/views/top_icon_animation_view.cc index ea045f2..a5a8cda 100644 --- a/ash/app_list/views/top_icon_animation_view.cc +++ b/ash/app_list/views/top_icon_animation_view.cc
@@ -112,6 +112,10 @@ } } +const char* TopIconAnimationView::GetClassName() const { + return "TopIconAnimationView"; +} + gfx::Size TopIconAnimationView::CalculatePreferredSize() const { return gfx::Size(AppListConfig::instance().grid_tile_width(), AppListConfig::instance().grid_tile_height());
diff --git a/ash/app_list/views/top_icon_animation_view.h b/ash/app_list/views/top_icon_animation_view.h index e6ba2756..ff71d936 100644 --- a/ash/app_list/views/top_icon_animation_view.h +++ b/ash/app_list/views/top_icon_animation_view.h
@@ -59,6 +59,9 @@ // location to the small icon inside the folder icon. void TransformView(); + // views::View + const char* GetClassName() const override; + private: // views::View overrides: gfx::Size CalculatePreferredSize() const override;
diff --git a/ash/assistant/assistant_controller.cc b/ash/assistant/assistant_controller.cc index e687d6d3..6174b8f 100644 --- a/ash/assistant/assistant_controller.cc +++ b/ash/assistant/assistant_controller.cc
@@ -97,6 +97,9 @@ // provide an opportunity to turn on/off A11Y features. Shell::Get()->accessibility_controller()->AddObserver(this); OnAccessibilityStatusChanged(); + + for (AssistantControllerObserver& observer : observers_) + observer.OnAssistantReady(); } void AssistantController::SetAssistantImageDownloader(
diff --git a/ash/assistant/assistant_controller_observer.h b/ash/assistant/assistant_controller_observer.h index 3001112d..d23e98a9 100644 --- a/ash/assistant/assistant_controller_observer.h +++ b/ash/assistant/assistant_controller_observer.h
@@ -31,6 +31,9 @@ // Invoked when the AssistantController is starting to be destroyed. virtual void OnAssistantControllerDestroying() {} + // Invoked when the Assistant is ready. + virtual void OnAssistantReady() {} + // Invoked when Assistant has received a deep link of the specified |type| // with the given |params|. virtual void OnDeepLinkReceived(
diff --git a/ash/components/fast_ink/fast_ink_view.cc b/ash/components/fast_ink/fast_ink_view.cc index 884707d..c1a0add 100644 --- a/ash/components/fast_ink/fast_ink_view.cc +++ b/ash/components/fast_ink/fast_ink_view.cc
@@ -324,8 +324,7 @@ // but with potential tearing. Note that we have to draw into a temporary // surface and copy it into GPU memory buffer to avoid flicker. gpu_memory_buffer_ = - widget_->GetNativeWindow() - ->env() + aura::Env::GetInstance() ->context_factory() ->GetGpuMemoryBufferManager() ->CreateGpuMemoryBuffer(buffer_size_, @@ -407,8 +406,7 @@ // new instance to be created in lost context situations is acceptable and // keeps the code simple. if (!resource->context_provider) { - resource->context_provider = widget_->GetNativeWindow() - ->env() + resource->context_provider = aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider(); if (!resource->context_provider) { @@ -424,8 +422,7 @@ const uint32_t usage = gpu::SHARED_IMAGE_USAGE_DISPLAY | gpu::SHARED_IMAGE_USAGE_SCANOUT; gpu::GpuMemoryBufferManager* gmb_manager = - widget_->GetNativeWindow() - ->env() + aura::Env::GetInstance() ->context_factory() ->GetGpuMemoryBufferManager(); resource->mailbox = sii->CreateSharedImage(
diff --git a/ash/display/display_output_protection.cc b/ash/display/display_output_protection.cc deleted file mode 100644 index e676944..0000000 --- a/ash/display/display_output_protection.cc +++ /dev/null
@@ -1,68 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/display/display_output_protection.h" - -#include <utility> - -#include "ui/display/manager/display_configurator.h" - -using display::DisplayConfigurator; - -namespace ash { - -// A BindingContext is created for each bind request. BindingContext contains -// the state unique to each connection. -class DisplayOutputProtection::BindingContext { - public: - explicit BindingContext(DisplayConfigurator* display_configurator) - : display_configurator_(display_configurator), - client_id_(display_configurator_->RegisterContentProtectionClient()) {} - - ~BindingContext() { - display_configurator_->UnregisterContentProtectionClient(client_id_); - } - - DisplayConfigurator::ContentProtectionClientId client_id() const { - return client_id_; - } - - private: - DisplayConfigurator* const display_configurator_; - const DisplayConfigurator::ContentProtectionClientId client_id_; - - DISALLOW_COPY_AND_ASSIGN(BindingContext); -}; - -DisplayOutputProtection::DisplayOutputProtection( - DisplayConfigurator* display_configurator) - : display_configurator_(display_configurator) {} - -DisplayOutputProtection::~DisplayOutputProtection() = default; - -void DisplayOutputProtection::BindRequest( - mojom::DisplayOutputProtectionRequest request) { - std::unique_ptr<BindingContext> context = - std::make_unique<BindingContext>(display_configurator_); - bindings_.AddBinding(this, std::move(request), std::move(context)); -} - -void DisplayOutputProtection::QueryContentProtectionStatus( - int64_t display_id, - QueryContentProtectionStatusCallback callback) { - display_configurator_->QueryContentProtection( - bindings_.dispatch_context()->client_id(), display_id, - std::move(callback)); -} - -void DisplayOutputProtection::SetContentProtection( - int64_t display_id, - uint32_t desired_method_mask, - SetContentProtectionCallback callback) { - display_configurator_->ApplyContentProtection( - bindings_.dispatch_context()->client_id(), display_id, - desired_method_mask, std::move(callback)); -} - -} // namespace ash
diff --git a/ash/display/display_output_protection.h b/ash/display/display_output_protection.h deleted file mode 100644 index d3a061d..0000000 --- a/ash/display/display_output_protection.h +++ /dev/null
@@ -1,55 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_DISPLAY_DISPLAY_OUTPUT_PROTECTION_H_ -#define ASH_DISPLAY_DISPLAY_OUTPUT_PROTECTION_H_ - -#include <stdint.h> - -#include <memory> - -#include "ash/public/interfaces/display_output_protection.mojom.h" -#include "base/macros.h" -#include "mojo/public/cpp/bindings/binding_set.h" - -namespace display { -class DisplayConfigurator; -} - -namespace ash { - -// DisplayOutputProtection provides the necessary functionality to configure -// output protection. -class DisplayOutputProtection : public mojom::DisplayOutputProtection { - public: - explicit DisplayOutputProtection( - display::DisplayConfigurator* display_configurator); - ~DisplayOutputProtection() override; - - void BindRequest(mojom::DisplayOutputProtectionRequest request); - - // mojom::DisplayOutputProtection: - void QueryContentProtectionStatus( - int64_t display_id, - QueryContentProtectionStatusCallback callback) override; - void SetContentProtection(int64_t display_id, - uint32_t desired_method_mask, - SetContentProtectionCallback callback) override; - - private: - class BindingContext; - - display::DisplayConfigurator* const display_configurator_; - - mojo::BindingSetBase<mojom::DisplayOutputProtection, - mojo::Binding<mojom::DisplayOutputProtection>, - std::unique_ptr<BindingContext>> - bindings_; - - DISALLOW_COPY_AND_ASSIGN(DisplayOutputProtection); -}; - -} // namespace ash - -#endif // ASH_DISPLAY_DISPLAY_OUTPUT_PROTECTION_H_
diff --git a/ash/frame/header_view.cc b/ash/frame/header_view.cc index 008ab7b..9707fe8 100644 --- a/ash/frame/header_view.cc +++ b/ash/frame/header_view.cc
@@ -15,6 +15,7 @@ #include "ash/shell.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" +#include "base/auto_reset.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" #include "ui/base/ui_base_features.h" @@ -94,7 +95,10 @@ return static_cast<int>(GetPreferredHeight() * fullscreen_visible_fraction_); } - return GetPreferredHeight(); + + return (target_widget_ && target_widget_->IsFullscreen()) + ? 0 + : GetPreferredHeight(); } int HeaderView::GetPreferredHeight() { @@ -164,6 +168,12 @@ parent()->Layout(); } +bool HeaderView::IsDrawn() const { + if (is_drawn_override_) + return true; + return views::View::IsDrawn(); +} + void HeaderView::OnTabletModeStarted() { UpdateCaptionButtonsVisibility(); caption_button_container_->UpdateCaptionButtonState(true /*=animate*/); @@ -278,6 +288,7 @@ std::vector<gfx::Rect> HeaderView::GetVisibleBoundsInScreen() const { // TODO(pkotwicz): Implement views::View::ConvertRectToScreen(). + base::AutoReset<bool> reset(&is_drawn_override_, true); gfx::Rect visible_bounds(GetVisibleBounds()); gfx::Point visible_origin_in_screen(visible_bounds.origin()); views::View::ConvertPointToScreen(this, &visible_origin_in_screen);
diff --git a/ash/frame/header_view.h b/ash/frame/header_view.h index 957b615..fa88f6e2 100644 --- a/ash/frame/header_view.h +++ b/ash/frame/header_view.h
@@ -78,6 +78,7 @@ // views::View: void Layout() override; void ChildPreferredSizeChanged(views::View* child) override; + bool IsDrawn() const override; // TabletModeObserver: void OnTabletModeStarted() override; @@ -159,6 +160,9 @@ bool in_immersive_mode_ = false; + // This is used to compute visible bounds. + mutable bool is_drawn_override_ = false; + // Observes property changes to |target_widget_|'s window. ScopedObserver<aura::Window, aura::WindowObserver> window_observer_{this};
diff --git a/ash/frame/non_client_frame_view_ash.cc b/ash/frame/non_client_frame_view_ash.cc index 52e565bf..a14f00ce 100644 --- a/ash/frame/non_client_frame_view_ash.cc +++ b/ash/frame/non_client_frame_view_ash.cc
@@ -207,11 +207,14 @@ int onscreen_height = header_height_ ? *header_height_ : header_view_->GetPreferredOnScreenHeight(); + int height = + header_height_ ? *header_height_ : header_view_->GetPreferredHeight(); if (onscreen_height == 0 || !GetVisible()) { header_view_->SetVisible(false); + // Make sure the correct width is set even when immersive is enabled, but + // never revealed yet. + header_view_->SetBounds(0, 0, width(), height); } else { - const int height = - header_height_ ? *header_height_ : header_view_->GetPreferredHeight(); header_view_->SetBounds(0, onscreen_height - height, width(), height); header_view_->SetVisible(true); }
diff --git a/ash/frame/non_client_frame_view_ash_unittest.cc b/ash/frame/non_client_frame_view_ash_unittest.cc index 912faca..666b20f 100644 --- a/ash/frame/non_client_frame_view_ash_unittest.cc +++ b/ash/frame/non_client_frame_view_ash_unittest.cc
@@ -467,6 +467,32 @@ Shell::Get()->split_view_controller()->EndSplitView(); } +TEST_F(NonClientFrameViewAshTest, HeaderVisibilityInFullscreen) { + auto* delegate = new NonClientFrameViewAshTestWidgetDelegate(); + std::unique_ptr<views::Widget> widget = CreateTestWidget(delegate); + NonClientFrameViewAsh* non_client_frame_view = + delegate->non_client_frame_view(); + HeaderView* header_view = non_client_frame_view->GetHeaderView(); + EXPECT_FALSE(header_view->in_immersive_mode()); + EXPECT_TRUE(header_view->GetVisible()); + widget->SetFullscreen(true); + EXPECT_TRUE(header_view->in_immersive_mode()); + EXPECT_TRUE(header_view->GetVisible()); + widget->SetFullscreen(false); + EXPECT_FALSE(header_view->in_immersive_mode()); + EXPECT_TRUE(header_view->GetVisible()); + + // Turn immersive off, and make sure that header view is invisible + // in fullscreen. + widget->SetFullscreen(true); + ash::ImmersiveFullscreenController::EnableForWidget(widget.get(), false); + EXPECT_FALSE(header_view->in_immersive_mode()); + EXPECT_FALSE(header_view->GetVisible()); + widget->SetFullscreen(false); + EXPECT_FALSE(header_view->in_immersive_mode()); + EXPECT_TRUE(header_view->GetVisible()); +} + namespace { class TestButtonModel : public CaptionButtonModel { @@ -715,10 +741,12 @@ wide_frame_view->Init(&controller); EXPECT_FALSE(wide_header_view->in_immersive_mode()); EXPECT_FALSE(header_view->in_immersive_mode()); + EXPECT_TRUE(header_view->GetVisible()); ImmersiveFullscreenController::EnableForWidget(widget.get(), true); EXPECT_TRUE(header_view->in_immersive_mode()); EXPECT_TRUE(wide_header_view->in_immersive_mode()); + EXPECT_TRUE(header_view->GetVisible()); // The height should be ~(33 *.5) wide_header_view->SetVisibleFraction(0.5); EXPECT_NEAR(16, wide_header_view->GetPreferredOnScreenHeight(), 1);
diff --git a/ash/keyboard/arc/arc_input_method_surface_manager_unittest.cc b/ash/keyboard/arc/arc_input_method_surface_manager_unittest.cc index 643d1d5..ecb9b98 100644 --- a/ash/keyboard/arc/arc_input_method_surface_manager_unittest.cc +++ b/ash/keyboard/arc/arc_input_method_surface_manager_unittest.cc
@@ -4,14 +4,12 @@ #include "ash/keyboard/arc/arc_input_method_surface_manager.h" -#include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "base/macros.h" #include "components/exo/input_method_surface.h" #include "components/exo/surface.h" #include "components/exo/wm_helper.h" #include "components/exo/wm_helper_chromeos.h" -#include "ui/aura/env.h" namespace ash { namespace { @@ -43,8 +41,7 @@ void SetUp() override { AshTestBase::SetUp(); - wm_helper_ = - std::make_unique<exo::WMHelperChromeOS>(Shell::Get()->aura_env()); + wm_helper_ = std::make_unique<exo::WMHelperChromeOS>(); exo::WMHelper::SetInstance(wm_helper_.get()); }
diff --git a/ash/mojo_interface_factory.cc b/ash/mojo_interface_factory.cc index 6febda37..b39adac 100644 --- a/ash/mojo_interface_factory.cc +++ b/ash/mojo_interface_factory.cc
@@ -16,7 +16,6 @@ #include "ash/assistant/assistant_setup_controller.h" #include "ash/autotest/shelf_integration_test_api.h" #include "ash/display/cros_display_config.h" -#include "ash/display/display_output_protection.h" #include "ash/events/event_rewriter_controller.h" #include "ash/first_run/first_run_helper.h" #include "ash/highlighter/highlighter_controller.h" @@ -125,11 +124,6 @@ Shell::Get()->message_center_controller()->BindRequest(std::move(request)); } -void BindDisplayOutputProtectionRequestOnMainThread( - mojom::DisplayOutputProtectionRequest request) { - Shell::Get()->display_output_protection()->BindRequest(std::move(request)); -} - void BindEventRewriterControllerRequestOnMainThread( mojom::EventRewriterControllerRequest request) { Shell::Get()->event_rewriter_controller()->BindRequest(std::move(request)); @@ -289,9 +283,6 @@ main_thread_task_runner); } registry->AddInterface( - base::BindRepeating(&BindDisplayOutputProtectionRequestOnMainThread), - main_thread_task_runner); - registry->AddInterface( base::BindRepeating(&BindEventRewriterControllerRequestOnMainThread), main_thread_task_runner); registry->AddInterface(
diff --git a/ash/public/cpp/app_list/app_list_metrics.cc b/ash/public/cpp/app_list/app_list_metrics.cc index 038eacd..583bb4a 100644 --- a/ash/public/cpp/app_list/app_list_metrics.cc +++ b/ash/public/cpp/app_list/app_list_metrics.cc
@@ -7,31 +7,60 @@ #include "base/metrics/histogram_macros.h" namespace { + const char kAppListSearchResultOpenTypeHistogram[] = "Apps.AppListSearchResultOpenTypeV2"; const char kAppListSearchResultOpenTypeHistogramInTablet[] = "Apps.AppListSearchResultOpenTypeV2.TabletMode"; const char kAppListSearchResultOpenTypeHistogramInClamshell[] = "Apps.AppListSearchResultOpenTypeV2.ClamshellMode"; -} +const char kAppListSuggestionChipOpenTypeHistogramInClamshell[] = + "Apps.AppListSuggestedChipOpenType.ClamshellMode"; +const char kAppListSuggestionChipOpenTypeHistogramInTablet[] = + "Apps.AppListSuggestedChipOpenType.TabletMode"; + +} // namespace namespace app_list { -void RecordSearchResultOpenTypeHistogram(SearchResultType type, - bool is_tablet_mode) { +void RecordSearchResultOpenTypeHistogram( + ash::mojom::AppListLaunchedFrom launch_location, + SearchResultType type, + bool is_tablet_mode) { if (type == SEARCH_RESULT_TYPE_BOUNDARY) { NOTREACHED(); return; } - UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogram, type, - SEARCH_RESULT_TYPE_BOUNDARY); - if (is_tablet_mode) { - UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogramInTablet, - type, SEARCH_RESULT_TYPE_BOUNDARY); - } else { - UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogramInClamshell, - type, SEARCH_RESULT_TYPE_BOUNDARY); + switch (launch_location) { + case ash::mojom::AppListLaunchedFrom::kLaunchedFromSearchBox: + UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogram, type, + SEARCH_RESULT_TYPE_BOUNDARY); + if (is_tablet_mode) { + UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogramInTablet, + type, SEARCH_RESULT_TYPE_BOUNDARY); + } else { + UMA_HISTOGRAM_ENUMERATION( + kAppListSearchResultOpenTypeHistogramInClamshell, type, + SEARCH_RESULT_TYPE_BOUNDARY); + } + break; + case ash::mojom::AppListLaunchedFrom::kLaunchedFromSuggestionChip: + if (is_tablet_mode) { + UMA_HISTOGRAM_ENUMERATION( + kAppListSuggestionChipOpenTypeHistogramInTablet, type, + SEARCH_RESULT_TYPE_BOUNDARY); + } else { + UMA_HISTOGRAM_ENUMERATION( + kAppListSuggestionChipOpenTypeHistogramInClamshell, type, + SEARCH_RESULT_TYPE_BOUNDARY); + } + break; + case ash::mojom::AppListLaunchedFrom::kLaunchedFromShelf: + case ash::mojom::AppListLaunchedFrom::kLaunchedFromGrid: + // Search results don't live in the shelf or the app grid. + NOTREACHED(); + break; } }
diff --git a/ash/public/cpp/app_list/app_list_metrics.h b/ash/public/cpp/app_list/app_list_metrics.h index 264973e..03ac37c 100644 --- a/ash/public/cpp/app_list/app_list_metrics.h +++ b/ash/public/cpp/app_list/app_list_metrics.h
@@ -6,6 +6,7 @@ #define ASH_PUBLIC_CPP_APP_LIST_APP_LIST_METRICS_H_ #include "ash/public/cpp/ash_public_export.h" +#include "ash/public/interfaces/app_list.mojom.h" namespace app_list { // The type of the ChromeSearchResult. This is used for logging so do not @@ -71,6 +72,7 @@ }; ASH_PUBLIC_EXPORT void RecordSearchResultOpenTypeHistogram( + ash::mojom::AppListLaunchedFrom launch_location, SearchResultType type, bool is_tablet_mode);
diff --git a/ash/public/cpp/frame_utils.cc b/ash/public/cpp/frame_utils.cc index 60bbb32b..0098fe2b 100644 --- a/ash/public/cpp/frame_utils.cc +++ b/ash/public/cpp/frame_utils.cc
@@ -21,7 +21,7 @@ gfx::Rect expanded_bounds = view->bounds(); int outside_bounds = kResizeOutsideBoundsSize; - if (view->GetWidget()->GetNativeWindow()->env()->is_touch_down()) + if (aura::Env::GetInstance()->is_touch_down()) outside_bounds *= kResizeOutsideBoundsScaleForTouch; expanded_bounds.Inset(-outside_bounds, -outside_bounds);
diff --git a/ash/public/cpp/immersive/immersive_fullscreen_controller_test_api.cc b/ash/public/cpp/immersive/immersive_fullscreen_controller_test_api.cc index afa193e..9f1d2081a 100644 --- a/ash/public/cpp/immersive/immersive_fullscreen_controller_test_api.cc +++ b/ash/public/cpp/immersive/immersive_fullscreen_controller_test_api.cc
@@ -7,8 +7,6 @@ #include "ash/public/cpp/immersive/immersive_fullscreen_controller.h" #include "ash/public/cpp/immersive/immersive_fullscreen_controller_delegate.h" #include "ui/aura/env.h" -#include "ui/aura/window.h" -#include "ui/events/base_event_utils.h" #include "ui/gfx/geometry/rect.h" namespace ash {
diff --git a/ash/public/cpp/manifest.cc b/ash/public/cpp/manifest.cc index db24c8d..671c8363 100644 --- a/ash/public/cpp/manifest.cc +++ b/ash/public/cpp/manifest.cc
@@ -12,7 +12,6 @@ #include "ash/public/interfaces/assistant_volume_control.mojom.h" #include "ash/public/interfaces/constants.mojom.h" #include "ash/public/interfaces/cros_display_config.mojom.h" -#include "ash/public/interfaces/display_output_protection.mojom.h" #include "ash/public/interfaces/event_rewriter_controller.mojom.h" #include "ash/public/interfaces/first_run_helper.mojom.h" #include "ash/public/interfaces/highlighter_controller.mojom.h"
diff --git a/ash/public/interfaces/BUILD.gn b/ash/public/interfaces/BUILD.gn index 5ace7346..958795c 100644 --- a/ash/public/interfaces/BUILD.gn +++ b/ash/public/interfaces/BUILD.gn
@@ -28,8 +28,6 @@ "assistant_volume_control.mojom", "constants.mojom", "cros_display_config.mojom", - "display_output_protection.mojom", - "event_properties.mojom", "event_rewriter_controller.mojom", "first_run_helper.mojom", "highlighter_controller.mojom",
diff --git a/ash/public/interfaces/display_output_protection.mojom b/ash/public/interfaces/display_output_protection.mojom deleted file mode 100644 index 33359df..0000000 --- a/ash/public/interfaces/display_output_protection.mojom +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module ash.mojom; - -// An interface for clients that are allowed to control the display output -// content protection. Multiple clients can request content protection at -// the same time, and the display will be protected until all clients are -// closed or set |desired_method_mask| to 0 with |SetContentProtection|. -interface DisplayOutputProtection { - // Queries link status and protection status. - // |link_mask| is the type of connected display links, which is a bitmask of - // DisplayConnectionType values. - // |protection_mask)| is the desired protection methods, which is a bitmask of - // the ContentProtectionMethod values. - // See //ui/display/types/display_constants.h for DisplayConnectionType and - // ContentProtectionMethod. - QueryContentProtectionStatus(int64 display_id) => (bool success, - uint32 link_mask, - uint32 protection_mask); - - // Requests the desired protection methods. - // |protection_mask| is the desired protection methods, which is a bitmask - // of the ContentProtectionMethod values. When the interface is closed, - // the content protection mask will be reverted. - // Return true on success. Return false if it failed to make the protection - // request on the given display. - // See //ui/display/types/display_constants.h for ContentProtectionMethod. - SetContentProtection(int64 display_id, - uint32 desired_method_mask) => (bool success); -};
diff --git a/ash/public/interfaces/event_properties.mojom b/ash/public/interfaces/event_properties.mojom deleted file mode 100644 index 44ad368..0000000 --- a/ash/public/interfaces/event_properties.mojom +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module ash.mojom; - -// This is added to KeyEvents that ash has an accelerator for. This is only used -// for accelerators ash does not handle immediately. That is, those the target -// is given priority to process. -// No value is set for this property, the presence indicates ash has an -// accelerator. -const string kWillProcessAccelerator_KeyEventProperty = - "ash:will-process-accelerator";
diff --git a/ash/shell.cc b/ash/shell.cc index ac71bd2..385fdc9 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -32,7 +32,6 @@ #include "ash/display/display_configuration_controller.h" #include "ash/display/display_configuration_observer.h" #include "ash/display/display_error_observer.h" -#include "ash/display/display_output_protection.h" #include "ash/display/display_prefs.h" #include "ash/display/display_shutdown_observer.h" #include "ash/display/event_transformation_handler.h" @@ -364,8 +363,8 @@ } void Shell::InitWaylandServer(std::unique_ptr<exo::FileHelper> file_helper) { - wayland_server_controller_ = WaylandServerController::CreateIfNecessary( - std::move(file_helper), aura_env_); + wayland_server_controller_ = + WaylandServerController::CreateIfNecessary(std::move(file_helper)); if (wayland_server_controller_) { system_tray_model() ->virtual_keyboard() @@ -595,8 +594,6 @@ login_screen_controller_ = std::make_unique<LoginScreenController>(system_tray_notifier_.get()); display_manager_.reset(ScreenAsh::CreateDisplayManager()); - display_output_protection_ = std::make_unique<DisplayOutputProtection>( - display_manager_->configurator()); window_tree_host_manager_ = std::make_unique<WindowTreeHostManager>(); user_metrics_recorder_ = std::make_unique<UserMetricsRecorder>(); ash_keyboard_controller_ =
diff --git a/ash/shell.h b/ash/shell.h index 60157433..7f45e7c 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -104,7 +104,6 @@ class BluetoothNotificationController; class BluetoothPowerController; class BrightnessControlDelegate; -class DisplayOutputProtection; class CrosDisplayConfig; class DesksController; class DetachableBaseHandler; @@ -358,9 +357,6 @@ DisplayErrorObserver* display_error_observer() { return display_error_observer_.get(); } - DisplayOutputProtection* display_output_protection() { - return display_output_protection_.get(); - } DockedMagnifierControllerImpl* docked_magnifier_controller(); aura::Env* aura_env() { return aura_env_; } @@ -798,8 +794,6 @@ std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_; std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_; std::unique_ptr<AshKeyboardController> ash_keyboard_controller_; - // Controls video output device state. - std::unique_ptr<DisplayOutputProtection> display_output_protection_; std::unique_ptr<DisplayColorManager> display_color_manager_; std::unique_ptr<DisplayErrorObserver> display_error_observer_; std::unique_ptr<ProjectingObserver> projecting_observer_;
diff --git a/ash/system/message_center/arc/arc_notification_content_view_unittest.cc b/ash/system/message_center/arc/arc_notification_content_view_unittest.cc index f945d31..4a903d2 100644 --- a/ash/system/message_center/arc/arc_notification_content_view_unittest.cc +++ b/ash/system/message_center/arc/arc_notification_content_view_unittest.cc
@@ -35,7 +35,6 @@ #include "components/exo/wm_helper.h" #include "components/exo/wm_helper_chromeos.h" #include "testing/gmock/include/gmock/gmock.h" -#include "ui/aura/env.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/events/keycodes/dom/dom_code.h" @@ -113,8 +112,7 @@ void SetUp() override { AshTestBase::SetUp(); - wm_helper_ = - std::make_unique<exo::WMHelperChromeOS>(ash::Shell::Get()->aura_env()); + wm_helper_ = std::make_unique<exo::WMHelperChromeOS>(); exo::WMHelper::SetInstance(wm_helper_.get()); DCHECK(exo::WMHelper::HasInstance());
diff --git a/ash/system/message_center/arc/arc_notification_surface_impl.cc b/ash/system/message_center/arc/arc_notification_surface_impl.cc index fb6c14df..8daf7d0 100644 --- a/ash/system/message_center/arc/arc_notification_surface_impl.cc +++ b/ash/system/message_center/arc/arc_notification_surface_impl.cc
@@ -82,8 +82,7 @@ : surface_(surface) { DCHECK(surface); native_view_ = std::make_unique<aura::Window>( - new CustomWindowDelegate(surface), aura::client::WINDOW_TYPE_CONTROL, - surface_->host_window()->env()); + new CustomWindowDelegate(surface), aura::client::WINDOW_TYPE_CONTROL); native_view_->set_owned_by_parent(false); native_view_->Init(ui::LAYER_NOT_DRAWN); native_view_->AddChild(surface_->host_window());
diff --git a/ash/system/tray/tray_bubble_view.cc b/ash/system/tray/tray_bubble_view.cc index 7f8ada179..4e982f1 100644 --- a/ash/system/tray/tray_bubble_view.cc +++ b/ash/system/tray/tray_bubble_view.cc
@@ -146,14 +146,14 @@ TrayBubbleView::InitParams::InitParams(const InitParams& other) = default; TrayBubbleView::RerouteEventHandler::RerouteEventHandler( - TrayBubbleView* tray_bubble_view, - aura::Env* aura_env) - : tray_bubble_view_(tray_bubble_view), aura_env_(aura_env) { - aura_env_->AddPreTargetHandler(this, ui::EventTarget::Priority::kSystem); + TrayBubbleView* tray_bubble_view) + : tray_bubble_view_(tray_bubble_view) { + aura::Env::GetInstance()->AddPreTargetHandler( + this, ui::EventTarget::Priority::kSystem); } TrayBubbleView::RerouteEventHandler::~RerouteEventHandler() { - aura_env_->RemovePreTargetHandler(this); + aura::Env::GetInstance()->RemovePreTargetHandler(this); } void TrayBubbleView::RerouteEventHandler::OnKeyEvent(ui::KeyEvent* event) { @@ -287,10 +287,8 @@ // If TrayBubbleView cannot be activated and is shown by clicking on the // corresponding tray view, register pre target event handler to reroute key // events to the widget for activating the view or closing it. - if (!CanActivate() && params_.show_by_click) { - reroute_event_handler_ = std::make_unique<RerouteEventHandler>( - this, GetWidget()->GetNativeWindow()->env()); - } + if (!CanActivate() && params_.show_by_click) + reroute_event_handler_ = std::make_unique<RerouteEventHandler>(this); } void TrayBubbleView::UpdateBubble() {
diff --git a/ash/system/tray/tray_bubble_view.h b/ash/system/tray/tray_bubble_view.h index c6f0b26..cffe486 100644 --- a/ash/system/tray/tray_bubble_view.h +++ b/ash/system/tray/tray_bubble_view.h
@@ -19,10 +19,6 @@ #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/mouse_watcher.h" -namespace aura { -class Env; -} - namespace ui { class LayerOwner; } @@ -200,7 +196,7 @@ // process accelerator as menu is currently open. class RerouteEventHandler : public ui::EventHandler { public: - RerouteEventHandler(TrayBubbleView* tray_bubble_view, aura::Env* aura_env); + RerouteEventHandler(TrayBubbleView* tray_bubble_view); ~RerouteEventHandler() override; // Overridden from ui::EventHandler @@ -210,11 +206,6 @@ // TrayBubbleView to which key events are going to be rerouted. Not owned. TrayBubbleView* tray_bubble_view_; - // The aura::Env where this EventHandler is installed. Needed because - // SingleProcessMash has more than one aura::Env. Cached so this object - // can unregister itself during TrayBubbleView teardown. - aura::Env* aura_env_; - DISALLOW_COPY_AND_ASSIGN(RerouteEventHandler); };
diff --git a/ash/system/tray/tray_constants.h b/ash/system/tray/tray_constants.h index 523ef01..9b9230e 100644 --- a/ash/system/tray/tray_constants.h +++ b/ash/system/tray/tray_constants.h
@@ -230,14 +230,16 @@ constexpr int kUnifiedFeaturePodHoverRadius = 4; constexpr int kUnifiedFeaturePodVerticalPadding = 28; constexpr int kUnifiedFeaturePodTopPadding = 24; -constexpr int kUnifiedFeaturePodBottomPadding = 20; +constexpr int kUnifiedFeaturePodBottomPadding = 5; constexpr int kUnifiedFeaturePodHorizontalSidePadding = 12; constexpr int kUnifiedFeaturePodHorizontalMiddlePadding = 0; -constexpr int kUnifiedFeaturePodCollapsedVerticalPadding = 16; +constexpr int kUnifiedFeaturePodCollapsedVerticalPadding = 12; constexpr int kUnifiedFeaturePodCollapsedHorizontalPadding = 24; constexpr int kUnifiedFeaturePodArrowSpacing = 4; constexpr int kUnifiedFeaturePodItemsInRow = 3; +constexpr int kUnifiedFeaturePodItemsRows = 3; constexpr int kUnifiedFeaturePodMaxItemsInCollapsed = 5; +constexpr int kUnifiedFeaturePodsPageSpacing = 48; constexpr int kUnifiedNotificationSeparatorThickness = 1; // Constants used in PageIndicatorView of UnifiedSystemTray.
diff --git a/ash/system/unified/feature_pods_container_view.cc b/ash/system/unified/feature_pods_container_view.cc index 9906ab7..90c94d0 100644 --- a/ash/system/unified/feature_pods_container_view.cc +++ b/ash/system/unified/feature_pods_container_view.cc
@@ -4,15 +4,28 @@ #include "ash/system/unified/feature_pods_container_view.h" +#include "ash/public/cpp/ash_features.h" +#include "ash/public/cpp/pagination/pagination_controller.h" +#include "ash/public/cpp/pagination/pagination_model.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/unified/feature_pod_button.h" +#include "ash/system/unified/unified_system_tray_controller.h" namespace ash { -FeaturePodsContainerView::FeaturePodsContainerView(bool initially_expanded) - : expanded_amount_(initially_expanded ? 1.0 : 0.0) {} +FeaturePodsContainerView::FeaturePodsContainerView( + UnifiedSystemTrayController* controller, + bool initially_expanded) + : controller_(controller), + pagination_model_(controller->model()->pagination_model()), + expanded_amount_(initially_expanded ? 1.0 : 0.0) { + pagination_model_->AddObserver(this); +} -FeaturePodsContainerView::~FeaturePodsContainerView() = default; +FeaturePodsContainerView::~FeaturePodsContainerView() { + DCHECK(pagination_model_); + pagination_model_->RemoveObserver(this); +} void FeaturePodsContainerView::SetExpandedAmount(double expanded_amount) { DCHECK(0.0 <= expanded_amount && expanded_amount <= 1.0); @@ -33,6 +46,10 @@ // floor(visible_count / kUnifiedFeaturePodItemsInRow) int number_of_lines = (visible_count + kUnifiedFeaturePodItemsInRow - 1) / kUnifiedFeaturePodItemsInRow; + + if (features::IsSystemTrayFeaturePodsPaginationEnabled()) + number_of_lines = std::min(number_of_lines, kUnifiedFeaturePodItemsRows); + return kUnifiedFeaturePodBottomPadding + (kUnifiedFeaturePodVerticalPadding + kUnifiedFeaturePodSize.height()) * number_of_lines; @@ -83,27 +100,10 @@ void FeaturePodsContainerView::Layout() { UpdateCollapsedSidePadding(); - - int visible_count = 0; - for (auto* child : children()) { - if (!child->GetVisible()) - continue; - - gfx::Size child_size; - if (expanded_amount_ > 0.0) { - child_size = kUnifiedFeaturePodSize; - - // Flexibly give more height if the child view doesn't fit into the - // default height, so that label texts won't be broken up in the middle. - child_size.set_height(std::max( - child_size.height(), child->GetHeightForWidth(child_size.height()))); - } else { - child_size = kUnifiedFeaturePodCollapsedSize; - } - - child->SetBoundsRect( - gfx::Rect(GetButtonPosition(visible_count++), child_size)); - child->Layout(); + CalculateIdealBoundsForFeaturePods(); + for (int i = 0; i < visible_buttons_.view_size(); ++i) { + auto* button = visible_buttons_.view_at(i); + button->SetBoundsRect(visible_buttons_.ideal_bounds(i)); } } @@ -114,17 +114,28 @@ int visible_count = 0; for (auto* view : children()) { auto* child = static_cast<FeaturePodButton*>(view); - bool visible = child->visible_preferred() && - (expanded_amount_ > 0.0 || - visible_count < kUnifiedFeaturePodMaxItemsInCollapsed); + bool visible = IsButtonVisible(child, visible_count); child->SetVisibleByContainer(visible); - if (visible) + if (visible) { + if (visible_buttons_.GetIndexOfView(child) < 0) + visible_buttons_.Add(child, visible_count); ++visible_count; + } else { + if (visible_buttons_.GetIndexOfView(child)) + visible_buttons_.Remove(visible_buttons_.GetIndexOfView(child)); + } } - + UpdateTotalPages(); changing_visibility_ = false; } +bool FeaturePodsContainerView::IsButtonVisible(FeaturePodButton* button, + int index) { + return button->visible_preferred() && + (expanded_amount_ > 0.0 || + index < kUnifiedFeaturePodMaxItemsInCollapsed); +} + int FeaturePodsContainerView::GetVisibleCount() const { return std::count_if( children().cbegin(), children().cend(), [](const auto* v) { @@ -182,4 +193,106 @@ DCHECK(collapsed_side_padding_ > 0); } +void FeaturePodsContainerView::AddFeaturePodButton(FeaturePodButton* button) { + int view_size = visible_buttons_.view_size(); + if (IsButtonVisible(button, view_size)) { + visible_buttons_.Add(button, view_size); + } + AddChildView(button); + + UpdateTotalPages(); +} + +const gfx::Vector2d FeaturePodsContainerView::CalculateTransitionOffset( + int page_of_view) const { + gfx::Size grid_size = CalculatePreferredSize(); + + // If there is a transition, calculates offset for current and target page. + const int current_page = pagination_model_->selected_page(); + const PaginationModel::Transition& transition = + pagination_model_->transition(); + const bool is_valid = + pagination_model_->is_valid_page(transition.target_page); + + // Transition to previous page means negative offset. + const int direction = transition.target_page > current_page ? -1 : 1; + + int x_offset = 0; + int y_offset = 0; + + // Page size including padding pixels. A tile.x + page_width means the same + // tile slot in the next page. + const int page_width = grid_size.width() + kUnifiedFeaturePodsPageSpacing; + if (page_of_view < current_page) + x_offset = -page_width; + else if (page_of_view > current_page) + x_offset = page_width; + + if (is_valid) { + if (page_of_view == current_page || + page_of_view == transition.target_page) { + x_offset += transition.progress * page_width * direction; + } + } + + return gfx::Vector2d(x_offset, y_offset); +} + +void FeaturePodsContainerView::CalculateIdealBoundsForFeaturePods() { + for (int i = 0; i < visible_buttons_.view_size(); ++i) { + gfx::Rect tile_bounds; + gfx::Size child_size; + if (expanded_amount_ > 0.0) { + child_size = kUnifiedFeaturePodSize; + + // Flexibly give more height if the child view doesn't fit into the + // default height, so that label texts won't be broken up in the middle. + child_size.set_height(std::max( + child_size.height(), + visible_buttons_.view_at(i)->GetHeightForWidth(child_size.height()))); + + tile_bounds = + gfx::Rect(GetButtonPosition(i % GetTilesPerPage()), child_size); + // TODO(amehfooz): refactor this logic so that the ideal_bounds are set + // once when the transition starts and the actual feature pod bounds are + // interpolated using the ideal_bounds as the transition progresses. + tile_bounds.Offset(CalculateTransitionOffset(i / GetTilesPerPage())); + } else { + child_size = kUnifiedFeaturePodCollapsedSize; + tile_bounds = gfx::Rect(GetButtonPosition(i), child_size); + } + + visible_buttons_.set_ideal_bounds(i, tile_bounds); + } +} + +int FeaturePodsContainerView::GetTilesPerPage() const { + if (features::IsSystemTrayFeaturePodsPaginationEnabled()) + return kUnifiedFeaturePodItemsInRow * kUnifiedFeaturePodItemsRows; + else + return children().size(); +} + +void FeaturePodsContainerView::UpdateTotalPages() { + int total_pages = 0; + + int total_visible = visible_buttons_.view_size(); + int tiles_per_page = GetTilesPerPage(); + + if (!visible_buttons_.view_size() || !tiles_per_page) { + total_pages = 0; + } else { + total_pages = (total_visible / tiles_per_page) + + (total_visible % tiles_per_page ? 1 : 0); + } + pagination_model_->SetTotalPages(total_pages); +} + +void FeaturePodsContainerView::TransitionChanged() { + const PaginationModel::Transition& transition = + pagination_model_->transition(); + if (pagination_model_->is_valid_page(transition.target_page)) + Layout(); +} + } // namespace ash
diff --git a/ash/system/unified/feature_pods_container_view.h b/ash/system/unified/feature_pods_container_view.h index c93737e6..ce47cc5 100644 --- a/ash/system/unified/feature_pods_container_view.h +++ b/ash/system/unified/feature_pods_container_view.h
@@ -6,20 +6,32 @@ #define ASH_SYSTEM_UNIFIED_FEATURE_PODS_CONTAINER_VIEW_H_ #include "ash/ash_export.h" +#include "ash/public/cpp/pagination/pagination_model_observer.h" #include "ui/views/view.h" +#include "ui/views/view_model.h" namespace ash { +class FeaturePodButton; +class PaginationModel; +class UnifiedSystemTrayController; + // Container of feature pods buttons in the middle of UnifiedSystemTrayView. // The container has number of buttons placed in 3x3 plane at regular distances. // FeaturePodButtons implements these individual buttons. // The container also implements collapsed state where the top 5 buttons are // horizontally placed and others are hidden. -class ASH_EXPORT FeaturePodsContainerView : public views::View { +class ASH_EXPORT FeaturePodsContainerView : public views::View, + public PaginationModelObserver { public: - explicit FeaturePodsContainerView(bool initially_expanded); + FeaturePodsContainerView(UnifiedSystemTrayController* controller, + bool initially_expanded); ~FeaturePodsContainerView() override; + // Add a FeaturePodButton as a child view and if it's visible add it to the + // view structure and update the pagination model. + void AddFeaturePodButton(FeaturePodButton* button); + // Change the expanded state. 0.0 if collapsed, and 1.0 if expanded. // Otherwise, it shows intermediate state. If collapsed, all the buttons are // horizontally placed. @@ -47,15 +59,41 @@ void Layout() override; private: - void UpdateChildVisibility(); + friend class FeaturePodsContainerViewTest; // Calculate the current position of the button from |visible_index| and // |expanded_amount_|. gfx::Point GetButtonPosition(int visible_index) const; + void UpdateChildVisibility(); + // Update |collapsed_state_padding_|. void UpdateCollapsedSidePadding(); + // Calculates the ideal bounds for all feature pods. + void CalculateIdealBoundsForFeaturePods(); + + // Calculates the offset for |page_of_view| based on current page and + // transition target page. + const gfx::Vector2d CalculateTransitionOffset(int page_of_view) const; + + // Returns true if button at provided index is visible. + bool IsButtonVisible(FeaturePodButton* button, int index); + + // Returns the number of tiles per page. + int GetTilesPerPage() const; + + // Updates page splits for feature pod buttons. + void UpdateTotalPages(); + + // PaginationModelObserver: + void TransitionChanged() override; + + UnifiedSystemTrayController* controller_; + + // Owned by UnifiedSystemTrayModel. + PaginationModel* pagination_model_; + // The last |expanded_amount| passed to SetExpandedAmount(). double expanded_amount_; @@ -69,6 +107,10 @@ // A button that had focus at the point SaveButtonFocus is called. views::View* focused_button_ = nullptr; + // A view model that contains all visible feature pod buttons. + // Used to calculate required number of pages. + views::ViewModelT<FeaturePodButton> visible_buttons_; + DISALLOW_COPY_AND_ASSIGN(FeaturePodsContainerView); };
diff --git a/ash/system/unified/feature_pods_container_view_unittest.cc b/ash/system/unified/feature_pods_container_view_unittest.cc index ad9fbfe..0249a2c5 100644 --- a/ash/system/unified/feature_pods_container_view_unittest.cc +++ b/ash/system/unified/feature_pods_container_view_unittest.cc
@@ -4,15 +4,20 @@ #include "ash/system/unified/feature_pods_container_view.h" +#include "ash/public/cpp/ash_features.h" +#include "ash/public/cpp/pagination/pagination_model.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/unified/feature_pod_button.h" #include "ash/system/unified/feature_pod_controller_base.h" +#include "ash/system/unified/unified_system_tray_controller.h" +#include "ash/system/unified/unified_system_tray_model.h" #include "ash/test/ash_test_base.h" +#include "base/test/scoped_feature_list.h" #include "ui/views/view_observer.h" namespace ash { -class FeaturePodsContainerViewTest : public AshTestBase, +class FeaturePodsContainerViewTest : public NoSessionAshTestBase, public FeaturePodControllerBase, public views::ViewObserver { public: @@ -22,10 +27,21 @@ // AshTestBase: void SetUp() override { AshTestBase::SetUp(); + model_ = std::make_unique<UnifiedSystemTrayModel>(); + controller_ = std::make_unique<UnifiedSystemTrayController>(model_.get()); container_ = std::make_unique<FeaturePodsContainerView>( - true /* initially_expanded */); + controller_.get(), true /* initially_expanded */); container_->AddObserver(this); preferred_size_changed_count_ = 0; + + scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); + } + + void TearDown() override { + controller_.reset(); + container_.reset(); + model_.reset(); + NoSessionAshTestBase::TearDown(); } // FeaturePodControllerBase: @@ -41,6 +57,11 @@ } protected: + void EnablePagination() { + scoped_feature_list_->InitAndEnableFeature( + features::kSystemTrayFeaturePodsPagination); + } + void AddButtons(int count) { for (int i = 0; i < count; ++i) { buttons_.push_back(new FeaturePodButton(this)); @@ -52,6 +73,8 @@ FeaturePodsContainerView* container() { return container_.get(); } + PaginationModel* pagination_model() { return model_->pagination_model(); } + int preferred_size_changed_count() const { return preferred_size_changed_count_; } @@ -59,7 +82,10 @@ std::vector<FeaturePodButton*> buttons_; private: + std::unique_ptr<base::test::ScopedFeatureList> scoped_feature_list_; std::unique_ptr<FeaturePodsContainerView> container_; + std::unique_ptr<UnifiedSystemTrayModel> model_; + std::unique_ptr<UnifiedSystemTrayController> controller_; int preferred_size_changed_count_ = 0; DISALLOW_COPY_AND_ASSIGN(FeaturePodsContainerViewTest); @@ -164,4 +190,59 @@ EXPECT_EQ(2, preferred_size_changed_count()); } +TEST_F(FeaturePodsContainerViewTest, NumberOfPagesChanged) { + const int kNumberOfPages = 8; + + EnablePagination(); + AddButtons(kUnifiedFeaturePodItemsInRow * kUnifiedFeaturePodItemsRows * + kNumberOfPages); + + // Adding buttons to fill kNumberOfPages should cause the the same number of + // pages to be created. + EXPECT_EQ(kNumberOfPages, pagination_model()->total_pages()); + + // Adding an additional button causes a new page to be added. + AddButtons(1); + EXPECT_EQ(pagination_model()->total_pages(), kNumberOfPages + 1); +} + +TEST_F(FeaturePodsContainerViewTest, PaginationTransition) { + const int kNumberOfPages = 8; + + EnablePagination(); + AddButtons(kUnifiedFeaturePodItemsInRow * kUnifiedFeaturePodItemsRows * + kNumberOfPages); + + // Position of a button should slide to the left during a page + // transition to the next page. + gfx::Rect current_bounds; + gfx::Rect initial_bounds = buttons_[0]->bounds(); + gfx::Rect previous_bounds = initial_bounds; + + PaginationModel::Transition transition( + pagination_model()->selected_page() + 1, 0); + + for (double i = 0.1; i <= 1.0; i += 0.1) { + transition.progress = i; + pagination_model()->SetTransition(transition); + + current_bounds = buttons_[0]->bounds(); + + EXPECT_LT(current_bounds.x(), previous_bounds.x()); + EXPECT_EQ(current_bounds.y(), previous_bounds.y()); + + previous_bounds = current_bounds; + } + + // Button Position after page switch should move to the left by a page offset. + int page_offset = container()->CalculatePreferredSize().width() + + kUnifiedFeaturePodsPageSpacing; + gfx::Rect final_bounds = + gfx::Rect(initial_bounds.x() - page_offset, initial_bounds.y(), + initial_bounds.width(), initial_bounds.height()); + pagination_model()->SelectPage(1, false); + container()->Layout(); + EXPECT_EQ(final_bounds, buttons_[0]->bounds()); +} + } // namespace ash
diff --git a/ash/system/unified/unified_system_tray_view.cc b/ash/system/unified/unified_system_tray_view.cc index c78e6210..1270e1c4 100644 --- a/ash/system/unified/unified_system_tray_view.cc +++ b/ash/system/unified/unified_system_tray_view.cc
@@ -16,6 +16,7 @@ #include "ash/system/unified/feature_pod_button.h" #include "ash/system/unified/feature_pods_container_view.h" #include "ash/system/unified/notification_hidden_view.h" +#include "ash/system/unified/page_indicator_view.h" #include "ash/system/unified/top_shortcuts_view.h" #include "ash/system/unified/unified_system_info_view.h" #include "ash/system/unified/unified_system_tray_controller.h" @@ -220,7 +221,10 @@ controller_(controller), notification_hidden_view_(new NotificationHiddenView()), top_shortcuts_view_(new TopShortcutsView(controller_)), - feature_pods_container_(new FeaturePodsContainerView(initially_expanded)), + feature_pods_container_( + new FeaturePodsContainerView(controller_, initially_expanded)), + page_indicator_view_( + new PageIndicatorView(controller_, initially_expanded)), sliders_container_(new UnifiedSlidersContainerView(initially_expanded)), system_info_view_(new UnifiedSystemInfoView(controller_)), system_tray_container_(new SystemTrayContainer()), @@ -255,6 +259,7 @@ system_tray_container_->AddChildView(top_shortcuts_view_); system_tray_container_->AddChildView(feature_pods_container_); + system_tray_container_->AddChildView(page_indicator_view_); system_tray_container_->AddChildView(sliders_container_); system_tray_container_->AddChildView(system_info_view_); @@ -288,7 +293,7 @@ } void UnifiedSystemTrayView::AddFeaturePodButton(FeaturePodButton* button) { - feature_pods_container_->AddChildView(button); + feature_pods_container_->AddFeaturePodButton(button); } void UnifiedSystemTrayView::AddSliderView(views::View* slider_view) { @@ -335,6 +340,7 @@ top_shortcuts_view_->SetExpandedAmount(expanded_amount); feature_pods_container_->SetExpandedAmount(expanded_amount); + page_indicator_view_->SetExpandedAmount(expanded_amount); sliders_container_->SetExpandedAmount(expanded_amount); if (!IsTransformEnabled()) { @@ -358,6 +364,7 @@ : 0) + top_shortcuts_view_->GetPreferredSize().height() + feature_pods_container_->GetExpandedHeight() + + page_indicator_view_->GetPreferredSize().height() + sliders_container_->GetExpandedHeight() + system_info_view_->GetPreferredSize().height(); }
diff --git a/ash/system/unified/unified_system_tray_view.h b/ash/system/unified/unified_system_tray_view.h index fb1e556..423a5ff 100644 --- a/ash/system/unified/unified_system_tray_view.h +++ b/ash/system/unified/unified_system_tray_view.h
@@ -15,6 +15,7 @@ class FeaturePodsContainerView; class TopShortcutsView; class NotificationHiddenView; +class PageIndicatorView; class UnifiedMessageCenterView; class UnifiedSystemInfoView; class UnifiedSystemTrayController; @@ -147,6 +148,7 @@ NotificationHiddenView* const notification_hidden_view_; TopShortcutsView* const top_shortcuts_view_; FeaturePodsContainerView* const feature_pods_container_; + PageIndicatorView* const page_indicator_view_; UnifiedSlidersContainerView* const sliders_container_; UnifiedSystemInfoView* const system_info_view_; views::View* const system_tray_container_;
diff --git a/ash/wayland/wayland_server_controller.cc b/ash/wayland/wayland_server_controller.cc index 6394106..7f0268204 100644 --- a/ash/wayland/wayland_server_controller.cc +++ b/ash/wayland/wayland_server_controller.cc
@@ -18,22 +18,19 @@ #include "components/exo/wayland/wayland_watcher.h" #include "components/exo/wm_helper.h" #include "components/exo/wm_helper_chromeos.h" -#include "ui/aura/env.h" namespace ash { // static std::unique_ptr<WaylandServerController> WaylandServerController::CreateIfNecessary( - std::unique_ptr<exo::FileHelper> file_helper, - aura::Env* env) { + std::unique_ptr<exo::FileHelper> file_helper) { if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAshEnableWaylandServer)) { return nullptr; } - return base::WrapUnique( - new WaylandServerController(std::move(file_helper), env)); + return base::WrapUnique(new WaylandServerController(std::move(file_helper))); } WaylandServerController::~WaylandServerController() { @@ -45,13 +42,12 @@ } WaylandServerController::WaylandServerController( - std::unique_ptr<exo::FileHelper> file_helper, - aura::Env* env) { + std::unique_ptr<exo::FileHelper> file_helper) { arc_notification_surface_manager_ = std::make_unique<ArcNotificationSurfaceManagerImpl>(); arc_input_method_surface_manager_ = std::make_unique<ArcInputMethodSurfaceManager>(); - wm_helper_ = std::make_unique<exo::WMHelperChromeOS>(env); + wm_helper_ = std::make_unique<exo::WMHelperChromeOS>(); exo::WMHelper::SetInstance(wm_helper_.get()); display_ = std::make_unique<exo::Display>( arc_notification_surface_manager_.get(),
diff --git a/ash/wayland/wayland_server_controller.h b/ash/wayland/wayland_server_controller.h index 3278b229b..99a005e 100644 --- a/ash/wayland/wayland_server_controller.h +++ b/ash/wayland/wayland_server_controller.h
@@ -9,10 +9,6 @@ #include "base/macros.h" -namespace aura { -class Env; -} - namespace exo { class Display; class FileHelper; @@ -34,8 +30,7 @@ // Creates WaylandServerController. Returns null if controller should not be // created. static std::unique_ptr<WaylandServerController> CreateIfNecessary( - std::unique_ptr<exo::FileHelper> file_helper, - aura::Env* env); + std::unique_ptr<exo::FileHelper> file_helper); ~WaylandServerController(); @@ -44,8 +39,8 @@ } private: - WaylandServerController(std::unique_ptr<exo::FileHelper> file_helper, - aura::Env* env); + explicit WaylandServerController( + std::unique_ptr<exo::FileHelper> file_helper); std::unique_ptr<exo::WMHelper> wm_helper_; std::unique_ptr<exo::Display> display_;
diff --git a/ash/wm/overview/overview_grid.cc b/ash/wm/overview/overview_grid.cc index cee6e837..08af48c 100644 --- a/ash/wm/overview/overview_grid.cc +++ b/ash/wm/overview/overview_grid.cc
@@ -51,6 +51,7 @@ #include "ui/compositor_extra/shadow.h" #include "ui/gfx/geometry/safe_integer_conversions.h" #include "ui/gfx/geometry/vector2d.h" +#include "ui/gfx/geometry/vector2d_conversions.h" #include "ui/views/background.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" @@ -421,6 +422,10 @@ DCHECK_NE(transition, OverviewSession::OverviewTransition::kExit); std::vector<gfx::RectF> rects = GetWindowRects(ignored_items); + if (transition == OverviewSession::OverviewTransition::kEnter) { + CalculateWindowListAnimationStates(/*selected_item=*/nullptr, transition, + rects); + } // Position the windows centering the left-aligned rows vertically. Do not // position items in |ignored_items|. @@ -1014,57 +1019,89 @@ void OverviewGrid::CalculateWindowListAnimationStates( OverviewItem* selected_item, - OverviewSession::OverviewTransition transition) { - // |selected_item| is nullptr during entering animation. - DCHECK(transition == OverviewSession::OverviewTransition::kExit || - selected_item == nullptr); + OverviewSession::OverviewTransition transition, + const std::vector<gfx::RectF>& target_bounds) { + using OverviewTransition = OverviewSession::OverviewTransition; - bool has_covered_available_workspace = false; - bool has_checked_selected_item = false; - if (!selected_item || - !wm::GetWindowState(selected_item->GetWindow())->IsFullscreen()) { - // Check the always on top window first if |selected_item| is nullptr or the - // |selected_item|'s window is not fullscreen. Because always on top windows - // are visible and may have a window which can cover available workspace. - // If the |selected_item| is fullscreen, we will depromote all always on top - // windows. - aura::Window* always_on_top_container = - RootWindowController::ForWindow(root_window_) - ->GetContainer(kShellWindowId_AlwaysOnTopContainer); - aura::Window::Windows top_windows = always_on_top_container->children(); - for (aura::Window::Windows::const_reverse_iterator - it = top_windows.rbegin(), - rend = top_windows.rend(); - it != rend; ++it) { - aura::Window* top_window = *it; - OverviewItem* container_item = GetOverviewItemContaining(top_window); - if (!container_item) - continue; + // Sanity checks to enforce assumptions used in later codes. + switch (transition) { + case OverviewTransition::kEnter: + DCHECK_EQ(target_bounds.size(), window_list_.size()); + break; + case OverviewTransition::kExit: + DCHECK(target_bounds.empty()); + break; + default: + NOTREACHED(); + } - const bool is_selected_item = (selected_item == container_item); - if (!has_checked_selected_item && is_selected_item) - has_checked_selected_item = true; - CalculateOverviewItemAnimationState( - container_item, &has_covered_available_workspace, - /*selected=*/is_selected_item, transition); + // Create a copy of |window_list_| which has always on top windows in the + // front. + std::vector<OverviewItem*> items; + std::transform( + window_list_.begin(), window_list_.end(), std::back_inserter(items), + [](const std::unique_ptr<OverviewItem>& item) -> OverviewItem* { + return item.get(); + }); + // Sort items by: + // 1) Selected items that are always on top windows. + // 2) Other always on top windows. + // 3) Selected items that are not always on top windows. + // 4) Other not always on top windows. + // Preserves ordering if the category is the same. + std::sort(items.begin(), items.end(), + [&selected_item](OverviewItem* a, OverviewItem* b) { + const bool a_on_top = + a->GetWindow()->GetProperty(aura::client::kAlwaysOnTopKey); + const bool b_on_top = + b->GetWindow()->GetProperty(aura::client::kAlwaysOnTopKey); + if (selected_item && a_on_top && b_on_top) + return a == selected_item; + if (a_on_top) + return true; + if (b_on_top) + return false; + if (selected_item) + return a == selected_item; + return false; + }); + + SkRegion occluded_region; + for (size_t i = 0; i < items.size(); ++i) { + const bool minimized = + wm::GetWindowState(items[i]->GetWindow())->IsMinimized(); + bool src_occluded = minimized; + bool dst_occluded = false; + gfx::Rect src_bounds_temp = + minimized ? gfx::Rect() + : items[i]->GetWindow()->GetBoundsInRootWindow(); + // On exiting overview, |GetBoundsInRootWindow| will have the overview + // translation applied to it, so undo it to get the true target bounds. + if (!src_bounds_temp.IsEmpty() && transition == OverviewTransition::kExit) { + const gfx::Vector2dF offset = + -items[i]->GetWindow()->transform().To2dTranslation(); + src_bounds_temp.Offset(gfx::ToCeiledVector2d(offset)); } - } + SkIRect src_bounds = gfx::RectToSkIRect(src_bounds_temp); + SkIRect dst_bounds = gfx::RectToSkIRect(gfx::ToEnclosedRect( + transition == OverviewTransition::kEnter ? target_bounds[i] + : items[i]->target_bounds())); - if (!has_checked_selected_item) { - CalculateOverviewItemAnimationState(selected_item, - &has_covered_available_workspace, - /*selected=*/true, transition); - } - for (const auto& item : window_list_) { - // Has checked the |selected_item|. - if (selected_item == item.get()) - continue; - // Has checked all always on top windows. - if (item->GetWindow()->GetProperty(aura::client::kAlwaysOnTopKey)) - continue; - CalculateOverviewItemAnimationState(item.get(), - &has_covered_available_workspace, - /*selected=*/false, transition); + if (!occluded_region.isEmpty()) { + src_occluded |= + (!src_bounds.isEmpty() && occluded_region.contains(src_bounds)); + dst_occluded |= occluded_region.contains(dst_bounds); + } + + // Add |src_bounds| to our region if it is not empty (minimized window). + if (!src_bounds.isEmpty()) + occluded_region.op(src_bounds, SkRegion::kUnion_Op); + + const bool should_animate = !(src_occluded && dst_occluded); + if (transition == OverviewSession::OverviewTransition::kEnter) + items[i]->set_should_animate_when_entering(should_animate); + else if (transition == OverviewSession::OverviewTransition::kExit) + items[i]->set_should_animate_when_exiting(should_animate); } } @@ -1611,29 +1648,6 @@ return true; } -void OverviewGrid::CalculateOverviewItemAnimationState( - OverviewItem* overview_item, - bool* has_covered_available_workspace, - bool selected, - OverviewSession::OverviewTransition transition) { - if (!overview_item) - return; - - aura::Window* window = overview_item->GetWindow(); - // |overview_item| should be contained in the |window_list_|. - DCHECK(GetOverviewItemContaining(window)); - - bool can_cover_available_workspace = CanCoverAvailableWorkspace(window); - const bool should_animate = selected || !(*has_covered_available_workspace); - if (transition == OverviewSession::OverviewTransition::kEnter) - overview_item->set_should_animate_when_entering(should_animate); - if (transition == OverviewSession::OverviewTransition::kExit) - overview_item->set_should_animate_when_exiting(should_animate); - - if (!(*has_covered_available_workspace) && can_cover_available_workspace) - *has_covered_available_workspace = true; -} - std::vector<std::unique_ptr<OverviewItem>>::iterator OverviewGrid::GetOverviewItemIterContainingWindow(aura::Window* window) { return std::find_if(window_list_.begin(), window_list_.end(),
diff --git a/ash/wm/overview/overview_grid.h b/ash/wm/overview/overview_grid.h index ef695a1..ee3a022e 100644 --- a/ash/wm/overview/overview_grid.h +++ b/ash/wm/overview/overview_grid.h
@@ -202,10 +202,13 @@ // |should_animate_when_exiting_| of the overview items based on where // the first MRU window covering the available workspace is found. // |selected_item| is not nullptr if |selected_item| is the selected item when - // exiting overview mode. + // exiting overview mode. |target_bounds| are the bounds that the items will + // be in overview. If |tranisition| is exit, |target_bounds| should be empty + // and the overview bounds should be queried from |window_list_|. void CalculateWindowListAnimationStates( OverviewItem* selected_item, - OverviewSession::OverviewTransition transition); + OverviewSession::OverviewTransition transition, + const std::vector<gfx::RectF>& target_bounds); // Do not animate the entire window list during exiting the overview. It's // used when splitview and overview mode are both active, selecting a window @@ -345,15 +348,6 @@ int* out_min_right, int* out_max_right); - // Calculates |overview_item|'s |should_animate_when_entering_|, - // |should_animate_when_exiting_|. |selected| is true if |overview_item| is - // the selected item when exiting overview mode. - void CalculateOverviewItemAnimationState( - OverviewItem* overview_item, - bool* has_fullscreen_coverred, - bool selected, - OverviewSession::OverviewTransition transition); - // Returns the overview item iterator that contains |window|. std::vector<std::unique_ptr<OverviewItem>>::iterator GetOverviewItemIterContainingWindow(aura::Window* window);
diff --git a/ash/wm/overview/overview_grid_unittest.cc b/ash/wm/overview/overview_grid_unittest.cc new file mode 100644 index 0000000..00db08f7 --- /dev/null +++ b/ash/wm/overview/overview_grid_unittest.cc
@@ -0,0 +1,188 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/wm/overview/overview_grid.h" + +#include "ash/screen_util.h" +#include "ash/shell.h" +#include "ash/test/ash_test_base.h" +#include "ash/wm/overview/overview_item.h" +#include "ash/wm/window_state.h" +#include "base/strings/string_number_conversions.h" +#include "ui/aura/client/aura_constants.h" +#include "ui/aura/window.h" +#include "ui/display/display.h" +#include "ui/display/manager/display_manager.h" +#include "ui/display/screen.h" + +namespace ash { + +using OverviewTransition = OverviewSession::OverviewTransition; + +class OverviewGridTest : public AshTestBase { + public: + OverviewGridTest() = default; + ~OverviewGridTest() override = default; + + void InitializeGrid(const std::vector<aura::Window*>& windows) { + ASSERT_FALSE(grid_); + aura::Window* root = Shell::GetPrimaryRootWindow(); + grid_ = std::make_unique<OverviewGrid>( + root, windows, nullptr, + screen_util::GetDisplayWorkAreaBoundsInParentForActiveDeskContainer( + root)); + } + + void CheckAnimationStates( + const std::vector<aura::Window*>& windows, + const std::vector<gfx::RectF>& target_bounds, + const std::vector<bool>& expected_start_animations, + const std::vector<bool>& expected_end_animations, + base::Optional<size_t> selected_window_index = base::nullopt) { + ASSERT_EQ(windows.size(), target_bounds.size()); + ASSERT_EQ(windows.size(), expected_start_animations.size()); + ASSERT_EQ(windows.size(), expected_end_animations.size()); + + InitializeGrid(windows); + ASSERT_EQ(windows.size(), grid_->window_list().size()); + + // The default values are to animate. + for (const auto& item : grid_->window_list()) { + SCOPED_TRACE("Initial values"); + EXPECT_TRUE(item->should_animate_when_entering()); + EXPECT_TRUE(item->should_animate_when_exiting()); + } + + grid_->CalculateWindowListAnimationStates( + /*selected_item=*/nullptr, OverviewTransition::kEnter, target_bounds); + for (size_t i = 0; i < grid_->window_list().size(); ++i) { + SCOPED_TRACE("Enter animation, window " + base::NumberToString(i + 1)); + EXPECT_EQ(expected_start_animations[i], + grid_->window_list()[i]->should_animate_when_entering()); + } + + for (size_t i = 0; i < grid_->window_list().size(); ++i) + grid_->window_list()[i]->set_target_bounds_for_testing(target_bounds[i]); + OverviewItem* selected_item = + selected_window_index + ? grid_->window_list()[*selected_window_index].get() + : nullptr; + grid_->CalculateWindowListAnimationStates(selected_item, + OverviewTransition::kExit, {}); + for (size_t i = 0; i < grid_->window_list().size(); ++i) { + SCOPED_TRACE("Exit animation, window " + base::NumberToString(i + 1)); + EXPECT_EQ(expected_end_animations[i], + grid_->window_list()[i]->should_animate_when_exiting()); + } + } + + private: + std::unique_ptr<OverviewGrid> grid_; + + DISALLOW_COPY_AND_ASSIGN(OverviewGridTest); +}; + +// Tests that with only one window, we always animate. +TEST_F(OverviewGridTest, AnimateWithSingleWindow) { + auto window = CreateTestWindow(gfx::Rect(100, 100)); + CheckAnimationStates({window.get()}, {gfx::RectF(100.f, 100.f)}, {true}, + {true}); +} + +// Tests that if both the source and destination is hidden, there are no +// animations on the second window. +TEST_F(OverviewGridTest, SourceDestinationBothHidden) { + auto window1 = CreateTestWindow(gfx::Rect(400, 400)); + auto window2 = CreateTestWindow(gfx::Rect(100, 100)); + std::vector<gfx::RectF> target_bounds = {gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f)}; + CheckAnimationStates({window1.get(), window2.get()}, target_bounds, + {true, false}, {true, false}); +} + +// Tests that are animations if the destination bounds are shown. +TEST_F(OverviewGridTest, SourceHiddenDestinationShown) { + auto window1 = CreateTestWindow(gfx::Rect(400, 400)); + auto window2 = CreateTestWindow(gfx::Rect(100, 100)); + std::vector<gfx::RectF> target_bounds = { + gfx::RectF(100.f, 100.f), gfx::RectF(400.f, 400.f, 100.f, 100.f)}; + CheckAnimationStates({window1.get(), window2.get()}, target_bounds, + {true, true}, {true, true}); +} + +// Tests that are animations if the source bounds are shown. +TEST_F(OverviewGridTest, SourceShownDestinationHidden) { + auto window1 = CreateTestWindow(gfx::Rect(100, 100)); + auto window2 = CreateTestWindow(gfx::Rect(400, 400)); + std::vector<gfx::RectF> target_bounds = {gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f)}; + CheckAnimationStates({window1.get(), window2.get()}, target_bounds, + {true, true}, {true, true}); +} + +// Tests that a window that is in the union of two other windows, but is still +// shown will be animated. +TEST_F(OverviewGridTest, SourceShownButInTheUnionOfTwoOtherWindows) { + // Create three windows, the union of the first two windows will be + // gfx::Rect(0,0,200,200). Window 3 will be in that union, but should still + // animate since its not fully occluded. + auto window1 = CreateTestWindow(gfx::Rect(100, 100)); + auto window2 = CreateTestWindow(gfx::Rect(50, 50, 150, 150)); + auto window3 = CreateTestWindow(gfx::Rect(50, 200)); + std::vector<gfx::RectF> target_bounds = {gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f)}; + CheckAnimationStates({window1.get(), window2.get(), window3.get()}, + target_bounds, {true, true, true}, {true, true, true}); +} + +// Tests that an always on top window will take precedence over a normal +// window. +TEST_F(OverviewGridTest, AlwaysOnTopWindow) { + // Create two windows, the second is always on top and covers the first + // window. So the first window will not animate. + auto window1 = CreateTestWindow(gfx::Rect(100, 100)); + auto window2 = CreateTestWindow(gfx::Rect(400, 400)); + window2->SetProperty(aura::client::kAlwaysOnTopKey, true); + std::vector<gfx::RectF> target_bounds = {gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f)}; + CheckAnimationStates({window1.get(), window2.get()}, target_bounds, + {false, true}, {false, true}); +} + +// Tests that windows that are minimized are animated as expected. +TEST_F(OverviewGridTest, MinimizedWindows) { + // Create 3 windows with the second and third windows being minimized. Both + // the minimized window bounds are not occluded but only the third window is + // animated because the target bounds for the first window is blocked. + auto window1 = CreateTestWindow(gfx::Rect(100, 100)); + auto window2 = CreateTestWindow(gfx::Rect(400, 400)); + auto window3 = CreateTestWindow(gfx::Rect(400, 400)); + wm::GetWindowState(window2.get())->Minimize(); + wm::GetWindowState(window3.get())->Minimize(); + std::vector<gfx::RectF> target_bounds = {gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f), + gfx::RectF(200.f, 200.f)}; + CheckAnimationStates({window1.get(), window2.get(), window3.get()}, + target_bounds, {true, false, true}, {true, false, true}); +} + +TEST_F(OverviewGridTest, SelectedWindow) { + // Create 3 windows with the third window being maximized. All windows are + // visible on entering, so they should all be animated. On exit we select the + // third window which is maximized, so the other two windows should not + // animate. + auto window1 = CreateTestWindow(gfx::Rect(100, 100)); + auto window2 = CreateTestWindow(gfx::Rect(400, 400)); + auto window3 = CreateTestWindow(gfx::Rect(400, 400)); + wm::GetWindowState(window3.get())->Maximize(); + std::vector<gfx::RectF> target_bounds = {gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f), + gfx::RectF(100.f, 100.f)}; + CheckAnimationStates({window1.get(), window2.get(), window3.get()}, + target_bounds, {true, true, true}, {false, false, true}, + base::make_optional(2u)); +} + +} // namespace ash
diff --git a/ash/wm/overview/overview_item.h b/ash/wm/overview/overview_item.h index 274beec8..d9d097c 100644 --- a/ash/wm/overview/overview_item.h +++ b/ash/wm/overview/overview_item.h
@@ -242,6 +242,9 @@ RoundedLabelWidget* cannot_snap_widget_for_testing() { return cannot_snap_widget_.get(); } + void set_target_bounds_for_testing(const gfx::RectF& target_bounds) { + target_bounds_ = target_bounds; + } private: friend class OverviewSessionRoundedCornerTest;
diff --git a/ash/wm/overview/overview_session.cc b/ash/wm/overview/overview_session.cc index 72ddae3a..1ceaf3a 100644 --- a/ash/wm/overview/overview_session.cc +++ b/ash/wm/overview/overview_session.cc
@@ -243,8 +243,6 @@ // should not appear here. DCHECK_NE(enter_exit_overview_type_, EnterExitOverviewType::kSwipeFromShelf); - overview_grid->CalculateWindowListAnimationStates( - /*selected_item=*/nullptr, OverviewTransition::kEnter); overview_grid->PositionWindows(/*animate=*/true, /*ignored_items=*/{}, OverviewTransition::kEnter); } @@ -311,7 +309,7 @@ selected_item_->overview_grid() == overview_grid.get() ? selected_item_ : nullptr, - OverviewTransition::kExit); + OverviewTransition::kExit, /*target_bounds=*/{}); } for (const auto& overview_item : overview_grid->window_list()) overview_item->RestoreWindow(/*reset_transform=*/true);
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc index eaa24ef3..1dedbab3 100644 --- a/ash/wm/toplevel_window_event_handler.cc +++ b/ash/wm/toplevel_window_event_handler.cc
@@ -349,7 +349,7 @@ DCHECK_EQ(ui::ET_GESTURE_SCROLL_BEGIN, event->type()); aura::Window::ConvertPointToTarget(target, new_target, &event_location); - original_target->env()->gesture_recognizer()->TransferEventsTo( + aura::Env::GetInstance()->gesture_recognizer()->TransferEventsTo( original_target, new_target, ui::TransferTouchesBehavior::kCancel); UpdateGestureTarget(new_target, event_location); target = new_target; @@ -532,7 +532,7 @@ if (gesture_target_ != nullptr && update_gesture_target) { DCHECK_EQ(source, ::wm::WINDOW_MOVE_SOURCE_TOUCH); // Transfer events for gesture if switching to new target. - window->env()->gesture_recognizer()->TransferEventsTo( + aura::Env::GetInstance()->gesture_recognizer()->TransferEventsTo( gesture_target_, window, ui::TransferTouchesBehavior::kDontCancel); } @@ -567,11 +567,11 @@ DCHECK(root_window); gfx::Point drag_location; if (move_source == ::wm::WINDOW_MOVE_SOURCE_TOUCH && - Shell::Get()->aura_env()->is_touch_down()) { + aura::Env::GetInstance()->is_touch_down()) { gfx::PointF drag_location_f; - bool has_point = - source->env()->gesture_recognizer()->GetLastTouchPointForTarget( - source, &drag_location_f); + bool has_point = aura::Env::GetInstance() + ->gesture_recognizer() + ->GetLastTouchPointForTarget(source, &drag_location_f); drag_location = gfx::ToFlooredPoint(drag_location_f); DCHECK(has_point); } else {
diff --git a/ash/wm/window_mirror_view.cc b/ash/wm/window_mirror_view.cc index d5c56b0e..6a167e5 100644 --- a/ash/wm/window_mirror_view.cc +++ b/ash/wm/window_mirror_view.cc
@@ -112,8 +112,8 @@ // This is done to minimize the amount of work during the initial animation // when entering overview. In particular, telling the remote client it is // visible is likely to result in a fair amount of work. - if (source_->env()->GetWindowOcclusionTracker()->IsPaused()) - env_observer_.Add(target_->env()); + if (aura::Env::GetInstance()->GetWindowOcclusionTracker()->IsPaused()) + env_observer_.Add(aura::Env::GetInstance()); else ForceVisibilityAndOcclusion(); }
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index 57ecd7e..63ca0ac 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc
@@ -93,12 +93,8 @@ bool ShouldUseExtendedBounds(const aura::Window* target) const override { // Fullscreen/maximized windows can't be drag-resized. const WindowState* window_state = GetWindowState(window()); - const WindowState* target_window_state = GetWindowState(target); - if ((window_state && window_state->IsMaximizedOrFullscreenOrPinned()) || - (target_window_state && !target_window_state->CanResize())) { + if (window_state && window_state->IsMaximizedOrFullscreenOrPinned()) return false; - } - // The shrunken hit region only applies to children of |window()|. return target->parent() == window(); }
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc index 892a349..ef71b48c 100644 --- a/ash/wm/window_util_unittest.cc +++ b/ash/wm/window_util_unittest.cc
@@ -8,8 +8,10 @@ #include "ash/wm/window_positioning_utils.h" #include "ash/wm/window_state.h" #include "ash/wm/wm_event.h" +#include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/display/screen.h" +#include "ui/events/base_event_utils.h" #include "ui/wm/core/window_util.h" namespace ash { @@ -214,5 +216,36 @@ EXPECT_TRUE(state->was_visible_on_minimize()); } +TEST_F(WindowUtilTest, InteriorTargeter) { + auto window = CreateTestWindow(); + window->SetBounds(gfx::Rect(0, 0, 100, 100)); + + wm::GetWindowState(window.get())->Maximize(); + InstallResizeHandleWindowTargeterForWindow(window.get()); + + auto* child = aura::test::CreateTestWindowWithDelegateAndType( + aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(), + aura::client::WINDOW_TYPE_UNKNOWN, 1, gfx::Rect(window->bounds().size()), + window.get(), + /*show_on_creation=*/true); + + ui::EventTarget* root_target = window->GetRootWindow(); + auto* targeter = root_target->GetEventTargeter(); + { + ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0), + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); + EXPECT_EQ(child, targeter->FindTargetForEvent(root_target, &mouse)); + } + + // InteriorEventTargeter is now active and should pass an event at the edge to + // its parent. + wm::GetWindowState(window.get())->Restore(); + { + ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0), + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); + EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &mouse)); + } +} + } // namespace wm } // namespace ash
diff --git a/base/immediate_crash_unittest.cc b/base/immediate_crash_unittest.cc index 08685df..8507bbc 100644 --- a/base/immediate_crash_unittest.cc +++ b/base/immediate_crash_unittest.cc
@@ -40,6 +40,9 @@ #endif helper_library_path = helper_library_path.AppendASCII( GetNativeLibraryName("immediate_crash_test_helper")); +#if defined(OS_ANDROID) && defined(COMPONENT_BUILD) + helper_library_path = helper_library_path.ReplaceExtension(".cr.so"); +#endif // TODO(dcheng): Shouldn't GetNativeLibraryName just return a FilePath? NativeLibrary helper_library = LoadNativeLibrary(helper_library_path, &load_error);
diff --git a/base/time/time.h b/base/time/time.h index de4a34f5..661b5661 100644 --- a/base/time/time.h +++ b/base/time/time.h
@@ -990,11 +990,17 @@ #if defined(OS_WIN) FRIEND_TEST_ALL_PREFIXES(TimeTicks, TSCTicksPerSecond); +#if defined(ARCH_CPU_ARM64) + // TSCTicksPerSecond is not supported on Windows on Arm systems because the + // cycle-counting methods use the actual CPU cycle count, and not a consistent + // incrementing counter. +#else // Returns the frequency of the TSC in ticks per second, or 0 if it hasn't // been measured yet. Needs to be guarded with a call to IsSupported(). // This method is declared here rather than in the anonymous namespace to // allow testing. static double TSCTicksPerSecond(); +#endif static bool IsSupportedWin() WARN_UNUSED_RESULT; static void WaitUntilInitializedWin();
diff --git a/base/time/time_win.cc b/base/time/time_win.cc index 47a7dee..ffb4329 100644 --- a/base/time/time_win.cc +++ b/base/time/time_win.cc
@@ -623,6 +623,20 @@ const PlatformThreadHandle& thread_handle) { DCHECK(IsSupported()); +#if defined(ARCH_CPU_ARM64) + // QueryThreadCycleTime versus TSCTicksPerSecond doesn't have much relation to + // actual elapsed time on Windows on Arm, because QueryThreadCycleTime is + // backed by the actual number of CPU cycles executed, rather than a + // constant-rate timer like Intel. To work around this, use GetThreadTimes + // (which isn't as accurate but is meaningful as a measure of elapsed + // per-thread time). + FILETIME creation_time, exit_time, kernel_time, user_time; + ::GetThreadTimes(thread_handle.platform_handle(), &creation_time, &exit_time, + &kernel_time, &user_time); + + int64_t us = FileTimeToMicroseconds(user_time); + return ThreadTicks(us); +#else // Get the number of TSC ticks used by the current thread. ULONG64 thread_cycle_time = 0; ::QueryThreadCycleTime(thread_handle.platform_handle(), &thread_cycle_time); @@ -636,6 +650,7 @@ double thread_time_seconds = thread_cycle_time / tsc_ticks_per_second; return ThreadTicks( static_cast<int64_t>(thread_time_seconds * Time::kMicrosecondsPerSecond)); +#endif } // static @@ -646,23 +661,18 @@ // static void ThreadTicks::WaitUntilInitializedWin() { +#if !defined(ARCH_CPU_ARM64) while (TSCTicksPerSecond() == 0) ::Sleep(10); +#endif } -#if defined(_M_ARM64) && defined(__clang__) -#define ReadCycleCounter() _ReadStatusReg(ARM64_PMCCNTR_EL0) -#else -#define ReadCycleCounter() __rdtsc() -#endif - +#if !defined(ARCH_CPU_ARM64) double ThreadTicks::TSCTicksPerSecond() { DCHECK(IsSupported()); - // The value returned by QueryPerformanceFrequency() cannot be used as the TSC // frequency, because there is no guarantee that the TSC frequency is equal to // the performance counter frequency. - // The TSC frequency is cached in a static variable because it takes some time // to compute it. static double tsc_ticks_per_second = 0; @@ -677,12 +687,12 @@ // The first time that this function is called, make an initial reading of the // TSC and the performance counter. - static const uint64_t tsc_initial = ReadCycleCounter(); + static const uint64_t tsc_initial = __rdtsc(); static const uint64_t perf_counter_initial = QPCNowRaw(); // Make a another reading of the TSC and the performance counter every time // that this function is called. - uint64_t tsc_now = ReadCycleCounter(); + uint64_t tsc_now = __rdtsc(); uint64_t perf_counter_now = QPCNowRaw(); // Reset the thread priority. @@ -715,8 +725,8 @@ return tsc_ticks_per_second; } +#endif // defined(ARCH_CPU_ARM64) -#undef ReadCycleCounter // static TimeTicks TimeTicks::FromQPCValue(LONGLONG qpc_value) { return TimeTicks() + QPCValueToTimeDelta(qpc_value);
diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc index 4969efd..85c88cf 100644 --- a/base/time/time_win_unittest.cc +++ b/base/time/time_win_unittest.cc
@@ -247,6 +247,10 @@ } } +#if !defined(ARCH_CPU_ARM64) +// This test is disabled on Windows ARM64 systems because TSCTicksPerSecond is +// only used in Chromium for QueryThreadCycleTime, and QueryThreadCycleTime +// doesn't use a constant-rate timer on ARM64. TEST(TimeTicks, TSCTicksPerSecond) { if (ThreadTicks::IsSupported()) { ThreadTicks::WaitUntilInitialized(); @@ -269,6 +273,7 @@ 0.005 * processor_mhz_from_registry); } } +#endif TEST(TimeTicks, FromQPCValue) { if (!TimeTicks::IsHighResolution())
diff --git a/build/android/gyp/dex.py b/build/android/gyp/dex.py index cba8c7f..9c551b9 100755 --- a/build/android/gyp/dex.py +++ b/build/android/gyp/dex.py
@@ -105,10 +105,7 @@ multidex_config = json.loads(multidex_config_file.read()) options.multi_dex = multidex_config.get('enabled', False) - if options.multi_dex and not options.main_dex_list_path: - logging.warning('multidex cannot be enabled without --main-dex-list-path') - options.multi_dex = False - elif options.main_dex_list_path and not options.multi_dex: + if options.main_dex_list_path and not options.multi_dex: logging.warning('--main-dex-list-path is unused if multidex is not enabled') if options.inputs: @@ -315,11 +312,11 @@ os.path.relpath(p, options.output_directory) in exclude_paths] input_paths = list(paths) - if options.multi_dex: + if options.multi_dex and options.main_dex_list_path: input_paths.append(options.main_dex_list_path) dex_cmd = ['java', '-jar', options.d8_jar_path, '--no-desugaring'] - if options.multi_dex: + if options.multi_dex and options.main_dex_list_path: dex_cmd += ['--main-dex-list', options.main_dex_list_path] if options.release: dex_cmd += ['--release']
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn index b69d42b..7598c4a 100644 --- a/build/config/android/BUILD.gn +++ b/build/config/android/BUILD.gn
@@ -168,7 +168,7 @@ cflags = [ "-finstrument-function-entry-bare" ] if (use_thin_lto) { # TODO(pcc): This should not be necessary. Remove once - # https://reviews.llvm.org/D50017 lands and gets rolled in. + # https://reviews.llvm.org/D50016 lands and gets rolled in. ldflags = [ "-Wl,-u,__cyg_profile_func_enter_bare" ] } }
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index f40e4157..f080458f 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -8913327733065821920 \ No newline at end of file +8913297003674584800 \ No newline at end of file
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 8197c92..7e927c0 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -8913329721043066224 \ No newline at end of file +8913311497044026416 \ No newline at end of file
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc index c40e3542..f8c18f3 100644 --- a/cc/animation/animation_host.cc +++ b/cc/animation/animation_host.cc
@@ -142,25 +142,35 @@ SetNeedsPushProperties(); } +void AnimationHost::UpdateRegisteredElementIds(ElementListType changed_list) { + for (auto map_entry : element_to_animations_map_) { + if (mutator_host_client()->IsElementInPropertyTrees(map_entry.first, + changed_list)) + map_entry.second->ElementIdRegistered(map_entry.first, changed_list); + else + map_entry.second->ElementIdUnregistered(map_entry.first, changed_list); + } +} + void AnimationHost::InitClientAnimationState() { for (auto map_entry : element_to_animations_map_) map_entry.second->InitClientAnimationState(); } -void AnimationHost::RegisterElement(ElementId element_id, - ElementListType list_type) { - scoped_refptr<ElementAnimations> element_animations = - GetElementAnimationsForElementId(element_id); - if (element_animations) - element_animations->ElementRegistered(element_id, list_type); -} - -void AnimationHost::UnregisterElement(ElementId element_id, +void AnimationHost::RegisterElementId(ElementId element_id, ElementListType list_type) { scoped_refptr<ElementAnimations> element_animations = GetElementAnimationsForElementId(element_id); if (element_animations) - element_animations->ElementUnregistered(element_id, list_type); + element_animations->ElementIdRegistered(element_id, list_type); +} + +void AnimationHost::UnregisterElementId(ElementId element_id, + ElementListType list_type) { + scoped_refptr<ElementAnimations> element_animations = + GetElementAnimationsForElementId(element_id); + if (element_animations) + element_animations->ElementIdUnregistered(element_id, list_type); } void AnimationHost::RegisterKeyframeEffectForElement( @@ -357,14 +367,19 @@ return; } -bool AnimationHost::ActivateAnimations() { +bool AnimationHost::ActivateAnimations(MutatorEvents* mutator_events) { if (!NeedsTickAnimations()) return false; + auto* animation_events = static_cast<AnimationEvents*>(mutator_events); + TRACE_EVENT0("cc", "AnimationHost::ActivateAnimations"); AnimationsList ticking_animations_copy = ticking_animations_; - for (auto& it : ticking_animations_copy) + for (auto& it : ticking_animations_copy) { it->ActivateKeyframeEffects(); + // Finish animations which no longer affect active or pending elements. + it->UpdateState(false, animation_events); + } return true; }
diff --git a/cc/animation/animation_host.h b/cc/animation/animation_host.h index b4e3cb5..7fcbb13 100644 --- a/cc/animation/animation_host.h +++ b/cc/animation/animation_host.h
@@ -90,12 +90,16 @@ bool supports_impl_scrolling) const override; void ClearMutators() override; + // Processes the current |element_to_animations_map_|, registering animations + // which can now be animated and unregistering those that can't based on the + // elements in the |changed_list|. + void UpdateRegisteredElementIds(ElementListType changed_list) override; void InitClientAnimationState() override; - void RegisterElement(ElementId element_id, - ElementListType list_type) override; - void UnregisterElement(ElementId element_id, + void RegisterElementId(ElementId element_id, ElementListType list_type) override; + void UnregisterElementId(ElementId element_id, + ElementListType list_type) override; void SetMutatorHostClient(MutatorHostClient* client) override; @@ -107,7 +111,7 @@ void SetScrollAnimationDurationForTesting(base::TimeDelta duration) override; bool NeedsTickAnimations() const override; - bool ActivateAnimations() override; + bool ActivateAnimations(MutatorEvents* events) override; bool TickAnimations(base::TimeTicks monotonic_time, const ScrollTree& scroll_tree, bool is_active_tree) override;
diff --git a/cc/animation/animation_host_unittest.cc b/cc/animation/animation_host_unittest.cc index f2f4bd650..0ebe0c4a 100644 --- a/cc/animation/animation_host_unittest.cc +++ b/cc/animation/animation_host_unittest.cc
@@ -32,9 +32,9 @@ ~AnimationHostTest() override = default; void AttachWorkletAnimation() { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); worklet_animation_ = WorkletAnimation::Create( worklet_animation_id_, "test_name", 1, nullptr, nullptr); @@ -121,8 +121,8 @@ } TEST_F(AnimationHostTest, ImplOnlyScrollAnimationUpdateTargetIfDetached) { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); gfx::ScrollOffset target_offset(0., 2.); gfx::ScrollOffset current_offset(0., 1.); @@ -173,7 +173,7 @@ // Push the opacity animation to the impl thread. host_->PushPropertiesTo(host_impl_); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); // Ticking host should cause layer tree mutator to update output state which // should take effect in the same animation frame. @@ -207,7 +207,7 @@ start_opacity, end_opacity, true); host_->PushPropertiesTo(host_impl_); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); EXPECT_CALL(*mock_mutator, MutateRef(_)); @@ -232,7 +232,7 @@ start_opacity, end_opacity, true); host_->PushPropertiesTo(host_impl_); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); EXPECT_CALL(*mock_mutator, MutateRef(_)).Times(1); @@ -306,9 +306,9 @@ int animation_id2 = 12; WorkletAnimationId worklet_animation_id{333, 22}; - client_.RegisterElement(element_id, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id, ElementListType::PENDING); - client_impl_.RegisterElement(element_id, ElementListType::ACTIVE); + client_.RegisterElementId(element_id, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id, ElementListType::ACTIVE); host_impl_->AddAnimationTimeline(timeline_); PropertyTrees property_trees;
diff --git a/cc/animation/animation_unittest.cc b/cc/animation/animation_unittest.cc index 037fd24..4383b12 100644 --- a/cc/animation/animation_unittest.cc +++ b/cc/animation/animation_unittest.cc
@@ -173,9 +173,9 @@ } TEST_F(AnimationTest, PropertiesMutate) { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); host_->AddAnimationTimeline(timeline_); @@ -227,7 +227,7 @@ EXPECT_FALSE(client_impl_.IsPropertyMutated( element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); base::TimeTicks time; time += base::TimeDelta::FromSecondsD(0.1); @@ -264,9 +264,9 @@ TestAnimationDelegate delegate1; TestAnimationDelegate delegate2; - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); scoped_refptr<Animation> animation1 = Animation::Create(100); scoped_refptr<Animation> animation2 = Animation::Create(200); @@ -309,7 +309,7 @@ transform_y, keyframe_effect_id2); host_->PushPropertiesTo(host_impl_); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); EXPECT_FALSE(delegate1.started()); EXPECT_FALSE(delegate1.finished()); @@ -360,9 +360,9 @@ } TEST_F(AnimationTest, AddRemoveAnimationToNonAttachedAnimation) { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); animation_->AddKeyframeEffect( std::make_unique<KeyframeEffect>(keyframe_effect_id_)); @@ -417,7 +417,7 @@ EXPECT_FALSE(client_impl_.IsPropertyMutated( element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); base::TimeTicks time; time += base::TimeDelta::FromSecondsD(0.1); @@ -440,7 +440,7 @@ } TEST_F(AnimationTest, AddRemoveAnimationCausesSetNeedsCommit) { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); host_->AddAnimationTimeline(timeline_); animation_->AddKeyframeEffect( std::make_unique<KeyframeEffect>(keyframe_effect_id_)); @@ -840,9 +840,9 @@ TEST_F(AnimationTest, TickingAnimationsFromTwoKeyframeEffects) { TestAnimationDelegate delegate1; - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); KeyframeEffectId keyframe_effect_id1 = animation_->NextKeyframeEffectId(); @@ -882,7 +882,7 @@ AddAnimatedTransformToAnimation(animation_.get(), duration, transform_x, transform_y, keyframe_effect_id2); host_->PushPropertiesTo(host_impl_); - host_impl_->ActivateAnimations(); + host_impl_->ActivateAnimations(nullptr); EXPECT_FALSE(delegate1.started()); EXPECT_FALSE(delegate1.finished()); @@ -943,9 +943,18 @@ KeyframeEffect* keyframe_effect = animation_->GetKeyframeEffectById(keyframe_effect_id); EXPECT_FALSE(keyframe_effect->is_ticking()); - client_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); EXPECT_TRUE(keyframe_effect->is_ticking()); - client_.UnregisterElement(element_id_, ElementListType::ACTIVE); + + client_.UnregisterElementId(element_id_, ElementListType::ACTIVE); + // The keyframe keeps ticking until the next call to UpdateState where it can + // generate a finished event. + EXPECT_TRUE(keyframe_effect->is_ticking()); + + // The next call to UpdateState should remove the animation from ticking. We + // could also assert that the finish event was generated if we also track the + // state in the KeyframeModel correctly. + host_->UpdateAnimationState(true, nullptr); EXPECT_FALSE(keyframe_effect->is_ticking()); }
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc index 813947ed..20ee2bd 100644 --- a/cc/animation/element_animations.cc +++ b/cc/animation/element_animations.cc
@@ -65,11 +65,11 @@ DCHECK(animation_host_); DCHECK(animation_host_->mutator_host_client()); - if (animation_host_->mutator_host_client()->IsElementInList( + if (animation_host_->mutator_host_client()->IsElementInPropertyTrees( element_id_, ElementListType::ACTIVE)) { set_has_element_in_active_list(true); } - if (animation_host_->mutator_host_client()->IsElementInList( + if (animation_host_->mutator_host_client()->IsElementInPropertyTrees( element_id_, ElementListType::PENDING)) { set_has_element_in_pending_list(true); } @@ -111,8 +111,8 @@ RemoveKeyframeEffectsFromTicking(); } -void ElementAnimations::ElementRegistered(ElementId element_id, - ElementListType list_type) { +void ElementAnimations::ElementIdRegistered(ElementId element_id, + ElementListType list_type) { DCHECK_EQ(element_id_, element_id); bool had_element_in_any_list = has_element_in_any_list(); @@ -126,16 +126,13 @@ UpdateKeyframeEffectsTickingState(); } -void ElementAnimations::ElementUnregistered(ElementId element_id, - ElementListType list_type) { +void ElementAnimations::ElementIdUnregistered(ElementId element_id, + ElementListType list_type) { DCHECK_EQ(this->element_id(), element_id); if (list_type == ElementListType::ACTIVE) set_has_element_in_active_list(false); else set_has_element_in_pending_list(false); - - if (!has_element_in_any_list()) - RemoveKeyframeEffectsFromTicking(); } void ElementAnimations::AddKeyframeEffect(KeyframeEffect* keyframe_effect) {
diff --git a/cc/animation/element_animations.h b/cc/animation/element_animations.h index a1230f6a..542d145c 100644 --- a/cc/animation/element_animations.h +++ b/cc/animation/element_animations.h
@@ -52,8 +52,11 @@ void ClearAffectedElementTypes(const PropertyToElementIdMap& element_id_map); - void ElementRegistered(ElementId element_id, ElementListType list_type); - void ElementUnregistered(ElementId element_id, ElementListType list_type); + // Called when |element_id| is available to animate in |list_type|. + void ElementIdRegistered(ElementId element_id, ElementListType list_type); + + // Called when |element_id| is no longer avialable to animate in |list_type|. + void ElementIdUnregistered(ElementId element_id, ElementListType list_type); void AddKeyframeEffect(KeyframeEffect* keyframe_effect); void RemoveKeyframeEffect(KeyframeEffect* keyframe_effect);
diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc index 6a0f338..9cc6ed06 100644 --- a/cc/animation/element_animations_unittest.cc +++ b/cc/animation/element_animations_unittest.cc
@@ -60,11 +60,13 @@ TEST_F(ElementAnimationsTest, AttachToLayerInActiveTree) { // Set up the layer which is in active tree for main thread and not // yet passed onto the impl thread. - client_.RegisterElement(element_id_, ElementListType::ACTIVE); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); - EXPECT_TRUE(client_.IsElementInList(element_id_, ElementListType::ACTIVE)); - EXPECT_FALSE(client_.IsElementInList(element_id_, ElementListType::PENDING)); + EXPECT_TRUE( + client_.IsElementInPropertyTrees(element_id_, ElementListType::ACTIVE)); + EXPECT_FALSE( + client_.IsElementInPropertyTrees(element_id_, ElementListType::PENDING)); AttachTimelineAnimationLayer(); @@ -79,17 +81,17 @@ EXPECT_TRUE(element_animations_impl_->has_element_in_pending_list()); // Create the layer in the impl active tree. - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); EXPECT_TRUE(element_animations_impl_->has_element_in_active_list()); EXPECT_TRUE(element_animations_impl_->has_element_in_pending_list()); - EXPECT_TRUE( - client_impl_.IsElementInList(element_id_, ElementListType::ACTIVE)); - EXPECT_TRUE( - client_impl_.IsElementInList(element_id_, ElementListType::PENDING)); + EXPECT_TRUE(client_impl_.IsElementInPropertyTrees(element_id_, + ElementListType::ACTIVE)); + EXPECT_TRUE(client_impl_.IsElementInPropertyTrees(element_id_, + ElementListType::PENDING)); // kill layer on main thread. - client_.UnregisterElement(element_id_, ElementListType::ACTIVE); + client_.UnregisterElementId(element_id_, ElementListType::ACTIVE); EXPECT_EQ(element_animations_, animation_->keyframe_effect()->element_animations()); EXPECT_FALSE(element_animations_->has_element_in_active_list()); @@ -103,14 +105,14 @@ EXPECT_TRUE(element_animations_impl_->has_element_in_pending_list()); // Kill layer on impl thread in pending tree. - client_impl_.UnregisterElement(element_id_, ElementListType::PENDING); + client_impl_.UnregisterElementId(element_id_, ElementListType::PENDING); EXPECT_EQ(element_animations_impl_, animation_impl_->keyframe_effect()->element_animations()); EXPECT_TRUE(element_animations_impl_->has_element_in_active_list()); EXPECT_FALSE(element_animations_impl_->has_element_in_pending_list()); // Kill layer on impl thread in active tree. - client_impl_.UnregisterElement(element_id_, ElementListType::ACTIVE); + client_impl_.UnregisterElementId(element_id_, ElementListType::ACTIVE); EXPECT_EQ(element_animations_impl_, animation_impl_->keyframe_effect()->element_animations()); EXPECT_FALSE(element_animations_impl_->has_element_in_active_list()); @@ -152,15 +154,15 @@ EXPECT_FALSE(element_animations_impl_->has_element_in_pending_list()); // Create layer. - client_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); EXPECT_TRUE(element_animations_->has_element_in_active_list()); EXPECT_FALSE(element_animations_->has_element_in_pending_list()); - client_impl_.RegisterElement(element_id_, ElementListType::PENDING); + client_impl_.RegisterElementId(element_id_, ElementListType::PENDING); EXPECT_FALSE(element_animations_impl_->has_element_in_active_list()); EXPECT_TRUE(element_animations_impl_->has_element_in_pending_list()); - client_impl_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_impl_.RegisterElementId(element_id_, ElementListType::ACTIVE); EXPECT_TRUE(element_animations_impl_->has_element_in_active_list()); EXPECT_TRUE(element_animations_impl_->has_element_in_pending_list()); } @@ -1764,6 +1766,8 @@ animation_impl_->AddKeyframeModel(CreateKeyframeModel( std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.5f, 1.f)), id, TargetProperty::OPACITY)); + animation_impl_->GetKeyframeModel(TargetProperty::OPACITY) + ->set_affects_active_elements(false); // Without an observer, the animation shouldn't progress to the STARTING // state. @@ -1800,6 +1804,8 @@ client_impl_.GetOpacity(element_id_, ElementListType::PENDING)); CreateTestImplLayer(ElementListType::ACTIVE); + animation_impl_->GetKeyframeModel(TargetProperty::OPACITY) + ->set_affects_active_elements(true); // Now that an active observer has been added, the animation should still // initially tick at its starting point, but should now progress to RUNNING. @@ -3589,9 +3595,11 @@ EXPECT_EQ(1u, host_->ticking_animations_for_testing().size()); DestroyTestMainLayer(); + host_->UpdateAnimationState(true, nullptr); EXPECT_EQ(0u, host_->ticking_animations_for_testing().size()); PushProperties(); + host_impl_->ActivateAnimations(nullptr); EXPECT_EQ(0u, host_->ticking_animations_for_testing().size()); EXPECT_EQ(0u, host_impl_->ticking_animations_for_testing().size()); }
diff --git a/cc/animation/keyframe_effect.cc b/cc/animation/keyframe_effect.cc index 94fb0f6..265fc9e 100644 --- a/cc/animation/keyframe_effect.cc +++ b/cc/animation/keyframe_effect.cc
@@ -183,13 +183,11 @@ void KeyframeEffect::UpdateState(bool start_ready_keyframe_models, AnimationEvents* events) { DCHECK(has_bound_element_animations()); - if (!element_animations_->has_element_in_active_list()) - return; // Animate hasn't been called, this happens if an element has been added // between the Commit and Draw phases. if (last_tick_time_ == base::TimeTicks()) - return; + start_ready_keyframe_models = false; if (start_ready_keyframe_models) PromoteStartedKeyframeModels(events); @@ -204,6 +202,9 @@ PromoteStartedKeyframeModels(events); } } + + if (!element_animations()->has_element_in_any_list()) + RemoveFromTicking(); } void KeyframeEffect::UpdateTickingState() {
diff --git a/cc/animation/worklet_animation_unittest.cc b/cc/animation/worklet_animation_unittest.cc index c8b4580e4..0b8a06b 100644 --- a/cc/animation/worklet_animation_unittest.cc +++ b/cc/animation/worklet_animation_unittest.cc
@@ -33,7 +33,7 @@ ~WorkletAnimationTest() override = default; void AttachWorkletAnimation() { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); worklet_animation_ = WrapRefCounted( new WorkletAnimation(1, worklet_animation_id_, "test_name", 1, nullptr,
diff --git a/cc/test/animation_timelines_test_common.cc b/cc/test/animation_timelines_test_common.cc index 1db44481..f2fffd03 100644 --- a/cc/test/animation_timelines_test_common.cc +++ b/cc/test/animation_timelines_test_common.cc
@@ -78,8 +78,8 @@ kv.second->ClearMutatedProperties(); } -bool TestHostClient::IsElementInList(ElementId element_id, - ElementListType list_type) const { +bool TestHostClient::IsElementInPropertyTrees(ElementId element_id, + ElementListType list_type) const { return list_type == ElementListType::ACTIVE ? layers_in_active_tree_.count(element_id) : layers_in_pending_tree_.count(element_id); @@ -161,8 +161,8 @@ return scroll_offset_; } -void TestHostClient::RegisterElement(ElementId element_id, - ElementListType list_type) { +void TestHostClient::RegisterElementId(ElementId element_id, + ElementListType list_type) { ElementIdToTestLayer& layers_in_tree = list_type == ElementListType::ACTIVE ? layers_in_active_tree_ : layers_in_pending_tree_; @@ -170,13 +170,13 @@ layers_in_tree[element_id] = TestLayer::Create(); DCHECK(host_); - host_->RegisterElement(element_id, list_type); + host_->RegisterElementId(element_id, list_type); } -void TestHostClient::UnregisterElement(ElementId element_id, - ElementListType list_type) { +void TestHostClient::UnregisterElementId(ElementId element_id, + ElementListType list_type) { DCHECK(host_); - host_->UnregisterElement(element_id, list_type); + host_->UnregisterElementId(element_id, list_type); ElementIdToTestLayer& layers_in_tree = list_type == ElementListType::ACTIVE ? layers_in_active_tree_ @@ -387,16 +387,16 @@ } void AnimationTimelinesTest::CreateTestMainLayer() { - client_.RegisterElement(element_id_, ElementListType::ACTIVE); + client_.RegisterElementId(element_id_, ElementListType::ACTIVE); } void AnimationTimelinesTest::DestroyTestMainLayer() { - client_.UnregisterElement(element_id_, ElementListType::ACTIVE); + client_.UnregisterElementId(element_id_, ElementListType::ACTIVE); } void AnimationTimelinesTest::CreateTestImplLayer( ElementListType element_list_type) { - client_impl_.RegisterElement(element_id_, element_list_type); + client_impl_.RegisterElementId(element_id_, element_list_type); } void AnimationTimelinesTest::AttachTimelineAnimationLayer() {
diff --git a/cc/test/animation_timelines_test_common.h b/cc/test/animation_timelines_test_common.h index 994e3eb..a5c68d9 100644 --- a/cc/test/animation_timelines_test_common.h +++ b/cc/test/animation_timelines_test_common.h
@@ -96,8 +96,8 @@ void ClearMutatedProperties(); - bool IsElementInList(ElementId element_id, - ElementListType list_type) const override; + bool IsElementInPropertyTrees(ElementId element_id, + ElementListType list_type) const override; void SetMutatorsNeedCommit() override; void SetMutatorsNeedRebuildPropertyTrees() override; @@ -140,8 +140,8 @@ bool mutators_need_commit() const { return mutators_need_commit_; } void set_mutators_need_commit(bool need) { mutators_need_commit_ = need; } - void RegisterElement(ElementId element_id, ElementListType list_type); - void UnregisterElement(ElementId element_id, ElementListType list_type); + void RegisterElementId(ElementId element_id, ElementListType list_type); + void UnregisterElementId(ElementId element_id, ElementListType list_type); AnimationHost* host() { DCHECK(host_);
diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index 70596745..4ce9651 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc
@@ -891,17 +891,6 @@ // It is safe to unregister, even if we didn't register in the constructor. base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( this); - - // TODO(vmpstr): If we don't have a client name, it may cause problems in - // unittests, since most tests don't set the name but some do. The UMA system - // expects the name to be always the same. This assertion is violated in the - // tests that do set the name. - if (GetClientNameForMetrics()) { - UMA_HISTOGRAM_CUSTOM_COUNTS( - base::StringPrintf("Compositing.%s.CachedImagesCount.Gpu", - GetClientNameForMetrics()), - lifetime_max_items_in_cache_, 1, 1000, 20); - } } ImageDecodeCache::TaskResult GpuImageDecodeCache::GetTaskForImageAndRef( @@ -1593,9 +1582,6 @@ "GpuImageDecodeCache::EnsureCapacity"); lock_.AssertAcquired(); - lifetime_max_items_in_cache_ = - std::max(lifetime_max_items_in_cache_, persistent_cache_.size()); - // While we are over preferred item capacity, we iterate through our set of // cached image data in LRU order, removing unreferenced images. for (auto it = persistent_cache_.rbegin();
diff --git a/cc/tiles/gpu_image_decode_cache.h b/cc/tiles/gpu_image_decode_cache.h index b47df03c..fe40792 100644 --- a/cc/tiles/gpu_image_decode_cache.h +++ b/cc/tiles/gpu_image_decode_cache.h
@@ -665,10 +665,6 @@ std::vector<uint32_t> ids_pending_unlock_; std::vector<uint32_t> ids_pending_deletion_; - // Records the maximum number of items in the cache over the lifetime of the - // cache. This is updated anytime we are requested to reduce cache usage. - size_t lifetime_max_items_in_cache_ = 0u; - std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; };
diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc index 110d8251..f858a18 100644 --- a/cc/tiles/software_image_decode_cache.cc +++ b/cc/tiles/software_image_decode_cache.cc
@@ -164,16 +164,6 @@ // It is safe to unregister, even if we didn't register in the constructor. base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( this); - // TODO(vmpstr): If we don't have a client name, it may cause problems in - // unittests, since most tests don't set the name but some do. The UMA system - // expects the name to be always the same. This assertion is violated in the - // tests that do set the name. - if (GetClientNameForMetrics()) { - UMA_HISTOGRAM_CUSTOM_COUNTS( - base::StringPrintf("Compositing.%s.CachedImagesCount.Software", - GetClientNameForMetrics()), - lifetime_max_items_in_cache_, 1, 1000, 20); - } } ImageDecodeCache::TaskResult SoftwareImageDecodeCache::GetTaskForImageAndRef( @@ -584,8 +574,6 @@ void SoftwareImageDecodeCache::ReduceCacheUsageUntilWithinLimit(size_t limit) { TRACE_EVENT0("cc", "SoftwareImageDecodeCache::ReduceCacheUsageUntilWithinLimit"); - lifetime_max_items_in_cache_ = - std::max(lifetime_max_items_in_cache_, decoded_images_.size()); for (auto it = decoded_images_.rbegin(); decoded_images_.size() > limit && it != decoded_images_.rend();) { if (it->second->ref_count != 0) {
diff --git a/cc/tiles/software_image_decode_cache.h b/cc/tiles/software_image_decode_cache.h index 30040d1..c3b7c03 100644 --- a/cc/tiles/software_image_decode_cache.h +++ b/cc/tiles/software_image_decode_cache.h
@@ -156,9 +156,6 @@ const PaintImage::GeneratorClientId generator_client_id_; size_t max_items_in_cache_; - // Records the maximum number of items in the cache over the lifetime of the - // cache. This is updated anytime we are requested to reduce cache usage. - size_t lifetime_max_items_in_cache_ = 0u; }; } // namespace cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 91683c01..09ebf3d1 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -371,6 +371,10 @@ DCHECK(host_impl->mutator_host()); mutator_host_->PushPropertiesTo(host_impl->mutator_host()); + // Updating elements affects whether animations are in effect based on their + // properties so run after pushing updated animation properties. + host_impl->UpdateElements(ElementListType::PENDING); + sync_tree->lifecycle().AdvanceTo(LayerTreeLifecycle::kNotSyncing); } @@ -1438,8 +1442,8 @@ DCHECK(!in_paint_layer_contents_); layer_id_map_[layer->id()] = layer; if (!IsUsingLayerLists() && layer->element_id()) { - mutator_host_->RegisterElement(layer->element_id(), - ElementListType::ACTIVE); + mutator_host_->RegisterElementId(layer->element_id(), + ElementListType::ACTIVE); } } @@ -1447,8 +1451,8 @@ DCHECK(LayerById(layer->id())); DCHECK(!in_paint_layer_contents_); if (!IsUsingLayerLists() && layer->element_id()) { - mutator_host_->UnregisterElement(layer->element_id(), - ElementListType::ACTIVE); + mutator_host_->UnregisterElementId(layer->element_id(), + ElementListType::ACTIVE); } layers_that_should_push_properties_.erase(layer); layer_id_map_.erase(layer->id()); @@ -1678,7 +1682,7 @@ // Animation ElementIds are unregistered by |SetActiveRegisteredElementIds| // when using layer lists. if (!IsUsingLayerLists()) - mutator_host_->RegisterElement(element_id, list_type); + mutator_host_->RegisterElementId(element_id, list_type); } void LayerTreeHost::UnregisterElement(ElementId element_id, @@ -1686,31 +1690,14 @@ // Animation ElementIds are unregistered by |SetActiveRegisteredElementIds| // when using layer lists. if (!IsUsingLayerLists()) - mutator_host_->UnregisterElement(element_id, list_type); + mutator_host_->UnregisterElementId(element_id, list_type); element_layers_map_.erase(element_id); } -void LayerTreeHost::SetActiveRegisteredElementIds(const ElementIdSet& ids) { +void LayerTreeHost::UpdateActiveElements() { DCHECK(IsUsingLayerLists()); - - // Unregister ids that should no longer be registered. - for (auto id_iter = elements_in_property_trees_.begin(); - id_iter != elements_in_property_trees_.end();) { - const auto& id = *(id_iter++); - if (!ids.count(id)) { - mutator_host_->UnregisterElement(id, ElementListType::ACTIVE); - elements_in_property_trees_.erase(id); - } - } - - // Register new ids that were not already registered. - for (const auto& id : ids) { - if (!elements_in_property_trees_.count(id)) { - elements_in_property_trees_.insert(id); - mutator_host_->RegisterElement(id, ElementListType::ACTIVE); - } - } + mutator_host_->UpdateRegisteredElementIds(ElementListType::ACTIVE); } static void SetElementIdForTesting(Layer* layer) { @@ -1730,11 +1717,11 @@ gfx::Rect(device_viewport_size()), identity_transform, property_trees()); } -bool LayerTreeHost::IsElementInList(ElementId element_id, - ElementListType list_type) const { +bool LayerTreeHost::IsElementInPropertyTrees(ElementId element_id, + ElementListType list_type) const { if (IsUsingLayerLists()) { return list_type == ElementListType::ACTIVE && - elements_in_property_trees_.count(element_id); + property_trees()->HasElement(element_id); } return list_type == ElementListType::ACTIVE && LayerByElementId(element_id); }
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index c25e97bb..ef6c117 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -548,9 +548,6 @@ void PushPropertyTreesTo(LayerTreeImpl* tree_impl); void PushLayerTreePropertiesTo(LayerTreeImpl* tree_impl); - // TODO(flackr): This list should be on the property trees and pushed - // as part of PushPropertyTreesTo. - void PushRegisteredElementIdsTo(LayerTreeImpl* tree_impl); void PushSurfaceRangesTo(LayerTreeImpl* tree_impl); void PushLayerTreeHostPropertiesTo(LayerTreeHostImpl* host_impl); @@ -564,15 +561,7 @@ Layer* layer); void UnregisterElement(ElementId element_id, ElementListType list_type); - // Registers the new active element ids, updating |registered_element_ids_|, - // and unregisters any element ids that were previously registered. This is - // similar to |RegisterElement| and |UnregisterElement| but for layer lists - // where we do not have a unique element id to layer mapping. - using ElementIdSet = std::unordered_set<ElementId, ElementIdHash>; - void SetActiveRegisteredElementIds(const ElementIdSet&); - const ElementIdSet& elements_in_property_trees() { - return elements_in_property_trees_; - } + void UpdateActiveElements(); void SetElementIdsForTesting(); @@ -643,8 +632,8 @@ bool IsUsingLayerLists() const; // MutatorHostClient implementation. - bool IsElementInList(ElementId element_id, - ElementListType list_type) const override; + bool IsElementInPropertyTrees(ElementId element_id, + ElementListType list_type) const override; void SetMutatorsNeedCommit() override; void SetMutatorsNeedRebuildPropertyTrees() override; void SetElementFilterMutated(ElementId element_id, @@ -874,10 +863,6 @@ // In layer-list mode, this map is only used for scrollable layers. std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_; - // The set of registered element ids when using layer list mode. In non-layer- - // list mode, |element_layers_map_| is used. - ElementIdSet elements_in_property_trees_; - bool in_paint_layer_contents_ = false; // This is true if atleast one layer in the layer tree has a copy request. We
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index a3824f9..367b507 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -263,6 +263,24 @@ return ui::FrameMetricsSettings(source, source_thread, compile_target); } +class ScopedPostAnimationEventsToMainThread { + public: + ScopedPostAnimationEventsToMainThread(MutatorHost* animation_host, + LayerTreeHostImplClient* client) + : events_(animation_host->CreateEvents()), client_(client) {} + + ~ScopedPostAnimationEventsToMainThread() { + if (!events_->IsEmpty()) + client_->PostAnimationEventsToMainThreadOnImplThread(std::move(events_)); + } + + MutatorEvents* events() { return events_.get(); } + + private: + std::unique_ptr<MutatorEvents> events_; + LayerTreeHostImplClient* client_; +}; + } // namespace DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer, @@ -445,6 +463,10 @@ if (CommitToActiveTree()) { active_tree_->HandleScrollbarShowRequestsFromMain(); + // Property tree nodes have been updated by the commit. Update elements + // available on active tree to start/stop ticking animations. + UpdateElements(ElementListType::ACTIVE); + // We have to activate animations here or "IsActive()" is true on the layers // but the animations aren't activated yet so they get ignored by // UpdateDrawProperties. @@ -1277,6 +1299,10 @@ viewport_damage_rect_.Union(damage_rect); } +void LayerTreeHostImpl::UpdateElements(ElementListType changed_list) { + mutator_host()->UpdateRegisteredElementIds(changed_list); +} + void LayerTreeHostImpl::InvalidateContentOnImplSide() { DCHECK(!pending_tree_); // Invalidation should never be ran outside the impl frame for non @@ -2866,6 +2892,7 @@ LayerTreeLifecycle::kSyncedPropertyTrees); TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); + active_tree_->lifecycle().AdvanceTo( LayerTreeLifecycle::kSyncedLayerProperties); @@ -2873,6 +2900,10 @@ if (!pending_tree_->LayerListIsEmpty()) pending_tree_->property_trees()->ResetAllChangeTracking(); + // Property tree nodes have been updated by PushLayerProperties. Update + // elements available on active tree to start/stop ticking animations. + UpdateElements(ElementListType::ACTIVE); + active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kNotSyncing); // Now that we've synced everything from the pending tree to the active @@ -5071,20 +5102,21 @@ } void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { - std::unique_ptr<MutatorEvents> events = mutator_host_->CreateEvents(); + ScopedPostAnimationEventsToMainThread event_poster(mutator_host_.get(), + client_); - const bool has_active_animations = - mutator_host_->UpdateAnimationState(start_ready_animations, events.get()); - - if (!events->IsEmpty()) - client_->PostAnimationEventsToMainThreadOnImplThread(std::move(events)); + const bool has_active_animations = mutator_host_->UpdateAnimationState( + start_ready_animations, event_poster.events()); if (has_active_animations) SetNeedsOneBeginImplFrame(); } void LayerTreeHostImpl::ActivateAnimations() { - const bool activated = mutator_host_->ActivateAnimations(); + ScopedPostAnimationEventsToMainThread event_poster(mutator_host_.get(), + client_); + const bool activated = + mutator_host_->ActivateAnimations(event_poster.events()); if (activated) { // Activating an animation changes layer draw properties, such as // screen_space_transform_is_animating. So when we see a new animation get @@ -5665,8 +5697,9 @@ return animation_updated; } -bool LayerTreeHostImpl::IsElementInList(ElementId element_id, - ElementListType list_type) const { +bool LayerTreeHostImpl::IsElementInPropertyTrees( + ElementId element_id, + ElementListType list_type) const { if (list_type == ElementListType::ACTIVE) return active_tree() && active_tree()->IsElementInPropertyTree(element_id);
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index ee459299..a3c93b27 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -340,6 +340,10 @@ void SetFullViewportDamage(); void SetViewportDamage(const gfx::Rect& damage_rect); + // Updates registered ElementIds present in |changed_list|. Call this after + // changing the property trees for the |changed_list| trees. + void UpdateElements(ElementListType changed_list); + // Analogous to a commit, this function is used to create a sync tree and // add impl-side invalidations to it. // virtual for testing. @@ -355,8 +359,8 @@ } // MutatorHostClient implementation. - bool IsElementInList(ElementId element_id, - ElementListType list_type) const override; + bool IsElementInPropertyTrees(ElementId element_id, + ElementListType list_type) const override; void SetMutatorsNeedCommit() override; void SetMutatorsNeedRebuildPropertyTrees() override; void SetElementFilterMutated(ElementId element_id,
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 29fbffe..4bb33e1 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -2287,8 +2287,22 @@ // Destroy layer, unregister animation target (element). child->test_properties()->parent = nullptr; root->test_properties()->RemoveChild(child); + + // Calling LayerImplTestProperties::RemoveChild above does not actually + // remove the property tree nodes for the removed layer. In the real code, + // you cannot remove a child on LayerImpl, but a child removed on Layer + // will force a full tree sync which will rebuild property trees without that + // child's property tree nodes. Call BuildPropertyTrees to simulate the + // rebuild that would happen during the commit. + host_impl_->active_tree()->BuildPropertyTreesForTesting(); child = nullptr; + // On updating state, we will send an animation event and request one last + // frame. + host_impl_->UpdateAnimationState(true); + EXPECT_TRUE(did_request_next_frame_); + did_request_next_frame_ = false; + // Doing Animate() doesn't request another frame after the current one. host_impl_->Animate(); EXPECT_FALSE(did_request_next_frame_);
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index ad61545..6a1ffbf 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1433,9 +1433,11 @@ EXPECT_FALSE(animation_->keyframe_effect() ->element_animations() ->has_element_in_pending_list()); - EXPECT_FALSE(animation_host()->NeedsTickAnimations()); + // Animations still need one more tick to deliver finished event. + EXPECT_TRUE(animation_host()->NeedsTickAnimations()); break; case 2: + EXPECT_FALSE(animation_host()->NeedsTickAnimations()); layer_tree_host()->root_layer()->AddChild(layer_); EXPECT_TRUE(animation_->keyframe_effect() ->element_animations() @@ -1466,6 +1468,8 @@ EXPECT_FALSE(animation_impl->keyframe_effect() ->element_animations() ->has_element_in_active_list()); + // Having updated state on the host_impl during the commit, we no longer + // need to tick animations. EXPECT_FALSE(GetImplAnimationHost(host_impl)->NeedsTickAnimations()); break; case 2:
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 0c8ccb6..2b61ee4 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -619,35 +619,13 @@ } bool LayerTreeImpl::IsElementInPropertyTree(ElementId element_id) const { - return elements_in_property_trees_.count(element_id); + return property_trees()->HasElement(element_id); } ElementListType LayerTreeImpl::GetElementTypeForAnimation() const { return IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; } -void LayerTreeImpl::AddToElementPropertyTreeList(ElementId element_id) { -#if DCHECK_IS_ON() - bool element_id_collision_detected = - elements_in_property_trees_.count(element_id); - - DCHECK(!element_id_collision_detected); -#endif - - elements_in_property_trees_.insert(element_id); - - DCHECK(settings().use_layer_lists); - host_impl_->mutator_host()->RegisterElement(element_id, - GetElementTypeForAnimation()); -} - -void LayerTreeImpl::RemoveFromElementPropertyTreeList(ElementId element_id) { - DCHECK(settings().use_layer_lists); - host_impl_->mutator_host()->UnregisterElement(element_id, - GetElementTypeForAnimation()); - elements_in_property_trees_.erase(element_id); -} - void LayerTreeImpl::AddToElementLayerList(ElementId element_id, LayerImpl* layer) { if (!element_id) @@ -658,9 +636,8 @@ element_id.AsValue().release()); if (!settings().use_layer_lists) { - elements_in_property_trees_.insert(element_id); - host_impl_->mutator_host()->RegisterElement(element_id, - GetElementTypeForAnimation()); + host_impl_->mutator_host()->RegisterElementId(element_id, + GetElementTypeForAnimation()); } if (layer->scrollable()) @@ -676,9 +653,8 @@ element_id.AsValue().release()); if (!settings().use_layer_lists) { - elements_in_property_trees_.erase(element_id); - host_impl_->mutator_host()->UnregisterElement(element_id, - GetElementTypeForAnimation()); + host_impl_->mutator_host()->UnregisterElementId( + element_id, GetElementTypeForAnimation()); } element_id_to_scrollable_layer_.erase(element_id); @@ -1421,6 +1397,7 @@ gfx::Rect(GetDeviceViewport().size()), host_impl_->DrawTransform(), &property_trees_); property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); + host_impl_->UpdateElements(GetElementTypeForAnimation()); } const RenderSurfaceList& LayerTreeImpl::GetRenderSurfaceList() const {
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 88d798bc..d7802e1f 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h
@@ -183,7 +183,6 @@ void PushPropertyTreesTo(LayerTreeImpl* tree_impl); void PushPropertiesTo(LayerTreeImpl* tree_impl); void PushSurfaceRangesTo(LayerTreeImpl* tree_impl); - void PushRegisteredElementIdsTo(LayerTreeImpl* tree_impl); void MoveChangeTrackingToLayers(); @@ -645,11 +644,6 @@ LayerTreeLifecycle& lifecycle() { return lifecycle_; } - const std::unordered_set<ElementId, ElementIdHash>& - elements_in_property_trees() { - return elements_in_property_trees_; - } - std::string LayerListAsJson() const; // TODO(pdr): This should be removed because there is no longer a tree // of layers, only a list. @@ -722,9 +716,6 @@ // Set of layers that need to push properties. base::flat_set<LayerImpl*> layers_that_should_push_properties_; - // Set of ElementIds which are present in the |layer_list_|. - std::unordered_set<ElementId, ElementIdHash> elements_in_property_trees_; - std::unordered_map<ElementId, float, ElementIdHash> element_id_to_opacity_animations_; std::unordered_map<ElementId, gfx::Transform, ElementIdHash>
diff --git a/cc/trees/mutator_host.h b/cc/trees/mutator_host.h index ded0e93..e2e6db6a 100644 --- a/cc/trees/mutator_host.h +++ b/cc/trees/mutator_host.h
@@ -46,12 +46,13 @@ virtual void ClearMutators() = 0; + virtual void UpdateRegisteredElementIds(ElementListType changed_list) = 0; virtual void InitClientAnimationState() = 0; - virtual void RegisterElement(ElementId element_id, - ElementListType list_type) = 0; - virtual void UnregisterElement(ElementId element_id, + virtual void RegisterElementId(ElementId element_id, ElementListType list_type) = 0; + virtual void UnregisterElementId(ElementId element_id, + ElementListType list_type) = 0; virtual void SetMutatorHostClient(MutatorHostClient* client) = 0; @@ -65,7 +66,7 @@ base::TimeDelta duration) = 0; virtual bool NeedsTickAnimations() const = 0; - virtual bool ActivateAnimations() = 0; + virtual bool ActivateAnimations(MutatorEvents* events) = 0; // TODO(smcgruer): Once we only tick scroll-based animations on scroll, we // don't need to pass the scroll tree in here. virtual bool TickAnimations(base::TimeTicks monotonic_time,
diff --git a/cc/trees/mutator_host_client.h b/cc/trees/mutator_host_client.h index 44bad2c..ccfc901 100644 --- a/cc/trees/mutator_host_client.h +++ b/cc/trees/mutator_host_client.h
@@ -29,8 +29,8 @@ class MutatorHostClient { public: - virtual bool IsElementInList(ElementId element_id, - ElementListType list_type) const = 0; + virtual bool IsElementInPropertyTrees(ElementId element_id, + ElementListType list_type) const = 0; virtual void SetMutatorsNeedCommit() = 0; virtual void SetMutatorsNeedRebuildPropertyTrees() = 0;
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index d75cf91d..8dc13ff 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -2228,6 +2228,12 @@ return &clip_node->cached_clip_rects->back(); } +bool PropertyTrees::HasElement(ElementId element_id) const { + return element_id_to_effect_node_index.contains(element_id) || + element_id_to_scroll_node_index.contains(element_id) || + element_id_to_transform_node_index.contains(element_id); +} + DrawTransforms& PropertyTrees::GetDrawTransforms(int transform_id, int effect_id) const { const EffectNode* effect_node = effect_tree.Node(effect_id);
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index 3296420..d3505a6 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -700,6 +700,8 @@ ClipRectData* FetchClipRectFromCache(int clip_id, int target_id); + bool HasElement(ElementId element_id) const; + private: gfx::Vector2dF inner_viewport_container_bounds_delta_; gfx::Vector2dF outer_viewport_container_bounds_delta_;
diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc index 34839495..9e329f0 100644 --- a/cc/trees/tree_synchronizer.cc +++ b/cc/trees/tree_synchronizer.cc
@@ -89,25 +89,6 @@ } template <typename LayerTreeType> -void PushElementsInPropertyTreesTo(LayerTreeType* host, - LayerTreeImpl* tree_impl) { - for (auto id_iter = tree_impl->elements_in_property_trees().begin(); - id_iter != tree_impl->elements_in_property_trees().end();) { - const auto& id = *(id_iter++); - if (!host->elements_in_property_trees().count(id)) - tree_impl->RemoveFromElementPropertyTreeList(id); - } - - for (const auto& id : host->elements_in_property_trees()) { - if (!tree_impl->IsElementInPropertyTree(id)) { - // TODO(flackr): We should expose adding element ids without a - // layer pointer. - tree_impl->AddToElementPropertyTreeList(id); - } - } -} - -template <typename LayerTreeType> void SynchronizeTreesInternal(LayerTreeType* source_tree, LayerTreeImpl* tree_impl, PropertyTrees* property_trees) { @@ -220,8 +201,6 @@ PushLayerPropertiesInternal(layers.begin(), layers.end(), active_tree); PushLayerPropertiesInternal(picture_layers.begin(), picture_layers.end(), active_tree); - if (pending_tree->settings().use_layer_lists) - PushElementsInPropertyTreesTo(pending_tree, active_tree); pending_tree->ClearLayersThatShouldPushProperties(); } @@ -232,10 +211,6 @@ "layer_count", layers.size()); PushLayerPropertiesInternal(layers.begin(), layers.end(), host_tree, impl_tree); - // When using layer lists, we may not have layers for all property tree - // node ids and need to synchronize the registered id list. - if (host_tree->IsUsingLayerLists()) - PushElementsInPropertyTreesTo(host_tree, impl_tree); host_tree->ClearLayersThatShouldPushProperties(); }
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index 092f9f33..2344331 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -1644,6 +1644,7 @@ "java/src/org/chromium/chrome/browser/webapps/SplashController.java", "java/src/org/chromium/chrome/browser/webapps/SplashDelegate.java", "java/src/org/chromium/chrome/browser/webapps/SplashscreenObserver.java", + "java/src/org/chromium/chrome/browser/webapps/TouchlessAddToHomescreenDialog.java", "java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java", "java/src/org/chromium/chrome/browser/webapps/WebApkActivity0.java", "java/src/org/chromium/chrome/browser/webapps/WebApkActivity1.java",
diff --git a/chrome/android/java/res/layout/touchless_add_to_apps.xml b/chrome/android/java/res/layout/touchless_add_to_apps.xml new file mode 100644 index 0000000..88bf8a1 --- /dev/null +++ b/chrome/android/java/res/layout/touchless_add_to_apps.xml
@@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2019 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. +--> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="start" + android:padding="8dp" > + + <ProgressBar + android:id="@+id/spinny" + android:layout_width="32dp" + android:layout_height="32dp" + android:padding="8dp" /> + + <!-- The icon that will be used on the home screen. --> + <ImageView + android:id="@+id/icon" + android:layout_width="36dp" + android:layout_height="36dp" + android:importantForAccessibility="no" + android:visibility="gone" /> + + <!-- The layout used for apps. --> + <LinearLayout + android:id="@+id/app_info" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="48dp" + android:visibility="gone" > + + <!-- The name of the web app that will be used on the home screen. Not + editable as we preserve the developer's name choice for apps. --> + <TextView + android:id="@+id/name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@style/TextAppearance.BlackTitle1" /> + + <!-- The origin of the web app, displayed for security purposes. --> + <TextView + android:id="@+id/origin" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingBottom="2dp" + android:textAppearance="@style/TextAppearance.BlackBody" /> + </LinearLayout> +</FrameLayout> +
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerUiDelegateAndroid.java b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerUiDelegateAndroid.java index 56b50519..d670de5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerUiDelegateAndroid.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerUiDelegateAndroid.java
@@ -15,7 +15,9 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.webapps.AddToHomescreenDialog; +import org.chromium.chrome.browser.webapps.TouchlessAddToHomescreenDialog; /** * Handles the promotion and installation of an app specified by the current web page. This object @@ -102,9 +104,21 @@ mTab.getWindowAndroid().showIntent(appData.detailsIntent(), null, null); } + /** + * Build a dialog based on the browser mode. + * @return A version of the {@link AddToHomescreenDialog}. + */ + private AddToHomescreenDialog buildDialog() { + if (FeatureUtilities.isNoTouchModeEnabled()) { + return new TouchlessAddToHomescreenDialog( + mTab.getActivity(), mTab.getActivity().getModalDialogManager(), this); + } + return new AddToHomescreenDialog(mTab.getActivity(), this); + } + @CalledByNative private boolean showNativeAppDialog(String title, Bitmap iconBitmap, AppData appData) { - mDialog = new AddToHomescreenDialog(mTab.getActivity(), this); + mDialog = buildDialog(); mDialog.show(); mDialog.onUserTitleAvailable(title, appData.installButtonText(), appData.rating()); mDialog.onIconAvailable(iconBitmap); @@ -113,7 +127,7 @@ @CalledByNative private boolean showWebAppDialog(String title, Bitmap iconBitmap, String url) { - mDialog = new AddToHomescreenDialog(mTab.getActivity(), this); + mDialog = buildDialog(); mDialog.show(); mDialog.onUserTitleAvailable(title, url, true /* isWebapp */); mDialog.onIconAvailable(iconBitmap);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfiguration.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfiguration.java index 3924277..e1c8d59 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfiguration.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfiguration.java
@@ -6,7 +6,6 @@ import org.chromium.base.annotations.JNINamespace; import org.chromium.chrome.browser.ChromeFeatureList; -import org.chromium.chrome.browser.profiles.Profile; /** * Allows the querying and setting of Offline Prefetch related configurations. @@ -27,14 +26,14 @@ * user setting to be true. If the current browser Profile is null this method returns false. */ public static boolean isPrefetchingEnabled() { - return nativeIsPrefetchingEnabled(Profile.getLastUsedProfile()); + return nativeIsPrefetchingEnabled(); } /** * Return the value of offline_pages.enabled_by_server pref. */ public static boolean isPrefetchingEnabledByServer() { - return nativeIsEnabledByServer(Profile.getLastUsedProfile()); + return nativeIsEnabledByServer(); } /** @@ -43,14 +42,14 @@ * since the last check. */ public static boolean isForbiddenCheckDue() { - return nativeIsForbiddenCheckDue(Profile.getLastUsedProfile()); + return nativeIsForbiddenCheckDue(); } /** * Returns true if the GeneratePageBundle-forbidden check has never run and is due to run. */ public static boolean isEnabledByServerUnknown() { - return nativeIsEnabledByServerUnknown(Profile.getLastUsedProfile()); + return nativeIsEnabledByServerUnknown(); } /** @@ -58,7 +57,7 @@ * enabled or disabled. If the current browser Profile is null the setting will not be changed. */ public static void setPrefetchingEnabledInSettings(boolean enabled) { - nativeSetPrefetchingEnabledInSettings(Profile.getLastUsedProfile(), enabled); + nativeSetPrefetchingEnabledInSettings(enabled); } /** @@ -66,14 +65,13 @@ * enabled or disabled. */ public static boolean isPrefetchingEnabledInSettings() { - return nativeIsPrefetchingEnabledInSettings(Profile.getLastUsedProfile()); + return nativeIsPrefetchingEnabledInSettings(); } - private static native boolean nativeIsPrefetchingEnabled(Profile profile); - private static native boolean nativeIsEnabledByServer(Profile profile); - private static native boolean nativeIsForbiddenCheckDue(Profile profile); - private static native boolean nativeIsEnabledByServerUnknown(Profile profile); - private static native void nativeSetPrefetchingEnabledInSettings( - Profile profile, boolean enabled); - private static native boolean nativeIsPrefetchingEnabledInSettings(Profile profile); + private static native boolean nativeIsPrefetchingEnabled(); + private static native boolean nativeIsEnabledByServer(); + private static native boolean nativeIsForbiddenCheckDue(); + private static native boolean nativeIsEnabledByServerUnknown(); + private static native void nativeSetPrefetchingEnabledInSettings(boolean enabled); + private static native boolean nativeIsPrefetchingEnabledInSettings(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java index c572985..c783ff11 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java
@@ -61,6 +61,52 @@ } /** + * Converts Play's {@link UpdateAvailability} enum to a stable monotomically incrementing Chrome + * enum. This is used for metric stability. + * Treat this as append only as it is used by UMA as the InlineUpdateAvailability enum. + */ + @IntDef({UpdateAvailabilityMetric.UNTRACKED, UpdateAvailabilityMetric.UNKNOWN, + UpdateAvailabilityMetric.UPDATE_NOT_AVAILABLE, + UpdateAvailabilityMetric.UPDATE_AVAILABLE, + UpdateAvailabilityMetric.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS}) + @Retention(RetentionPolicy.SOURCE) + public @interface UpdateAvailabilityMetric { + int UNTRACKED = 0; + int UNKNOWN = 1; + int UPDATE_NOT_AVAILABLE = 2; + int UPDATE_AVAILABLE = 3; + int DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS = 4; + + int NUM_ENTRIES = 5; + } + + /** + * Converts Play's {@link InstallStatus} enum to a stable monotomically incrementing Chrome + * enum. This is used for metric stability. + * Treat this as append only as it is used by UMA as the InlineUpdateAvailability enum. + */ + @IntDef({InstallStatusMetric.UNTRACKED, InstallStatusMetric.UNKNOWN, + InstallStatusMetric.REQUIRES_UI_INTENT, InstallStatusMetric.PENDING, + InstallStatusMetric.DOWNLOADING, InstallStatusMetric.DOWNLOADED, + InstallStatusMetric.INSTALLING, InstallStatusMetric.INSTALLED, + InstallStatusMetric.FAILED, InstallStatusMetric.CANCELED}) + @Retention(RetentionPolicy.SOURCE) + public @interface InstallStatusMetric { + int UNTRACKED = 0; + int UNKNOWN = 1; + int REQUIRES_UI_INTENT = 2; + int PENDING = 3; + int DOWNLOADING = 4; + int DOWNLOADED = 5; + int INSTALLING = 6; + int INSTALLED = 7; + int FAILED = 8; + int CANCELED = 9; + + int NUM_ENTRIES = 10; + } + + /** * A list of possible Play API call site failures. * Treat this as append only as it is used by UMA. */ @@ -177,6 +223,7 @@ Log.i(TAG, "pullCurrentState(" + mUpdateAvailability + ", " + mInstallStatus + ") success."); + recordOnAppUpdateInfo(info); pushStatus(); }) .addOnFailureListener(exception -> { @@ -284,6 +331,57 @@ } } + private static @UpdateAvailabilityMetric int updateAvailabilityToMetrics( + @UpdateAvailability int updateAvailability) { + switch (updateAvailability) { + case UpdateAvailability.UNKNOWN: + return UpdateAvailabilityMetric.UNKNOWN; + case UpdateAvailability.UPDATE_NOT_AVAILABLE: + return UpdateAvailabilityMetric.UPDATE_NOT_AVAILABLE; + case UpdateAvailability.UPDATE_AVAILABLE: + return UpdateAvailabilityMetric.UPDATE_AVAILABLE; + case UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS: + return UpdateAvailabilityMetric.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS; + default: + return UpdateAvailabilityMetric.UNTRACKED; + } + } + + private static @InstallStatusMetric int installStatusToMetrics( + @InstallStatus int installStatus) { + switch (installStatus) { + case InstallStatus.UNKNOWN: + return InstallStatusMetric.UNKNOWN; + case InstallStatus.REQUIRES_UI_INTENT: + return InstallStatusMetric.REQUIRES_UI_INTENT; + case InstallStatus.PENDING: + return InstallStatusMetric.PENDING; + case InstallStatus.DOWNLOADING: + return InstallStatusMetric.DOWNLOADING; + case InstallStatus.DOWNLOADED: + return InstallStatusMetric.DOWNLOADED; + case InstallStatus.INSTALLING: + return InstallStatusMetric.INSTALLING; + case InstallStatus.INSTALLED: + return InstallStatusMetric.INSTALLED; + case InstallStatus.FAILED: + return InstallStatusMetric.FAILED; + case InstallStatus.CANCELED: + return InstallStatusMetric.CANCELED; + default: + return InstallStatusMetric.UNTRACKED; + } + } + + private static void recordOnAppUpdateInfo(AppUpdateInfo info) { + RecordHistogram.recordEnumeratedHistogram( + "GoogleUpdate.Inline.AppUpdateInfo.UpdateAvailability", + updateAvailabilityToMetrics(info.updateAvailability()), + UpdateAvailabilityMetric.NUM_ENTRIES); + RecordHistogram.recordEnumeratedHistogram("GoogleUpdate.Inline.AppUpdateInfo.InstallStatus", + installStatusToMetrics(info.installStatus()), InstallStatusMetric.NUM_ENTRIES); + } + private static void recordCallFailure(@CallFailure int failure) { RecordHistogram.recordEnumeratedHistogram( "GoogleUpdate.Inline.CallFailure", failure, CallFailure.NUM_ENTRIES);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/usage_stats/PageViewObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/usage_stats/PageViewObserver.java index 7cee9c0..0865c87 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/usage_stats/PageViewObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/usage_stats/PageViewObserver.java
@@ -21,6 +21,7 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver; import org.chromium.chrome.browser.tabmodel.TabSelectionType; +import org.chromium.content_public.browser.NavigationHandle; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -32,6 +33,7 @@ @SuppressLint("NewApi") public class PageViewObserver { private static final String TAG = "PageViewObserver"; + private static final String AMP_QUERY_PARAM = "amp_js_v"; private final Activity mActivity; private final TabModelSelectorTabModelObserver mTabModelObserver; @@ -56,7 +58,7 @@ @Override public void onShown(Tab tab, @TabSelectionType int type) { if (!tab.isLoading() && !tab.isBeingRestored()) { - updateUrl(tab.getUrl()); + updateUsingCanonicalUrl(tab); } } @@ -80,13 +82,25 @@ public void didFirstVisuallyNonEmptyPaint(Tab tab) { assert tab == mCurrentTab; - updateUrl(tab.getUrl()); + updateUsingCanonicalUrl(tab); } @Override public void onCrash(Tab tab) { updateUrl(null); } + + @Override + public void onDidFinishNavigation(Tab tab, NavigationHandle navigation) { + // We only check isLikelySubframeAmpNavigation here because this is the only + // observer method that fires for subframe navigations. The reason we have the + // isLikelySubframeAmpNavigation at all is that onDidFinishNavigation triggers very + // often, and we only want to bother getting the canonical URL if we think there's a + // good chance that it will actually be present. + if (isLikelySubframeAmpNavigation(navigation)) { + updateUsingCanonicalUrl(tab); + } + } }; mTabModelObserver = new TabModelSelectorTabModelObserver(tabModelSelector) { @@ -132,6 +146,22 @@ } } + private void updateUsingCanonicalUrl(Tab tab) { + if (tab.getWebContents() == null || tab.getWebContents().getMainFrame() == null) { + updateUrl(tab.getUrl()); + return; + } + + tab.getWebContents().getMainFrame().getCanonicalUrlForSharing((canonicalUrl) -> { + if (tab != mCurrentTab) return; + String urlToUse = tab.getUrl(); + if (canonicalUrl != null && canonicalUrl.length() > 0) { + urlToUse = canonicalUrl; + } + updateUrl(urlToUse); + }); + } + /** * Updates our state from the previous url to {@code newUrl}. This can result in any/all of the * following: @@ -202,7 +232,7 @@ // If the newly active tab is hidden, we don't want to check its URL yet; we'll wait until // the onShown event fires. if (mCurrentTab != null && !tab.isHidden()) { - updateUrl(mCurrentTab.getUrl()); + updateUsingCanonicalUrl(tab); } } @@ -244,4 +274,18 @@ String host = Uri.parse(url).getHost(); return host == null ? "" : host; } + + private boolean isLikelySubframeAmpNavigation(NavigationHandle navigation) { + if (navigation.isInMainFrame()) return false; + String subframeUrl = navigation.getUrl(); + if (subframeUrl == null || subframeUrl.length() == 0) return false; + + // Our heuristic for AMP pages, based on AMPPageLoadMetricsObserver, is to look for a + // subframe navigation that contains "amp_js_v" in the query. This might produce a false + // positive, but we're OK with that; we'll just call updateUrl an extra time. This is a + // no-op if the URL hasn't actually changed. + String query = Uri.parse(subframeUrl).getQuery(); + if (query == null) return false; + return query.contains(AMP_QUERY_PARAM); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenManager.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenManager.java index e6f07d7..8e9b25a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenManager.java
@@ -11,6 +11,7 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.content_public.browser.WebContents; /** @@ -82,7 +83,12 @@ */ @CalledByNative public void showDialog() { - mDialog = new AddToHomescreenDialog(mActivity, this); + if (FeatureUtilities.isNoTouchModeEnabled()) { + mDialog = new TouchlessAddToHomescreenDialog( + mActivity, mTab.getActivity().getModalDialogManager(), this); + } else { + mDialog = new AddToHomescreenDialog(mActivity, this); + } mDialog.show(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/TouchlessAddToHomescreenDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/TouchlessAddToHomescreenDialog.java new file mode 100644 index 0000000..f1dfdd5 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/TouchlessAddToHomescreenDialog.java
@@ -0,0 +1,155 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.webapps; + +import android.annotation.TargetApi; +import android.app.Activity; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.os.Build; +import android.text.TextUtils; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.touchless.dialog.TouchlessDialogProperties; +import org.chromium.chrome.browser.touchless.dialog.TouchlessDialogProperties.DialogListItemProperties; +import org.chromium.ui.modaldialog.DialogDismissalCause; +import org.chromium.ui.modaldialog.ModalDialogManager; +import org.chromium.ui.modaldialog.ModalDialogProperties; +import org.chromium.ui.modelutil.PropertyModel; + +/** A touchless variation of the {@link AddToHomescreenDialog}. */ +public class TouchlessAddToHomescreenDialog extends AddToHomescreenDialog { + private Activity mActivity; + private Delegate mDelegate; + private ModalDialogManager mDialogManager; + private PropertyModel mModel; + + public TouchlessAddToHomescreenDialog( + Activity activity, ModalDialogManager dialogManager, Delegate delegate) { + super(activity, delegate); + mActivity = activity; + mDialogManager = dialogManager; + mDelegate = delegate; + } + + @Override + public void show() { + mModel = buildTouchlessDialogModel(); + mDialogManager.showDialog(mModel, ModalDialogManager.ModalDialogType.APP); + } + + /** + * Build the property model for the dialog in touchless mode. + * @return A model to pass to a {@link ModalDialogManager}. + */ + private PropertyModel buildTouchlessDialogModel() { + Resources res = mActivity.getResources(); + ModalDialogProperties.Controller controller = new ModalDialogProperties.Controller() { + @Override + public void onClick(PropertyModel model, int buttonType) {} + + @Override + public void onDismiss(PropertyModel model, int dismissalCause) { + mDelegate.onDialogDismissed(); + } + }; + final PropertyModel model = + new PropertyModel.Builder(TouchlessDialogProperties.ALL_DIALOG_KEYS) + .with(TouchlessDialogProperties.IS_FULLSCREEN, false) + .with(ModalDialogProperties.CONTROLLER, controller) + .build(); + model.set(TouchlessDialogProperties.PRIORITY, TouchlessDialogProperties.Priority.HIGH); + model.set(ModalDialogProperties.TITLE, + res.getString(org.chromium.chrome.R.string.menu_add_to_apps)); + TouchlessDialogProperties.ActionNames actions = new TouchlessDialogProperties.ActionNames(); + actions.cancel = org.chromium.chrome.R.string.cancel; + actions.select = org.chromium.chrome.R.string.select; + actions.alt = 0; + model.set(TouchlessDialogProperties.ACTION_NAMES, actions); + + model.set(TouchlessDialogProperties.CANCEL_ACTION, + (v) -> mDialogManager.dismissDialog(model, DialogDismissalCause.UNKNOWN)); + + model.set(TouchlessDialogProperties.LIST_MODELS, + new PropertyModel[] {buildListItemModel("")}); + + model.set(ModalDialogProperties.CUSTOM_VIEW, + mActivity.getLayoutInflater().inflate(R.layout.touchless_add_to_apps, null)); + + return model; + } + + /** + * Build the list item that adds the app or site to the home screen. + * @param title The title of the app or site. + * @return The list item for the dialog model. + */ + private PropertyModel buildListItemModel(final String title) { + Resources res = mActivity.getResources(); + return new PropertyModel.Builder(DialogListItemProperties.ALL_KEYS) + .with(DialogListItemProperties.TEXT, + res.getString(org.chromium.chrome.R.string.add)) + .with(DialogListItemProperties.ICON, + ApiCompatibilityUtils.getDrawable( + res, org.chromium.chrome.R.drawable.ic_add)) + .with(DialogListItemProperties.MULTI_CLICKABLE, false) + .with(DialogListItemProperties.CLICK_LISTENER, + (v) -> { + if (TextUtils.isEmpty(title)) return; + mDelegate.addToHomescreen(title); + mDialogManager.dismissDialog(mModel, DialogDismissalCause.UNKNOWN); + }) + .build(); + } + + /** + * Update the custom view shown for the touchless dialog. This shows the name of the app, icon, + * and site. + */ + private void updateModelCustomView(Bitmap icon, String title, String origin) { + ViewGroup group = (ViewGroup) mModel.get(ModalDialogProperties.CUSTOM_VIEW); + + group.findViewById(R.id.spinny).setVisibility(View.GONE); + group.findViewById(R.id.icon).setVisibility(View.VISIBLE); + group.findViewById(R.id.app_info).setVisibility(View.VISIBLE); + + if (icon != null) ((ImageView) group.findViewById(R.id.icon)).setImageBitmap(icon); + if (title != null) ((TextView) group.findViewById(R.id.name)).setText(title); + if (origin != null) ((TextView) group.findViewById(R.id.origin)).setText(origin); + } + + @Override + public void onUserTitleAvailable(String title, String url, boolean isWebapp) { + updateModelCustomView(null, title, url); + mModel.set(TouchlessDialogProperties.LIST_MODELS, + new PropertyModel[] {buildListItemModel(title)}); + } + + @Override + public void onUserTitleAvailable(String title, String installText, float rating) { + updateModelCustomView(null, title, null); + } + + @Override + public void onIconAvailable(Bitmap icon) { + updateModelCustomView(icon, null, null); + } + + @Override + @TargetApi(Build.VERSION_CODES.O) + public void onAdaptableIconAvailable(Bitmap icon) { + updateModelCustomView(icon, null, null); + } + + @Override + public void onClick(View v) { + // Intentionally do nothing. + } +}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index 590b4f5..1870f55e 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -2315,6 +2315,9 @@ <message name="IDS_NOTIFICATION_WEBAPK_INSTALLED" desc="Indicates that a WebAPK has been successfully added to Home screen."> Added to Home screen </message> + <message name="IDS_MENU_ADD_TO_APPS" desc="Text to accompany icon that will navigate to a page showing a categorized view of different applications or sites"> + Add to My apps + </message> <!-- Page info popup --> <message name="IDS_PAGE_INFO_SITE_SETTINGS_BUTTON" desc="Text in the button that opens a website's Site Settings from the Page Info dialog.">
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ServicificationBackgroundService.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ServicificationBackgroundService.java index 890ba9d7..caf10b0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ServicificationBackgroundService.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ServicificationBackgroundService.java
@@ -15,6 +15,7 @@ import org.chromium.chrome.browser.init.BrowserParts; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.init.EmptyBrowserParts; +import org.chromium.chrome.browser.init.ServiceManagerStartupUtils; import org.chromium.content_public.browser.BrowserStartupController; import org.chromium.content_public.browser.test.util.Criteria; import org.chromium.content_public.browser.test.util.CriteriaHelper; @@ -28,6 +29,13 @@ private boolean mNativeLoaded; private boolean mSupportsServiceManagerOnly; + public static void launchChromeInBackground(boolean serviceManagerOnlyMode) { + ServicificationBackgroundService service = + new ServicificationBackgroundService(serviceManagerOnlyMode); + service.onRunTask(new TaskParams(ServiceManagerStartupUtils.TASK_TAG)); + service.waitForNativeLoaded(); + } + public ServicificationBackgroundService(boolean supportsServiceManagerOnly) { mSupportsServiceManagerOnly = supportsServiceManagerOnly; }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflineTestUtil.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflineTestUtil.java index 5a60f90..81635af 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflineTestUtil.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflineTestUtil.java
@@ -164,9 +164,8 @@ // Set the offline_pages.enabled_by_server pref for testing. If |enabled| is false, // also ensures that the server-enabled check is due. public static void setPrefetchingEnabledByServer(boolean enabled) { - TestThreadUtils.runOnUiThreadBlocking(() -> { - nativeSetPrefetchingEnabledByServer(Profile.getLastUsedProfile(), enabled); - }); + TestThreadUtils.runOnUiThreadBlocking( + () -> { nativeSetPrefetchingEnabledByServer(enabled); }); } private static native void nativeGetRequestsInQueue(Callback<SavePageRequest[]> callback); @@ -177,6 +176,5 @@ private static native void nativeClearIntercepts(); private static native void nativeDumpRequestCoordinatorState(Callback<String> callback); private static native void nativeWaitForConnectivityState(boolean connected, Runnable callback); - private static native void nativeSetPrefetchingEnabledByServer( - Profile profile, boolean enabled); + private static native void nativeSetPrefetchingEnabledByServer(boolean enabled); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskTest.java index 55d61e6..251d617a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskTest.java
@@ -12,7 +12,6 @@ import android.support.test.filters.SmallTest; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -21,9 +20,9 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisabledTest; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.ServicificationBackgroundService; import org.chromium.chrome.browser.offlinepages.OfflineTestUtil; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.components.background_task_scheduler.BackgroundTask.TaskFinishedCallback; import org.chromium.components.background_task_scheduler.BackgroundTaskScheduler; import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory; @@ -43,9 +42,6 @@ @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=OfflinePagesPrefetching"}) public class PrefetchBackgroundTaskTest { - @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); - private static final double BACKOFF_JITTER_FACTOR = 0.33; private static final int SEMAPHORE_TIMEOUT_MS = 5000; private static final String GCM_TOKEN = "dummy_gcm_token"; @@ -185,7 +181,7 @@ @Before public void setUp() throws Exception { - mActivityTestRule.startMainActivityOnBlankPage(); + ServicificationBackgroundService.launchChromeInBackground(true /*serviceManagerOnlyMode*/); TestThreadUtils.runOnUiThreadBlocking(() -> { mScheduler = new TestBackgroundTaskScheduler(); BackgroundTaskSchedulerFactory.setSchedulerForTesting(mScheduler);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfigurationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfigurationTest.java index 29a080c..621bf15 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfigurationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfigurationTest.java
@@ -10,17 +10,15 @@ import android.support.test.filters.MediumTest; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.ServicificationBackgroundService; import org.chromium.chrome.browser.offlinepages.OfflineTestUtil; -import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.browser.Features; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -31,14 +29,10 @@ @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) @RunWith(ChromeJUnit4ClassRunner.class) public class PrefetchConfigurationTest { - @Rule - public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = - new ChromeActivityTestRule<>(ChromeActivity.class); - @Before public void setUp() throws Exception { // Start Chrome. - mActivityTestRule.startMainActivityOnBlankPage(); + ServicificationBackgroundService.launchChromeInBackground(true /*serviceManagerOnlyMode*/); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/OWNERS b/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/OWNERS new file mode 100644 index 0000000..1aa49e4 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/OWNERS
@@ -0,0 +1 @@ +file://chrome/android/java/src/org/chromium/chrome/browser/usage_stats/OWNERS
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/TabSuspensionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/TabSuspensionTest.java index 83bdbb1..a5a77c8 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/TabSuspensionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/usage_stats/TabSuspensionTest.java
@@ -13,7 +13,6 @@ import android.support.test.filters.MediumTest; import org.junit.After; -import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -21,10 +20,8 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.MinAndroidSdkLevel; -import org.chromium.base.test.util.ScalableTimeout; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeTabbedActivity; @@ -34,7 +31,6 @@ import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils; import org.chromium.chrome.browser.multiwindow.MultiWindowTestHelper; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; -import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabTestUtils; import org.chromium.chrome.browser.tabmodel.TabLaunchType; @@ -45,6 +41,8 @@ import org.chromium.chrome.test.util.MenuUtils; import org.chromium.components.safe_browsing.SafeBrowsingApiBridge; import org.chromium.content_public.browser.LoadUrlParams; +import org.chromium.content_public.browser.test.util.CriteriaHelper; +import org.chromium.content_public.browser.test.util.JavaScriptUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.common.ContentSwitches; import org.chromium.net.test.EmbeddedTestServer; @@ -65,6 +63,9 @@ public class TabSuspensionTest { private static final String STARTING_FQDN = "example.com"; private static final String DIFFERENT_FQDN = "www.google.com"; + private static final String MAINFRAME_TEST_PAGE = + "/chrome/test/data/android/usage_stats/amp_root.html"; + private static final String SUBFRAME_TEST_PAGE = "/chrome/test/data/android/test.html"; @Rule public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @@ -285,6 +286,38 @@ }); } + @Test + @MediumTest + public void testAmpPage() throws InterruptedException, TimeoutException { + String mainframeUrl = mTestServer.getURLWithHostName(DIFFERENT_FQDN, MAINFRAME_TEST_PAGE); + mActivityTestRule.loadUrl(mainframeUrl); + doReturn(true).when(mSuspensionTracker).isWebsiteSuspended(STARTING_FQDN); + + String iframeSrc = + mTestServer.getURLWithHostName(STARTING_FQDN, SUBFRAME_TEST_PAGE + "?amp_js_v=0"); + String code = "document.getElementById('iframe_test_id').src='" + iframeSrc + "';"; + JavaScriptUtils.executeJavaScriptAndWaitForResult( + mTab.getWebContents(), code, 3, TimeUnit.SECONDS); + waitForSuspendedTabToShow(mTab, STARTING_FQDN); + + doReturn(false).when(mSuspensionTracker).isWebsiteSuspended(STARTING_FQDN); + unsuspendDomain(STARTING_FQDN); + assertSuspendedTabHidden(mTab); + + // Un-suspension reloads the page, so we need to wait for it to load and re-navigate the + // iframe back to the suspended domain. + ChromeTabUtils.waitForTabPageLoaded(mTab, mainframeUrl); + JavaScriptUtils.executeJavaScriptAndWaitForResult( + mTab.getWebContents(), code, 3, TimeUnit.SECONDS); + + doReturn(true).when(mSuspensionTracker).isWebsiteSuspended(STARTING_FQDN); + suspendDomain(STARTING_FQDN); + waitForSuspendedTabToShow(mTab, STARTING_FQDN); + + mActivityTestRule.loadUrl(mDifferentUrl); + assertSuspendedTabHidden(mTab); + } + private void startLoadingUrl(Tab tab, String url) { TestThreadUtils.runOnUiThreadBlocking( () -> { tab.loadUrl(new LoadUrlParams(url, PageTransition.TYPED)); }); @@ -319,35 +352,10 @@ } private void waitForSuspendedTabToShow(Tab tab, String fqdn) throws InterruptedException { - final CallbackHelper startedCallback = new CallbackHelper(); - TestThreadUtils.runOnUiThreadBlocking(() -> { - SuspendedTab suspendedTab = SuspendedTab.from(tab); - if (suspendedTab.isShowing()) { - startedCallback.notifyCalled(); - return; - } + CriteriaHelper.pollUiThread(() -> { + return SuspendedTab.from(tab).isShowing(); + }, "Suspended tab should be showing", 10000, 50); - tab.addObserver(new EmptyTabObserver() { - @Override - public void onUpdateUrl(Tab tab, String url) { - startedCallback.notifyCalled(); - tab.removeObserver(this); - } - - @Override - public void onShown(Tab tab, @TabSelectionType int type) { - startedCallback.notifyCalled(); - tab.removeObserver(this); - } - }); - }); - - try { - startedCallback.waitForCallback( - 0, 1, ScalableTimeout.scaleTimeout(10), TimeUnit.SECONDS); - assertSuspendedTabShowing(tab, fqdn); - } catch (TimeoutException e) { - Assert.fail("Tab never painted. url at failure: " + tab.getUrl()); - } + assertSuspendedTabShowing(tab, fqdn); } } \ No newline at end of file
diff --git a/chrome/android/touchless/java/res/layout/touchless_dialog_view.xml b/chrome/android/touchless/java/res/layout/touchless_dialog_view.xml index 2d999ad..28e4e2b 100644 --- a/chrome/android/touchless/java/res/layout/touchless_dialog_view.xml +++ b/chrome/android/touchless/java/res/layout/touchless_dialog_view.xml
@@ -35,6 +35,13 @@ android:textAppearance="@style/TextAppearance.BlackBody" android:visibility="gone" /> + <FrameLayout + android:id="@+id/custom" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:visibility="gone" /> + <ListView android:id="@+id/touchless_dialog_option_list" android:layout_width="match_parent"
diff --git a/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java b/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java index f26030b4..359947d 100644 --- a/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java +++ b/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java
@@ -153,6 +153,10 @@ TextView textView = dialogView.findViewById(R.id.touchless_dialog_description); textView.setText(model.get(ModalDialogProperties.MESSAGE)); textView.setVisibility(View.VISIBLE); + } else if (ModalDialogProperties.CUSTOM_VIEW == propertyKey) { + ViewGroup customGroup = dialogView.findViewById(R.id.custom); + customGroup.addView(model.get(ModalDialogProperties.CUSTOM_VIEW)); + customGroup.setVisibility(View.VISIBLE); } else if (TouchlessDialogProperties.LIST_MODELS == propertyKey) { ListView listView = dialogView.findViewById(R.id.touchless_dialog_option_list); PropertyModel[] models = model.get(TouchlessDialogProperties.LIST_MODELS);
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 12b4bf43..2b8cc75 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2488,6 +2488,8 @@ "android/preferences/website_preference_bridge.cc", "android/profile_key_startup_accessor.cc", "android/profile_key_startup_accessor.h", + "android/profile_key_util.cc", + "android/profile_key_util.h", "android/profiles/profile_downloader_android.cc", "android/profiles/profile_manager_utils.cc", "android/provider/blocking_ui_thread_async_request.cc", @@ -5247,6 +5249,8 @@ "permissions/mock_permission_request.h", "plugins/plugin_test_utils.cc", "plugins/plugin_test_utils.h", + "policy/fake_browser_dm_token_storage.cc", + "policy/fake_browser_dm_token_storage.h", "predictors/loading_test_util.cc", "predictors/loading_test_util.h", "resource_coordinator/tab_load_tracker_test_support.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 82d235e..b27b878 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -224,15 +224,6 @@ switches::kTouchEventFeatureDetectionAuto}}; #if defined(USE_AURA) -const FeatureEntry::Choice kOverscrollStartThresholdChoices[] = { - {flags_ui::kGenericExperimentChoiceDefault, "", ""}, - {flag_descriptions::kOverscrollStartThreshold133Percent, - switches::kOverscrollStartThreshold, "133"}, - {flag_descriptions::kOverscrollStartThreshold166Percent, - switches::kOverscrollStartThreshold, "166"}, - {flag_descriptions::kOverscrollStartThreshold200Percent, - switches::kOverscrollStartThreshold, "200"}}; - const FeatureEntry::Choice kPullToRefreshChoices[] = { {flags_ui::kGenericExperimentChoiceDefault, "", ""}, {flags_ui::kGenericExperimentChoiceDisabled, switches::kPullToRefresh, "0"}, @@ -496,16 +487,6 @@ }; #if defined(OS_CHROMEOS) -const FeatureEntry::Choice kAshUiModeChoices[] = { - {flags_ui::kGenericExperimentChoiceDefault, "", ""}, - {flag_descriptions::kUiModeTablet, ash::switches::kAshUiMode, - ash::switches::kAshUiModeTablet}, - {flag_descriptions::kUiModeClamshell, ash::switches::kAshUiMode, - ash::switches::kAshUiModeClamshell}, - {flag_descriptions::kUiModeAuto, ash::switches::kAshUiMode, - ash::switches::kAshUiModeAuto}, -}; - const FeatureEntry::Choice kSchedulerConfigurationChoices[] = { {flags_ui::kGenericExperimentChoiceDefault, "", ""}, {flag_descriptions::kSchedulerConfigurationConservative, @@ -1389,10 +1370,6 @@ kOsAura | kOsAndroid, FEATURE_VALUE_TYPE(features::kOverscrollHistoryNavigation)}, #if !defined(OS_ANDROID) - {"overscroll-start-threshold", - flag_descriptions::kOverscrollStartThresholdName, - flag_descriptions::kOverscrollStartThresholdDescription, kOsAura, - MULTI_VALUE_TYPE(kOverscrollStartThresholdChoices)}, {"pull-to-refresh", flag_descriptions::kPullToRefreshName, flag_descriptions::kPullToRefreshDescription, kOsAura, MULTI_VALUE_TYPE(kPullToRefreshChoices)}, @@ -2398,10 +2375,6 @@ FEATURE_VALUE_TYPE(features::kServiceWorkerLongRunningMessage)}, #if defined(OS_CHROMEOS) - {"force-tablet-mode", flag_descriptions::kUiModeName, - flag_descriptions::kUiModeDescription, kOsCrOS, - MULTI_VALUE_TYPE(kAshUiModeChoices)}, - {"scheduler-configuration", flag_descriptions::kSchedulerConfigurationName, flag_descriptions::kSchedulerConfigurationDescription, kOsCrOS, MULTI_VALUE_TYPE(kSchedulerConfigurationChoices)},
diff --git a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc index a291f9b4..278f59f 100644 --- a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc +++ b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc
@@ -277,10 +277,6 @@ int contextual_cards_version = contextual_search::kContextualCardsUrlActionsIntegration; if (base::FeatureList::IsEnabled( - chrome::android::kContextualSearchTranslationModel)) { - contextual_cards_version = - contextual_search::kContextualCardsTranslationsIntegration; - } else if (base::FeatureList::IsEnabled( chrome::android::kContextualSearchDefinitions)) { contextual_cards_version = contextual_search::kContextualCardsDefinitionsIntegration;
diff --git a/chrome/browser/android/profile_key_util.cc b/chrome/browser/android/profile_key_util.cc new file mode 100644 index 0000000..963130e --- /dev/null +++ b/chrome/browser/android/profile_key_util.cc
@@ -0,0 +1,29 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/android/profile_key_util.h" + +#include "chrome/browser/android/profile_key_startup_accessor.h" +#include "chrome/browser/profiles/profile_manager.h" + +namespace android { +namespace { + +Profile* GetProfile() { + Profile* profile = ProfileManager::GetLastUsedProfile(); + DCHECK(profile); + return profile; +} + +} // namespace + +ProfileKey* GetMainProfileKey() { + ProfileKey* key = ProfileKeyStartupAccessor::GetInstance()->profile_key(); + if (!key) + key = GetProfile()->GetProfileKey(); + DCHECK(key); + return key; +} + +} // namespace android
diff --git a/chrome/browser/android/profile_key_util.h b/chrome/browser/android/profile_key_util.h new file mode 100644 index 0000000..17c0226 --- /dev/null +++ b/chrome/browser/android/profile_key_util.h
@@ -0,0 +1,23 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ANDROID_PROFILE_KEY_UTIL_H_ +#define CHROME_BROWSER_ANDROID_PROFILE_KEY_UTIL_H_ + +class ProfileKey; + +namespace android { + +// This gets the profile key belonging to the main profile on android. This +// works in both reduced mode and full browser mode. +// +// BE WARNED you should only use this if it would have been acceptable to use +// ProfileManager::GetLastUsedProfile() in the same context. If your usecase +// cares about different profiles and their keys, then you should plumb through +// the correct key instead. +ProfileKey* GetMainProfileKey(); + +} // namespace android + +#endif // CHROME_BROWSER_ANDROID_PROFILE_KEY_UTIL_H_
diff --git a/chrome/browser/background_fetch/background_fetch_delegate_impl.cc b/chrome/browser/background_fetch/background_fetch_delegate_impl.cc index ee45d2a..41daf80 100644 --- a/chrome/browser/background_fetch/background_fetch_delegate_impl.cc +++ b/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/bind.h" +#include "base/feature_list.h" #include "base/guid.h" #include "base/logging.h" #include "base/strings/string_util.h" @@ -24,6 +25,7 @@ #include "components/content_settings/core/common/content_settings_types.h" #include "components/download/public/background_service/download_params.h" #include "components/download/public/background_service/download_service.h" +#include "components/download/public/common/download_features.h" #include "components/offline_items_collection/core/offline_content_aggregator.h" #include "components/offline_items_collection/core/offline_item.h" #include "content/public/browser/background_fetch_description.h" @@ -54,7 +56,11 @@ // Ensure that downloads UI components are initialized to handle the UI // updates. - content::BrowserContext::GetDownloadManager(profile_); + if (!base::FeatureList::IsEnabled( + download::features:: + kUseInProgressDownloadManagerForDownloadService)) { + content::BrowserContext::GetDownloadManager(profile_); + } } BackgroundFetchDelegateImpl::~BackgroundFetchDelegateImpl() {
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index bdb0192..6d565eeeb0 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -779,8 +779,6 @@ "device_sync/device_sync_client_factory.h", "display/output_protection_controller_ash.cc", "display/output_protection_controller_ash.h", - "display/output_protection_controller_mus.cc", - "display/output_protection_controller_mus.h", "display/output_protection_delegate.cc", "display/output_protection_delegate.h", "display/quirks_manager_delegate_impl.cc", @@ -1508,6 +1506,8 @@ "plugin_vm/plugin_vm_image_manager_factory.h", "plugin_vm/plugin_vm_manager.cc", "plugin_vm/plugin_vm_manager.h", + "plugin_vm/plugin_vm_metrics_util.cc", + "plugin_vm/plugin_vm_metrics_util.h", "plugin_vm/plugin_vm_pref_names.cc", "plugin_vm/plugin_vm_pref_names.h", "plugin_vm/plugin_vm_util.cc",
diff --git a/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_browsertest.cc b/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_browsertest.cc index f5b39fed..e0160e5 100644 --- a/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_browsertest.cc +++ b/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_browsertest.cc
@@ -22,7 +22,6 @@ #include "components/exo/wm_helper_chromeos.h" #include "components/viz/common/features.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/env.h" #include "ui/views/widget/widget.h" #include "ui/wm/public/activation_client.h" @@ -46,8 +45,7 @@ chromeos::AccessibilityManager::Get()->SetProfileForTest( browser()->profile()); - wm_helper_ = - std::make_unique<exo::WMHelperChromeOS>(ash::Shell::Get()->aura_env()); + wm_helper_ = std::make_unique<exo::WMHelperChromeOS>(); exo::WMHelper::SetInstance(wm_helper_.get()); }
diff --git a/chrome/browser/chromeos/arc/screen_capture/arc_screen_capture_session.cc b/chrome/browser/chromeos/arc/screen_capture/arc_screen_capture_session.cc index bac3decf..417679aa 100644 --- a/chrome/browser/chromeos/arc/screen_capture/arc_screen_capture_session.cc +++ b/chrome/browser/chromeos/arc/screen_capture/arc_screen_capture_session.cc
@@ -117,7 +117,7 @@ LOG(ERROR) << "Unable to find layer for the desktop window"; return nullptr; } - auto context_provider = display_root_window_->env() + auto context_provider = aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider(); gl_helper_ = std::make_unique<viz::GLHelper>( @@ -182,7 +182,7 @@ std::move(callback).Run(); return; } - gpu::gles2::GLES2Interface* gl = display_root_window_->env() + gpu::gles2::GLES2Interface* gl = aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider() ->ContextGL(); @@ -255,7 +255,7 @@ SetOutputBufferCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); std::move(callback).Run(); - gpu::gles2::GLES2Interface* gl = display_root_window_->env() + gpu::gles2::GLES2Interface* gl = aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider() ->ContextGL(); @@ -273,7 +273,7 @@ void ArcScreenCaptureSession::OnDesktopCaptured( std::unique_ptr<viz::CopyOutputResult> result) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - gpu::gles2::GLES2Interface* gl = display_root_window_->env() + gpu::gles2::GLES2Interface* gl = aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider() ->ContextGL(); @@ -310,7 +310,7 @@ void ArcScreenCaptureSession::CopyDesktopTextureToGpuBuffer( std::unique_ptr<DesktopTexture> desktop_texture, std::unique_ptr<PendingBuffer> pending_buffer) { - gpu::gles2::GLES2Interface* gl = display_root_window_->env() + gpu::gles2::GLES2Interface* gl = aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider() ->ContextGL(); @@ -329,7 +329,7 @@ if (desktop_texture->release_callback_) { desktop_texture->release_callback_->Run(gpu::SyncToken(), false); } - display_root_window_->env() + aura::Env::GetInstance() ->context_factory() ->SharedMainThreadContextProvider() ->ContextSupport()
diff --git a/chrome/browser/chromeos/display/output_protection_controller_mus.cc b/chrome/browser/chromeos/display/output_protection_controller_mus.cc deleted file mode 100644 index 2ef712f..0000000 --- a/chrome/browser/chromeos/display/output_protection_controller_mus.cc +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/display/output_protection_controller_mus.h" - -#include "ash/public/interfaces/constants.mojom.h" -#include "content/public/common/service_manager_connection.h" -#include "services/service_manager/public/cpp/connector.h" - -namespace chromeos { - -OutputProtectionControllerMus::OutputProtectionControllerMus() { - content::ServiceManagerConnection::GetForProcess() - ->GetConnector() - ->BindInterface(ash::mojom::kServiceName, &display_output_protection_); -} - -OutputProtectionControllerMus::~OutputProtectionControllerMus() { - DCHECK(thread_checker_.CalledOnValidThread()); -} - -void OutputProtectionControllerMus::QueryStatus( - int64_t display_id, - const OutputProtectionDelegate::QueryStatusCallback& callback) { - DCHECK(thread_checker_.CalledOnValidThread()); - display_output_protection_->QueryContentProtectionStatus(display_id, - callback); -} - -void OutputProtectionControllerMus::SetProtection( - int64_t display_id, - uint32_t desired_method_mask, - const OutputProtectionDelegate::SetProtectionCallback& callback) { - DCHECK(thread_checker_.CalledOnValidThread()); - display_output_protection_->SetContentProtection( - display_id, desired_method_mask, callback); -} - -} // namespace chromeos
diff --git a/chrome/browser/chromeos/display/output_protection_controller_mus.h b/chrome/browser/chromeos/display/output_protection_controller_mus.h deleted file mode 100644 index e00d789b..0000000 --- a/chrome/browser/chromeos/display/output_protection_controller_mus.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_OUTPUT_PROTECTION_CONTROLLER_MUS_H_ -#define CHROME_BROWSER_CHROMEOS_DISPLAY_OUTPUT_PROTECTION_CONTROLLER_MUS_H_ - -#include "ash/public/interfaces/display_output_protection.mojom.h" -#include "base/macros.h" -#include "base/threading/thread_checker.h" -#include "chrome/browser/chromeos/display/output_protection_delegate.h" - -namespace chromeos { - -// Display content protection controller for running with Mus server. -class OutputProtectionControllerMus - : public OutputProtectionDelegate::Controller { - public: - OutputProtectionControllerMus(); - ~OutputProtectionControllerMus() override; - - // OutputProtectionDelegate::Controller: - void QueryStatus( - int64_t display_id, - const OutputProtectionDelegate::QueryStatusCallback& callback) override; - void SetProtection( - int64_t display_id, - uint32_t desired_method_mask, - const OutputProtectionDelegate::SetProtectionCallback& callback) override; - - private: - ash::mojom::DisplayOutputProtectionPtr display_output_protection_; - base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(OutputProtectionControllerMus); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_DISPLAY_OUTPUT_PROTECTION_CONTROLLER_MUS_H_
diff --git a/chrome/browser/chromeos/display/output_protection_delegate.cc b/chrome/browser/chromeos/display/output_protection_delegate.cc index 4049015..dc8d8da1a 100644 --- a/chrome/browser/chromeos/display/output_protection_delegate.cc +++ b/chrome/browser/chromeos/display/output_protection_delegate.cc
@@ -6,10 +6,8 @@ #include "base/bind_helpers.h" #include "chrome/browser/chromeos/display/output_protection_controller_ash.h" -#include "chrome/browser/chromeos/display/output_protection_controller_mus.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" -#include "ui/base/ui_base_features.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/display/types/display_constants.h" @@ -158,10 +156,7 @@ if (!window) return false; - if (features::IsMultiProcessMash()) - controller_ = std::make_unique<OutputProtectionControllerMus>(); - else - controller_ = std::make_unique<OutputProtectionControllerAsh>(); + controller_ = std::make_unique<OutputProtectionControllerAsh>(); display_id_ = display_id; window_ = window;
diff --git a/chrome/browser/chromeos/kiosk_next_home/app_controller_service.cc b/chrome/browser/chromeos/kiosk_next_home/app_controller_service.cc index 1b24d00..9615abf 100644 --- a/chrome/browser/chromeos/kiosk_next_home/app_controller_service.cc +++ b/chrome/browser/chromeos/kiosk_next_home/app_controller_service.cc
@@ -11,7 +11,6 @@ #include "base/bind.h" #include "base/callback.h" -#include "base/command_line.h" #include "base/logging.h" #include "base/optional.h" #include "base/strings/string_util.h" @@ -25,7 +24,6 @@ #include "chrome/common/extensions/extension_constants.h" #include "chrome/services/app_service/public/cpp/app_service_proxy.h" #include "chrome/services/app_service/public/mojom/types.mojom.h" -#include "chromeos/constants/chromeos_switches.h" #include "components/arc/arc_service_manager.h" #include "components/arc/common/app.mojom.h" #include "components/arc/session/arc_bridge_service.h" @@ -121,33 +119,6 @@ std::move(callback))); } -void AppControllerService::LaunchHomeUrl(const std::string& suffix, - LaunchHomeUrlCallback callback) { - std::string url_prefix = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - chromeos::switches::kKioskNextHomeUrlPrefix); - - if (url_prefix.empty()) { - std::move(callback).Run(false, "No URL prefix."); - return; - } - - GURL url(url_prefix + suffix); - if (!url.is_valid()) { - std::move(callback).Run(false, "Invalid URL."); - return; - } - - arc::mojom::AppInstance* app_instance = GetArcAppInstanceForLaunchIntent(); - if (!app_instance) { - std::move(callback).Run(false, "ARC bridge not available."); - return; - } - - app_instance->LaunchIntent(url.spec(), display::kDefaultDisplayId); - std::move(callback).Run(true, base::nullopt); -} - void AppControllerService::LaunchIntent(const std::string& intent, LaunchIntentCallback callback) { GURL intent_uri(intent);
diff --git a/chrome/browser/chromeos/kiosk_next_home/app_controller_service.h b/chrome/browser/chromeos/kiosk_next_home/app_controller_service.h index f25b63e8..2a41796 100644 --- a/chrome/browser/chromeos/kiosk_next_home/app_controller_service.h +++ b/chrome/browser/chromeos/kiosk_next_home/app_controller_service.h
@@ -54,8 +54,6 @@ void UninstallApp(const std::string& app_id) override; void GetArcAndroidId( mojom::AppController::GetArcAndroidIdCallback callback) override; - void LaunchHomeUrl(const std::string& suffix, - LaunchHomeUrlCallback callback) override; void LaunchIntent(const std::string& intent, LaunchIntentCallback callback) override;
diff --git a/chrome/browser/chromeos/kiosk_next_home/app_controller_service_unittest.cc b/chrome/browser/chromeos/kiosk_next_home/app_controller_service_unittest.cc index 7640083..6de0a2c3c 100644 --- a/chrome/browser/chromeos/kiosk_next_home/app_controller_service_unittest.cc +++ b/chrome/browser/chromeos/kiosk_next_home/app_controller_service_unittest.cc
@@ -10,7 +10,6 @@ #include <utility> #include <vector> -#include "base/command_line.h" #include "base/optional.h" #include "base/test/bind_test_util.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" @@ -22,12 +21,10 @@ #include "chrome/services/app_service/public/cpp/app_service_proxy.h" #include "chrome/services/app_service/public/cpp/app_update.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/constants/chromeos_switches.h" #include "components/arc/test/fake_app_instance.h" #include "components/keyed_service/core/keyed_service.h" #include "content/public/test/test_browser_thread_bundle.h" #include "mojo/public/cpp/bindings/binding.h" -#include "mojo/public/cpp/bindings/interface_request.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/display/types/display_constants.h" @@ -50,8 +47,7 @@ class FakeAppControllerClient : public mojom::AppControllerClient { public: - explicit FakeAppControllerClient( - mojo::InterfaceRequest<mojom::AppControllerClient> request) + explicit FakeAppControllerClient(mojom::AppControllerClientRequest request) : binding_(this, std::move(request)) {} const std::vector<mojom::AppPtr>& app_updates() { return app_updates_; } @@ -142,11 +138,6 @@ void StopArc() { arc_test_.StopArcInstance(); } - void SetHomeUrlPrefix(const std::string& url_prefix) { - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - chromeos::switches::kKioskNextHomeUrlPrefix, url_prefix); - } - void AddAppDeltaToAppService(apps::mojom::AppPtr delta) { std::vector<apps::mojom::AppPtr> deltas; deltas.push_back(std::move(delta)); @@ -214,39 +205,6 @@ service()->SetIntentConfigHelperForTesting(std::move(intent_config_helper)); } - void ExpectLaunchHomeUrlResponse( - const std::string& url_to_launch, - bool success, - const base::Optional<std::string>& error_message) { - bool returned_success; - base::Optional<std::string> returned_error_message; - - service()->LaunchHomeUrl( - url_to_launch, - base::BindLambdaForTesting( - [&returned_success, &returned_error_message]( - bool success, - const base::Optional<std::string>& error_message) { - returned_success = success; - returned_error_message = error_message; - })); - - EXPECT_EQ(returned_success, success); - - // We first check if the optionals have the same value state. - // Then we check their values. This is necessary to get more readable - // failure messages when the returned values are different, if we simply - // compare two different optionals we get: - // Expected equality of these values: - // returned_error_message - // Which is: 32-byte object <01-00 ... 00-00> - // error_message - // Which is: 32-byte object <01-2E ... 00-00> - ASSERT_EQ(returned_error_message.has_value(), error_message.has_value()); - if (returned_error_message.has_value()) - EXPECT_EQ(returned_error_message.value(), error_message.value()); - } - void ExpectLaunchIntentResponse( const std::string& intent_uri, bool success, @@ -551,34 +509,6 @@ ExpectArcAndroidIdResponse(false, "0"); } -TEST_F(AppControllerServiceTest, LaunchHomeUrlFailsWhenWeDontHaveUrlPrefix) { - base::Optional<std::string> error_message("No URL prefix."); - ExpectLaunchHomeUrlResponse("http://example.com", false, error_message); - ExpectNoLaunchedIntents(); -} - -TEST_F(AppControllerServiceTest, LaunchHomeUrlFailsWhenArcIsDisabled) { - SetHomeUrlPrefix("https://example.com/?q="); - StopArc(); - base::Optional<std::string> error_message("ARC bridge not available."); - ExpectLaunchHomeUrlResponse("example_query", false, error_message); - ExpectNoLaunchedIntents(); -} - -TEST_F(AppControllerServiceTest, LaunchHomeUrlFailsWhenUrlIsInvalid) { - SetHomeUrlPrefix("invalid_url_prefix_example"); - base::Optional<std::string> error_message("Invalid URL."); - ExpectLaunchHomeUrlResponse("invalid_query", false, error_message); - ExpectNoLaunchedIntents(); -} - -TEST_F(AppControllerServiceTest, LaunchHomeUrlLaunchesWhenWeHaveAValidPrefix) { - SetHomeUrlPrefix("https://example.com/?q="); - ExpectLaunchHomeUrlResponse("example_query", true, base::nullopt); - - ExpectIntentLaunched("https://example.com/?q=example_query"); -} - TEST_F(AppControllerServiceTest, LaunchIntentLaunchesWhenAllowed) { SetLaunchIntentAllowed(/*allowed=*/true); std::string intent = "https://example.com/path?q=query";
diff --git a/chrome/browser/chromeos/kiosk_next_home/mojom/app_controller.mojom b/chrome/browser/chromeos/kiosk_next_home/mojom/app_controller.mojom index 1c54742..bdd17b8f 100644 --- a/chrome/browser/chromeos/kiosk_next_home/mojom/app_controller.mojom +++ b/chrome/browser/chromeos/kiosk_next_home/mojom/app_controller.mojom
@@ -56,11 +56,6 @@ // Gets the Android ID for the ARC container. GetArcAndroidId() => (bool success, string android_id); - // Launches URL prefixed by chromeos::switches::kKioskNextHomeUrlPrefix with - // the given suffix. - // TODO(brunoad): Remove once LaunchIntent can be used. - LaunchHomeUrl(string suffix) => (bool launched, string? error_message); - // Launches allowed ARC intents. // Intents are checked via chromeos::kiosk_next_home::IntentConfigHelper. LaunchIntent(string intent) => (bool launched, string? error_message);
diff --git a/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager.cc b/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager.cc index a83e8a18..5f4ab10 100644 --- a/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager.cc +++ b/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager.cc
@@ -14,6 +14,7 @@ #include "base/strings/string_util.h" #include "base/task/post_task.h" #include "base/task/task_traits.h" +#include "chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_pref_names.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h" #include "chrome/browser/download/download_service_factory.h" @@ -156,6 +157,7 @@ state_ = State::DOWNLOADED; if (observer_) observer_->OnDownloadCompleted(); + RecordPluginVmImageDownloadedSize(info.bytes_downloaded); } void PluginVmImageManager::OnDownloadCancelled() {
diff --git a/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager_unittest.cc b/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager_unittest.cc index 506f3a4..0f34328 100644 --- a/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager_unittest.cc +++ b/chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager_unittest.cc
@@ -11,9 +11,11 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/optional.h" +#include "base/test/metrics/histogram_tester.h" #include "chrome/browser/chromeos/login/users/mock_user_manager.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_image_download_client.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_image_manager_factory.h" +#include "chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_pref_names.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" @@ -49,6 +51,8 @@ const int kContent2Size = strlen(kContent2); const int kContentSize = kContent1Size + kContent2Size; const char kLicenseKey[] = "LICENSE_KEY"; +// File size set in test_download_service. +const int kDownloadedPluginVmImageSizeInMb = 123456789u / (1024 * 1024); } // namespace @@ -86,6 +90,7 @@ download::test::TestDownloadService* download_service_; std::unique_ptr<MockObserver> observer_; base::FilePath fake_downloaded_plugin_vm_image_archive_; + std::unique_ptr<base::HistogramTester> histogram_tester_; void SetUp() override { ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); @@ -105,6 +110,8 @@ SetPluginVmDevicePolicies(); SetUserWithAffiliation(); + + histogram_tester_ = std::make_unique<base::HistogramTester>(); } void TearDown() override { @@ -269,6 +276,9 @@ test_browser_thread_bundle_.RunUntilIdle(); EXPECT_FALSE(manager_->IsProcessingImage()); + + histogram_tester_->ExpectUniqueSample(kPluginVmImageDownloadedSize, + kDownloadedPluginVmImageSizeInMb, 1); } TEST_F(PluginVmImageManagerTest, CanProceedWithANewImageWhenSucceededTest) { @@ -289,6 +299,9 @@ // As it is deleted after successful unzipping. fake_downloaded_plugin_vm_image_archive_ = CreateZipFile(); ProcessImageUntilConfigured(); + + histogram_tester_->ExpectUniqueSample(kPluginVmImageDownloadedSize, + kDownloadedPluginVmImageSizeInMb, 2); } TEST_F(PluginVmImageManagerTest, CanProceedWithANewImageWhenFailedTest) { @@ -309,6 +322,9 @@ EXPECT_FALSE(manager_->IsProcessingImage()); ProcessImageUntilConfigured(); + + histogram_tester_->ExpectUniqueSample(kPluginVmImageDownloadedSize, + kDownloadedPluginVmImageSizeInMb, 1); } TEST_F(PluginVmImageManagerTest, CancelledDownloadTest) { @@ -320,6 +336,8 @@ test_browser_thread_bundle_.RunUntilIdle(); // Finishing image processing as it should really happen. manager_->OnDownloadCancelled(); + + histogram_tester_->ExpectTotalCount(kPluginVmImageDownloadedSize, 0); } TEST_F(PluginVmImageManagerTest, UnzipDownloadedImageTest) { @@ -387,6 +405,9 @@ test_browser_thread_bundle_.RunUntilIdle(); EnsurePluginVmImageIsRemoved(); + + histogram_tester_->ExpectUniqueSample(kPluginVmImageDownloadedSize, + kDownloadedPluginVmImageSizeInMb, 1); } TEST_F(PluginVmImageManagerTest, CancelRegistrationTest) { @@ -406,6 +427,9 @@ test_browser_thread_bundle_.RunUntilIdle(); EnsurePluginVmImageIsRemoved(); + + histogram_tester_->ExpectUniqueSample(kPluginVmImageDownloadedSize, + kDownloadedPluginVmImageSizeInMb, 1); } TEST_F(PluginVmImageManagerTest, EmptyPluginVmImageUrlTest) { @@ -414,6 +438,8 @@ EXPECT_CALL(*observer_, OnDownloadFailed()); ProcessImageUntilUnzipping(); + + histogram_tester_->ExpectTotalCount(kPluginVmImageDownloadedSize, 0); } TEST_F(PluginVmImageManagerTest, VerifyDownloadTest) {
diff --git a/chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.cc b/chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.cc new file mode 100644 index 0000000..f31b075 --- /dev/null +++ b/chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.cc
@@ -0,0 +1,17 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.h" + +namespace plugin_vm { + +const char kPluginVmImageDownloadedSize[] = "PluginVm.Image.DownloadedSize"; + +void RecordPluginVmImageDownloadedSize(uint64_t bytes_downloaded) { + uint64_t megabytes_downloaded = bytes_downloaded / (1024 * 1024); + base::UmaHistogramMemoryLargeMB(kPluginVmImageDownloadedSize, + megabytes_downloaded); +} + +} // namespace plugin_vm
diff --git a/chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.h b/chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.h new file mode 100644 index 0000000..4ed9a08 --- /dev/null +++ b/chrome/browser/chromeos/plugin_vm/plugin_vm_metrics_util.h
@@ -0,0 +1,18 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_PLUGIN_VM_PLUGIN_VM_METRICS_UTIL_H_ +#define CHROME_BROWSER_CHROMEOS_PLUGIN_VM_PLUGIN_VM_METRICS_UTIL_H_ + +#include "base/metrics/histogram_functions.h" + +namespace plugin_vm { + +extern const char kPluginVmImageDownloadedSize[]; + +void RecordPluginVmImageDownloadedSize(uint64_t bytes_downloaded); + +} // namespace plugin_vm + +#endif // CHROME_BROWSER_CHROMEOS_PLUGIN_VM_PLUGIN_VM_METRICS_UTIL_H_
diff --git a/chrome/browser/download/download_manager_utils.cc b/chrome/browser/download/download_manager_utils.cc index 45aa59c..9d1b3bf204 100644 --- a/chrome/browser/download/download_manager_utils.cc +++ b/chrome/browser/download/download_manager_utils.cc
@@ -7,9 +7,14 @@ #include "base/bind.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/download/simple_download_manager_coordinator_factory.h" +#include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/transition_manager/full_browser_transition_manager.h" +#include "components/download/public/common/download_features.h" +#include "components/download/public/common/download_url_loader_factory_getter_impl.h" #include "components/download/public/common/in_progress_download_manager.h" +#include "components/download/public/common/simple_download_manager_coordinator.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/download_request_utils.h" #include "content/public/common/service_manager_connection.h" @@ -19,6 +24,17 @@ #endif namespace { +// A map for owning InProgressDownloadManagers before DownloadManagerImpl gets +// created. +using InProgressManagerMap = + std::map<SimpleFactoryKey*, + std::unique_ptr<download::InProgressDownloadManager>>; + +InProgressManagerMap& GetInProgressManagerMap() { + static base::NoDestructor<InProgressManagerMap> map; + return *map; +} + // Ignores origin security check. DownloadManagerImpl will provide its own // implementation when InProgressDownloadManager object is passed to it. bool IgnoreOriginSecurityCheck(const GURL& url) { @@ -41,6 +57,29 @@ return connection->GetConnector(); } +void CreateInProgressDownloadManager(SimpleFactoryKey* key) { + auto& map = GetInProgressManagerMap(); + auto it = map.find(key); + // Create the InProgressDownloadManager if it hasn't been created yet. + if (it == map.end()) { + auto in_progress_manager = + std::make_unique<download::InProgressDownloadManager>( + nullptr, key->IsOffTheRecord() ? base::FilePath() : key->GetPath(), + base::BindRepeating(&IgnoreOriginSecurityCheck), + base::BindRepeating(&content::DownloadRequestUtils::IsURLSafe), + GetServiceConnector()); + download::SimpleDownloadManagerCoordinator* coordinator = + SimpleDownloadManagerCoordinatorFactory::GetForKey(key); + coordinator->SetSimpleDownloadManager(in_progress_manager.get(), false); + scoped_refptr<network::SharedURLLoaderFactory> factory = + SystemNetworkContextManager::GetInstance()->GetSharedURLLoaderFactory(); + in_progress_manager->set_url_loader_factory_getter( + base::MakeRefCounted<download::DownloadURLLoaderFactoryGetterImpl>( + factory->Clone())); + map[key] = std::move(in_progress_manager); + } +} + } // namespace download::InProgressDownloadManager* @@ -54,12 +93,10 @@ if (manager) return manager; #endif - return new download::InProgressDownloadManager( - nullptr, - profile->IsOffTheRecord() ? base::FilePath() : profile->GetPath(), - base::BindRepeating(&IgnoreOriginSecurityCheck), - base::BindRepeating(&content::DownloadRequestUtils::IsURLSafe), - GetServiceConnector()); + SimpleFactoryKey* key = profile->GetProfileKey(); + CreateInProgressDownloadManager(key); + auto& map = GetInProgressManagerMap(); + return map[key].release(); } void DownloadManagerUtils::InitializeSimpleDownloadManager( @@ -70,6 +107,12 @@ return; } #endif - FullBrowserTransitionManager::Get()->RegisterCallbackOnProfileCreation( - key, base::BindOnce(&GetDownloadManagerOnProfileCreation)); + if (base::FeatureList::IsEnabled( + download::features:: + kUseInProgressDownloadManagerForDownloadService)) { + CreateInProgressDownloadManager(key); + } else { + FullBrowserTransitionManager::Get()->RegisterCallbackOnProfileCreation( + key, base::BindOnce(&GetDownloadManagerOnProfileCreation)); + } }
diff --git a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc index 2e601f54..9148d2d 100644 --- a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc +++ b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
@@ -162,7 +162,7 @@ // Invoked by InProcessReceiver for each received audio frame. void OnAudioFrame(std::unique_ptr<media::AudioBus> audio_frame, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) override { DCHECK(cast_env()->CurrentlyOn(media::cast::CastEnvironment::MAIN)); @@ -199,8 +199,8 @@ } } - void OnVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + void OnVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous) override { DCHECK(cast_env()->CurrentlyOn(media::cast::CastEnvironment::MAIN)); @@ -215,7 +215,7 @@ // letterboxed content region of mostly a solid color plus a small piece of // "something" that's animating to keep the tab capture pipeline generating // new frames. - const gfx::Rect region = FindLetterboxedContentRegion(video_frame.get()); + const gfx::Rect region = FindLetterboxedContentRegion(*video_frame); YUVColor current_color; current_color.y = ComputeMedianIntensityInRegionInPlane( region, @@ -256,11 +256,11 @@ // Return the region that excludes the black letterboxing borders surrounding // the content within |frame|, if any. static gfx::Rect FindLetterboxedContentRegion( - const media::VideoFrame* frame) { + const media::VideoFrame& frame) { const int kNonBlackIntensityThreshold = 20; // 16 plus some fuzz. - const int width = frame->row_bytes(media::VideoFrame::kYPlane); - const int height = frame->rows(media::VideoFrame::kYPlane); - const int stride = frame->stride(media::VideoFrame::kYPlane); + const int width = frame.row_bytes(media::VideoFrame::kYPlane); + const int height = frame.rows(media::VideoFrame::kYPlane); + const int stride = frame.stride(media::VideoFrame::kYPlane); gfx::Rect result; @@ -268,7 +268,7 @@ // encountered. for (int y = height - 1; y >= 0; --y) { const uint8_t* const start = - frame->data(media::VideoFrame::kYPlane) + y * stride; + frame.data(media::VideoFrame::kYPlane) + y * stride; const uint8_t* const end = start + width; for (const uint8_t* p = end - 1; p >= start; --p) { if (*p > kNonBlackIntensityThreshold) { @@ -283,7 +283,7 @@ // Scan from the upper-left until the first non-black pixel is encountered. for (int y = 0; y < result.height(); ++y) { const uint8_t* const start = - frame->data(media::VideoFrame::kYPlane) + y * stride; + frame.data(media::VideoFrame::kYPlane) + y * stride; const uint8_t* const end = start + result.width(); for (const uint8_t* p = start; p < end; ++p) { if (*p > kNonBlackIntensityThreshold) {
diff --git a/chrome/browser/extensions/api/cast_streaming/performance_test.cc b/chrome/browser/extensions/api/cast_streaming/performance_test.cc index bda71aa..4e06a05 100644 --- a/chrome/browser/extensions/api/cast_streaming/performance_test.cc +++ b/chrome/browser/extensions/api/cast_streaming/performance_test.cc
@@ -326,7 +326,7 @@ private: // Invoked by InProcessReceiver for each received audio frame. void OnAudioFrame(std::unique_ptr<media::AudioBus> audio_frame, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) override { CHECK(cast_env()->CurrentlyOn(media::cast::CastEnvironment::MAIN)); @@ -350,8 +350,8 @@ } } - void OnVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + void OnVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous) override { CHECK(cast_env()->CurrentlyOn(media::cast::CastEnvironment::MAIN)); @@ -360,7 +360,7 @@ (playout_time - base::TimeTicks()).InMicroseconds()); uint16_t frame_no; - if (media::cast::test::DecodeBarcode(video_frame, &frame_no)) { + if (media::cast::test::DecodeBarcode(*video_frame, &frame_no)) { video_events_.push_back(TimeData(frame_no, playout_time)); } else { DVLOG(2) << "Failed to decode barcode!";
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc index 3596fe5..bca47a1 100644 --- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc +++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc
@@ -9,7 +9,7 @@ #include "base/strings/stringprintf.h" #include "chrome/browser/extensions/extension_api_unittest.h" #include "chrome/browser/extensions/extension_function_test_utils.h" -#include "chrome/browser/policy/browser_dm_token_storage.h" +#include "chrome/browser/policy/fake_browser_dm_token_storage.h" #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" @@ -26,26 +26,6 @@ const char kFakeClientId[] = "fake-client-id"; const char kFakeMachineNameReport[] = "{\"computername\":\"name\"}"; -class FakeBrowserDMTokenStorage : public policy::BrowserDMTokenStorage { - public: - FakeBrowserDMTokenStorage() = default; - ~FakeBrowserDMTokenStorage() override = default; - - void SetClientId(const std::string& client_id) { client_id_ = client_id; } - - // policy::BrowserDMTokenStorage: - std::string InitClientId() override { return client_id_; } - std::string InitEnrollmentToken() override { return std::string(); } - std::string InitDMToken() override { return std::string(); } - bool InitEnrollmentErrorOption() override { return true; } - void SaveDMToken(const std::string& token) override {} - - private: - std::string client_id_; - - DISALLOW_COPY_AND_ASSIGN(FakeBrowserDMTokenStorage); -}; - } // namespace // Test for API enterprise.reportingPrivate.uploadChromeDesktopReport @@ -133,16 +113,14 @@ // Test for API enterprise.reportingPrivate.getDeviceId class EnterpriseReportingPrivateGetDeviceIdTest : public ExtensionApiUnittest { public: - EnterpriseReportingPrivateGetDeviceIdTest() { - policy::BrowserDMTokenStorage::SetForTesting(&storage_); - } + EnterpriseReportingPrivateGetDeviceIdTest() = default; void SetClientId(const std::string& client_id) { storage_.SetClientId(client_id); } private: - FakeBrowserDMTokenStorage storage_; + policy::FakeBrowserDMTokenStorage storage_; DISALLOW_COPY_AND_ASSIGN(EnterpriseReportingPrivateGetDeviceIdTest); };
diff --git a/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc b/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc index 08d2198..62ddd83 100644 --- a/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc +++ b/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc
@@ -1141,6 +1141,57 @@ } IN_PROC_BROWSER_TEST_P(CrossOriginReadBlockingExtensionAllowlistingTest, + OriginHeaderInCrossOriginGetRequest) { + // Load the test extension. + ASSERT_TRUE(InstallExtension()); + + // Navigate to a foo.com page. + GURL page_url = GetTestPageUrl("foo.com"); + ui_test_utils::NavigateToURL(browser(), page_url); + ASSERT_EQ(page_url, + active_web_contents()->GetMainFrame()->GetLastCommittedURL()); + ASSERT_EQ(url::Origin::Create(page_url), + active_web_contents()->GetMainFrame()->GetLastCommittedOrigin()); + + // Inject a content script that performs a cross-origin GET XHR to bar.com. + GURL cross_site_resource( + embedded_test_server()->GetURL("bar.com", "/echoall")); + const char* kScriptTemplate = R"( + fetch($1, {method: 'GET', mode:'cors'}) + .then(response => response.text()) + .then(text => domAutomationController.send(text)) + .catch(err => domAutomationController.send('ERROR: ' + err)); + )"; + content::DOMMessageQueue message_queue; + ExecuteContentScript( + active_web_contents(), + content::JsReplace(kScriptTemplate, cross_site_resource)); + std::string fetch_result = PopString(&message_queue); + + // Verify if the fetch was blocked + what the Origin header was. + if (AreContentScriptFetchesExpectedToBeBlocked()) { + // TODO(lukasza): https://crbug.com/953315: No CORB blocking should occur + // for the CORS-mode request - the test expectations should be the same, + // regardless of AreContentScriptFetchesExpectedToBeBlocked. + EXPECT_EQ("", fetch_result); + } else if (IsExtensionAllowlisted()) { + // Legacy behavior - no Origin: header is present in GET CORS requests from + // content scripts based on the extension permissions. + EXPECT_THAT(fetch_result, ::testing::Not(::testing::HasSubstr("Origin:"))); + } else { + // TODO(lukasza): https://crbug.com/920638: Non-allowlisted extension + // should use the website's origin in the CORS request. + // TODO: EXPECT_THAT(fetch_result, + // ::testing::HasSubstr("Origin: http://foo.com")); + EXPECT_THAT(fetch_result, ::testing::Not(::testing::HasSubstr("Origin:"))); + } + + // Regression test against https://crbug.com/944704. + EXPECT_THAT(fetch_result, + ::testing::Not(::testing::HasSubstr("Origin: chrome-extension"))); +} + +IN_PROC_BROWSER_TEST_P(CrossOriginReadBlockingExtensionAllowlistingTest, OriginHeaderInCrossOriginPostRequest) { // Load the test extension. ASSERT_TRUE(InstallExtension()); @@ -1176,12 +1227,11 @@ EXPECT_EQ("", fetch_result); } else { EXPECT_THAT(fetch_result, ::testing::HasSubstr("Origin: http://foo.com")); - - // Regression test against https://crbug.com/944704. - EXPECT_THAT( - fetch_result, - ::testing::Not(::testing::HasSubstr("Origin: chrome-extension"))); } + + // Regression test against https://crbug.com/944704. + EXPECT_THAT(fetch_result, + ::testing::Not(::testing::HasSubstr("Origin: chrome-extension"))); } IN_PROC_BROWSER_TEST_P(CrossOriginReadBlockingExtensionAllowlistingTest,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index db74e228..f13fa76 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1431,8 +1431,8 @@ }, { "name": "enable-request-tablet-site", - // "owners": [ "your-team" ], - "expiry_milestone": 76 + "owners": [ "xdai" ], + "expiry_milestone": 78 }, { "name": "enable-resampling-input-events", @@ -1553,8 +1553,8 @@ }, { "name": "enable-speculative-service-worker-start-on-query-input", - // "owners": [ "your-team" ], - "expiry_milestone": 76 + "owners": [ "jdonnelly" ], + "expiry_milestone": 78 }, { "name": "enable-suggestions-with-substring-match", @@ -2020,11 +2020,6 @@ "expiry_milestone": -1 }, { - "name": "force-tablet-mode", - // "owners": [ "your-team" ], - "expiry_milestone": 76 - }, - { "name": "force-text-direction", "owners": [ "krb", "pbos", "ellyjones" ], // This flag is used for developers who don't speak an RTL language to QA @@ -2122,7 +2117,7 @@ }, { "name": "in-session-password-change", - // "owners": [ "rsorokin" ], + "owners": [ "rsorokin" ], "expiry_milestone": 77 }, { @@ -2616,11 +2611,6 @@ "expiry_milestone": 77 }, { - "name": "overscroll-start-threshold", - // "owners": [ "your-team" ], - "expiry_milestone": 76 - }, - { "name": "passive-event-listeners-due-to-fling", "owners": [ "sahel", "input-dev" ], "expiry_milestone": 76 @@ -2672,7 +2662,7 @@ }, { "name": "progress-bar-throttle", - // "owners": [ "your-team" ], + "owners": [ "mdjones" ], "expiry_milestone": 76 }, {
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index ecb094b..2f226d4 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1439,13 +1439,6 @@ const char kOverscrollHistoryNavigationDescription[] = "History navigation in response to horizontal overscroll."; -const char kOverscrollStartThresholdName[] = "Overscroll start threshold"; -const char kOverscrollStartThresholdDescription[] = - "Changes overscroll start threshold relative to the default value."; -const char kOverscrollStartThreshold133Percent[] = "133%"; -const char kOverscrollStartThreshold166Percent[] = "166%"; -const char kOverscrollStartThreshold200Percent[] = "200%"; - const char kTouchpadOverscrollHistoryNavigationName[] = "Overscroll history navigation on Touchpad"; const char kTouchpadOverscrollHistoryNavigationDescription[] = @@ -3212,19 +3205,6 @@ "Enables inspection of native UI elements. For local inspection use " "chrome://inspect#other"; -// Force UI Mode -const char kUiModeName[] = "Force Ui Mode"; -const char kUiModeDescription[] = - "This flag can be used to force a certain mode on to a chromebook, " - "despite its current orientation. \"Tablet\" means that the " - "chromebook will act as if it were in tablet mode. \"Clamshell\" " - "means that the chromebook will act as if it were in clamshell " - "mode. \"Auto\" means that the chromebook will alternate between " - "the two, based on its orientation."; -const char kUiModeTablet[] = "Tablet"; -const char kUiModeClamshell[] = "Clamshell"; -const char kUiModeAuto[] = "Auto (default)"; - const char kUiShowCompositedLayerBordersName[] = "Show UI composited layer borders"; const char kUiShowCompositedLayerBordersDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 804028f..2b04c07 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -873,12 +873,6 @@ extern const char kOverscrollHistoryNavigationName[]; extern const char kOverscrollHistoryNavigationDescription[]; -extern const char kOverscrollStartThresholdName[]; -extern const char kOverscrollStartThresholdDescription[]; -extern const char kOverscrollStartThreshold133Percent[]; -extern const char kOverscrollStartThreshold166Percent[]; -extern const char kOverscrollStartThreshold200Percent[]; - extern const char kParallelDownloadingName[]; extern const char kParallelDownloadingDescription[]; @@ -1932,12 +1926,6 @@ extern const char kUiDevToolsName[]; extern const char kUiDevToolsDescription[]; -extern const char kUiModeName[]; -extern const char kUiModeDescription[]; -extern const char kUiModeTablet[]; -extern const char kUiModeClamshell[]; -extern const char kUiModeAuto[]; - extern const char kUiShowCompositedLayerBordersName[]; extern const char kUiShowCompositedLayerBordersDescription[]; extern const char kUiShowCompositedLayerBordersRenderPass[];
diff --git a/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc b/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc index 877925a..fb8d941c 100644 --- a/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc +++ b/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc
@@ -554,6 +554,10 @@ #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) #define MAYBE_FetchAndEmitMetricsWithExtensions \ DISABLED_FetchAndEmitMetricsWithExtensions +#elif defined(OS_LINUX) +// Disabled for crbug.com/964025 +#define MAYBE_FetchAndEmitMetricsWithExtensions \ + DISABLED_FetchAndEmitMetricsWithExtensions #else #define MAYBE_FetchAndEmitMetricsWithExtensions \ FetchAndEmitMetricsWithExtensions
diff --git a/chrome/browser/net/chrome_accept_header_browsertest.cc b/chrome/browser/net/chrome_accept_header_browsertest.cc index a47b892..7ec8186 100644 --- a/chrome/browser/net/chrome_accept_header_browsertest.cc +++ b/chrome/browser/net/chrome_accept_header_browsertest.cc
@@ -7,6 +7,7 @@ #include "base/test/bind_test_util.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "content/public/common/mime_handler_view_mode.h" #include "content/public/test/browser_test_utils.h" #include "net/test/embedded_test_server/http_request.h" @@ -38,7 +39,18 @@ plugin_loop.Run(); favicon_loop.Run(); - ASSERT_EQ("*/*", plugin_accept_header); + if (content::MimeHandlerViewMode::UsesCrossProcessFrame()) { + // With MimeHandlerViewInCrossProcessFrame, embedded PDF will go through the + // navigation code path and behaves similarly to PDF loaded inside <iframe>. + ASSERT_EQ( + "text/html,application/xhtml+xml,application/xml;q=0.9,image/" + "webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3", + plugin_accept_header); + } else { + // This is for a sub-resource request. + ASSERT_EQ("*/*", plugin_accept_header); + } + ASSERT_EQ("image/webp,image/apng,image/*,*/*;q=0.8", favicon_accept_header); // Since the server uses local variables.
diff --git a/chrome/browser/offline_pages/android/offline_test_util_jni.cc b/chrome/browser/offline_pages/android/offline_test_util_jni.cc index 683cf270..1018f65 100644 --- a/chrome/browser/offline_pages/android/offline_test_util_jni.cc +++ b/chrome/browser/offline_pages/android/offline_test_util_jni.cc
@@ -12,11 +12,13 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/json/json_writer.h" +#include "chrome/browser/android/profile_key_util.h" #include "chrome/browser/offline_pages/android/offline_page_bridge.h" #include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h" #include "chrome/browser/offline_pages/request_coordinator_factory.h" #include "chrome/browser/profiles/profile_android.h" +#include "chrome/browser/profiles/profile_key.h" #include "chrome/browser/profiles/profile_manager.h" #include "components/offline_pages/core/background/request_coordinator.h" #include "components/offline_pages/core/offline_page_model.h" @@ -255,15 +257,12 @@ void JNI_OfflineTestUtil_SetPrefetchingEnabledByServer( JNIEnv* env, - const JavaParamRef<jobject>& jprofile, const jboolean enabled) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - if (!profile) - return; + ProfileKey* key = ::android::GetMainProfileKey(); - prefetch_prefs::SetEnabledByServer(profile->GetPrefs(), enabled); + prefetch_prefs::SetEnabledByServer(key->GetPrefs(), enabled); if (!enabled) { - prefetch_prefs::ResetForbiddenStateForTesting(profile->GetPrefs()); + prefetch_prefs::ResetForbiddenStateForTesting(key->GetPrefs()); } }
diff --git a/chrome/browser/offline_pages/android/prefetch_configuration_impl_android.cc b/chrome/browser/offline_pages/android/prefetch_configuration_impl_android.cc index dce24f7..f91ec98 100644 --- a/chrome/browser/offline_pages/android/prefetch_configuration_impl_android.cc +++ b/chrome/browser/offline_pages/android/prefetch_configuration_impl_android.cc
@@ -3,9 +3,12 @@ // found in the LICENSE file. #include "base/android/jni_android.h" +#include "chrome/browser/android/profile_key_util.h" #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" +#include "chrome/browser/profiles/profile_key.h" +#include "chrome/browser/profiles/profile_manager.h" #include "components/offline_pages/core/offline_page_feature.h" #include "components/offline_pages/core/prefetch/prefetch_prefs.h" #include "components/offline_pages/core/prefetch/prefetch_service.h" @@ -19,57 +22,39 @@ namespace offline_pages { namespace android { -JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsPrefetchingEnabled( - JNIEnv* env, - const JavaParamRef<jobject>& jprofile) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - return profile && - static_cast<jboolean>(prefetch_prefs::IsEnabled(profile->GetPrefs())); +JNI_EXPORT jboolean +JNI_PrefetchConfiguration_IsPrefetchingEnabled(JNIEnv* env) { + return static_cast<jboolean>( + prefetch_prefs::IsEnabled(::android::GetMainProfileKey()->GetPrefs())); } -JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsEnabledByServer( - JNIEnv* env, - const JavaParamRef<jobject>& jprofile) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - return profile && static_cast<jboolean>( - prefetch_prefs::IsEnabledByServer(profile->GetPrefs())); +JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsEnabledByServer(JNIEnv* env) { + return static_cast<jboolean>(prefetch_prefs::IsEnabledByServer( + ::android::GetMainProfileKey()->GetPrefs())); } -JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsForbiddenCheckDue( - JNIEnv* env, - const JavaParamRef<jobject>& jprofile) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - return profile && static_cast<jboolean>(prefetch_prefs::IsForbiddenCheckDue( - profile->GetPrefs())); +JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsForbiddenCheckDue(JNIEnv* env) { + return static_cast<jboolean>(prefetch_prefs::IsForbiddenCheckDue( + ::android::GetMainProfileKey()->GetPrefs())); } -JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsEnabledByServerUnknown( - JNIEnv* env, - const JavaParamRef<jobject>& jprofile) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - return profile && - static_cast<jboolean>( - prefetch_prefs::IsEnabledByServerUnknown(profile->GetPrefs())); +JNI_EXPORT jboolean +JNI_PrefetchConfiguration_IsEnabledByServerUnknown(JNIEnv* env) { + return static_cast<jboolean>(prefetch_prefs::IsEnabledByServerUnknown( + ::android::GetMainProfileKey()->GetPrefs())); } JNI_EXPORT void JNI_PrefetchConfiguration_SetPrefetchingEnabledInSettings( JNIEnv* env, - const JavaParamRef<jobject>& jprofile, jboolean enabled) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - if (!profile) - return; - - prefetch_prefs::SetPrefetchingEnabledInSettings(profile->GetPrefs(), enabled); + prefetch_prefs::SetPrefetchingEnabledInSettings( + ::android::GetMainProfileKey()->GetPrefs(), enabled); } -JNI_EXPORT jboolean JNI_PrefetchConfiguration_IsPrefetchingEnabledInSettings( - JNIEnv* env, - const JavaParamRef<jobject>& jprofile) { - Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); - return profile && - static_cast<jboolean>(prefetch_prefs::IsPrefetchingEnabledInSettings( - profile->GetPrefs())); +JNI_EXPORT jboolean +JNI_PrefetchConfiguration_IsPrefetchingEnabledInSettings(JNIEnv* env) { + return static_cast<jboolean>(prefetch_prefs::IsPrefetchingEnabledInSettings( + ::android::GetMainProfileKey()->GetPrefs())); } } // namespace android
diff --git a/chrome/browser/performance_manager/performance_manager_tab_helper.cc b/chrome/browser/performance_manager/performance_manager_tab_helper.cc index fbf3c839e..392b9f3 100644 --- a/chrome/browser/performance_manager/performance_manager_tab_helper.cc +++ b/chrome/browser/performance_manager/performance_manager_tab_helper.cc
@@ -123,6 +123,14 @@ void PerformanceManagerTabHelper::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { auto it = frames_.find(render_frame_host); + if (it == frames_.end()) { + // https://crbug.com/948088. + // At the present time (May 2019), it's possible for speculative render + // frame hosts to exist at the time this TabHelper is attached to a + // WebContents. These speculative render frame hosts are not exposed in + // enumeration, and so may be first observed at deletion time. + return; + } DCHECK(it != frames_.end()); performance_manager_->DeleteNode(std::move(it->second)); @@ -156,9 +164,17 @@ DCHECK(new_host); FrameNodeImpl* new_frame = nullptr; auto it = frames_.find(new_host); - if (it != frames_.end()) + if (it != frames_.end()) { new_frame = it->second.get(); + } else if (new_host->IsRenderFrameCreated()) { + // https://crbug.com/948088. + // In the case of speculative frames already existent and created at attach + // time, fake the creation event at this point. + RenderFrameCreated(new_host); + new_frame = frames_[new_host].get(); + DCHECK_NE(nullptr, new_frame); + } // If neither frame could be looked up there's nothing to do. if (!old_frame && !new_frame) return;
diff --git a/chrome/browser/policy/OWNERS b/chrome/browser/policy/OWNERS index 0f1ebd4..1f757aed 100644 --- a/chrome/browser/policy/OWNERS +++ b/chrome/browser/policy/OWNERS
@@ -6,8 +6,8 @@ poromov@chromium.org rsorokin@chromium.org -per-file browser_dm_token_storage*=rogerta@chromium.org -per-file browser_dm_token_storage*=zmin@chromium.org +per-file *browser_dm_token_storage*=rogerta@chromium.org +per-file *browser_dm_token_storage*=zmin@chromium.org per-file machine_level_user_cloud_policy*=rogerta@chromium.org per-file machine_level_user_cloud_policy*=zmin@chromium.org
diff --git a/chrome/browser/policy/browser_dm_token_storage.h b/chrome/browser/policy/browser_dm_token_storage.h index 78f7d31..1dc213b 100644 --- a/chrome/browser/policy/browser_dm_token_storage.h +++ b/chrome/browser/policy/browser_dm_token_storage.h
@@ -35,21 +35,19 @@ // Returns the global singleton object. Must be called from the UI thread. // This implementation is platform dependant. static BrowserDMTokenStorage* Get(); - // Returns a client ID unique to the machine. Virtual for tests. - virtual std::string RetrieveClientId(); + // Returns a client ID unique to the machine. + std::string RetrieveClientId(); // Returns the serial number of the machine. std::string RetrieveSerialNumber(); - // Returns the enrollment token, or an empty string if there is none. Virtual - // for tests. - virtual std::string RetrieveEnrollmentToken(); + // Returns the enrollment token, or an empty string if there is none. + std::string RetrieveEnrollmentToken(); // Asynchronously stores |dm_token| and calls |callback| with a boolean to // indicate success or failure. It is an error to attempt concurrent store - // operations. Virtual for tests. - virtual void StoreDMToken(const std::string& dm_token, - StoreCallback callback); + // operations. + void StoreDMToken(const std::string& dm_token, StoreCallback callback); // Returns an already stored DM token. An empty token is returned if no DM - // token exists on the system or an error is encountered. Virtual for tests. - virtual std::string RetrieveDMToken(); + // token exists on the system or an error is encountered. + std::string RetrieveDMToken(); // Must be called after the DM token is saved, to ensure that the callback is // invoked. void OnDMTokenStored(bool success);
diff --git a/chrome/browser/policy/browser_dm_token_storage_unittest.cc b/chrome/browser/policy/browser_dm_token_storage_unittest.cc index c020749..fa7dc483 100644 --- a/chrome/browser/policy/browser_dm_token_storage_unittest.cc +++ b/chrome/browser/policy/browser_dm_token_storage_unittest.cc
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" +#include "chrome/browser/policy/fake_browser_dm_token_storage.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -28,86 +29,48 @@ } // namespace -class MockBrowserDMTokenStorage : public BrowserDMTokenStorage { - public: - MockBrowserDMTokenStorage() { - set_test_client_id(kClientId1); - set_test_enrollment_token(kEnrollmentToken1); - set_test_dm_token(kDMToken1); - set_test_error_option(false); - } - - // BrowserDMTokenStorage override - std::string InitClientId() override { return test_client_id_; } - std::string InitEnrollmentToken() override { return test_enrollment_token_; } - std::string InitDMToken() override { return test_dm_token_; } - bool InitEnrollmentErrorOption() override { return test_error_option_; } - - void SaveDMToken(const std::string& dm_token) override { NOTREACHED(); } - - void set_test_client_id(std::string test_client_id) { - test_client_id_ = test_client_id; - } - void set_test_enrollment_token(std::string test_enrollment_token) { - test_enrollment_token_ = test_enrollment_token; - } - void set_test_dm_token(std::string test_dm_token) { - test_dm_token_ = test_dm_token; - } - void set_test_error_option(bool error_option) { - test_error_option_ = error_option; - } - - private: - std::string test_client_id_; - std::string test_serial_number_; - std::string test_enrollment_token_; - std::string test_dm_token_; - bool test_error_option_; -}; - class BrowserDMTokenStorageTest : public testing::Test { + public: + BrowserDMTokenStorageTest() + : storage_(kClientId1, kEnrollmentToken1, kDMToken1, false) {} + FakeBrowserDMTokenStorage storage_; + private: content::TestBrowserThreadBundle thread_bundle_; }; TEST_F(BrowserDMTokenStorageTest, RetrieveClientId) { - MockBrowserDMTokenStorage storage; - EXPECT_EQ(kClientId1, storage.RetrieveClientId()); - + EXPECT_EQ(kClientId1, storage_.RetrieveClientId()); // The client ID value should be cached in memory and not read from the system // again. - storage.set_test_client_id(kClientId2); - EXPECT_EQ(kClientId1, storage.RetrieveClientId()); + storage_.SetClientId(kClientId2); + EXPECT_EQ(kClientId1, storage_.RetrieveClientId()); } TEST_F(BrowserDMTokenStorageTest, RetrieveEnrollmentToken) { - MockBrowserDMTokenStorage storage; - EXPECT_EQ(kEnrollmentToken1, storage.RetrieveEnrollmentToken()); + EXPECT_EQ(kEnrollmentToken1, storage_.RetrieveEnrollmentToken()); // The enrollment token should be cached in memory and not read from the // system again. - storage.set_test_enrollment_token(kEnrollmentToken2); - EXPECT_EQ(kEnrollmentToken1, storage.RetrieveEnrollmentToken()); + storage_.SetEnrollmentToken(kEnrollmentToken2); + EXPECT_EQ(kEnrollmentToken1, storage_.RetrieveEnrollmentToken()); } TEST_F(BrowserDMTokenStorageTest, RetrieveDMToken) { - MockBrowserDMTokenStorage storage; - EXPECT_EQ(kDMToken1, storage.RetrieveDMToken()); + EXPECT_EQ(kDMToken1, storage_.RetrieveDMToken()); // The DM token should be cached in memory and not read from the system again. - storage.set_test_dm_token(kDMToken2); - EXPECT_EQ(kDMToken1, storage.RetrieveDMToken()); + storage_.SetDMToken(kDMToken2); + EXPECT_EQ(kDMToken1, storage_.RetrieveDMToken()); } TEST_F(BrowserDMTokenStorageTest, ShouldDisplayErrorMessageOnFailure) { - MockBrowserDMTokenStorage storage; - EXPECT_FALSE(storage.ShouldDisplayErrorMessageOnFailure()); + EXPECT_FALSE(storage_.ShouldDisplayErrorMessageOnFailure()); // The error option should be cached in memory and not read from the system // again. - storage.set_test_error_option(true); - EXPECT_FALSE(storage.ShouldDisplayErrorMessageOnFailure()); + storage_.SetEnrollmentErrorOption(true); + EXPECT_FALSE(storage_.ShouldDisplayErrorMessageOnFailure()); } } // namespace policy
diff --git a/chrome/browser/policy/cloud/machine_level_user_cloud_policy_browsertest.cc b/chrome/browser/policy/cloud/machine_level_user_cloud_policy_browsertest.cc index b55457be..48995bba 100644 --- a/chrome/browser/policy/cloud/machine_level_user_cloud_policy_browsertest.cc +++ b/chrome/browser/policy/cloud/machine_level_user_cloud_policy_browsertest.cc
@@ -22,8 +22,8 @@ #include "chrome/browser/chrome_browser_main.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" #include "chrome/browser/net/system_network_context_manager.h" -#include "chrome/browser/policy/browser_dm_token_storage.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" +#include "chrome/browser/policy/fake_browser_dm_token_storage.h" #include "chrome/browser/policy/machine_level_user_cloud_policy_controller.h" #include "chrome/browser/policy/test/local_policy_test_server.h" #include "chrome/browser/ui/browser_finder.h" @@ -122,70 +122,6 @@ bool should_display_error_message_ = false; }; -class FakeBrowserDMTokenStorage : public BrowserDMTokenStorage { - public: - FakeBrowserDMTokenStorage() = default; - - std::string RetrieveClientId() override { return client_id_; } - std::string RetrieveEnrollmentToken() override { return enrollment_token_; } - void StoreDMToken(const std::string& dm_token, - StoreCallback callback) override { - // Store the dm token in memory even if storage gonna failed. This is the - // same behavior of production code. - dm_token_ = dm_token; - // Run the callback synchronously to make sure the metrics is recorded - // before verfication. - std::move(callback).Run(storage_enabled_); - } - std::string RetrieveDMToken() override { return dm_token_; } - bool ShouldDisplayErrorMessageOnFailure() override { - return should_display_error_message_on_failure_; - } - - void SetEnrollmentToken(const std::string& enrollment_token) { - enrollment_token_ = enrollment_token; - } - void SetErrorMessageOption(bool should_displayed) { - should_display_error_message_on_failure_ = should_displayed; - } - - void SetClientId(std::string client_id) { client_id_ = client_id; } - - void SetDMToken(std::string dm_token) { dm_token_ = dm_token; } - - std::string InitClientId() override { - NOTREACHED(); - return std::string(); - } - std::string InitEnrollmentToken() override { - NOTREACHED(); - return std::string(); - } - std::string InitDMToken() override { - NOTREACHED(); - return std::string(); - } - bool InitEnrollmentErrorOption() override { - NOTREACHED(); - return true; - } - - void SaveDMToken(const std::string& dm_token) override { NOTREACHED(); } - - void EnableStorage(bool storage_enabled) { - storage_enabled_ = storage_enabled; - } - - private: - std::string enrollment_token_; - std::string client_id_; - std::string dm_token_; - bool storage_enabled_ = true; - bool should_display_error_message_on_failure_ = true; - - DISALLOW_COPY_AND_ASSIGN(FakeBrowserDMTokenStorage); -}; - class ChromeBrowserExtraSetUp : public ChromeBrowserMainExtraParts { public: explicit ChromeBrowserExtraSetUp( @@ -473,7 +409,7 @@ : kInvalidEnrollmentToken); storage_.SetClientId("client_id"); storage_.EnableStorage(storage_enabled()); - storage_.SetErrorMessageOption(should_display_error_message()); + storage_.SetEnrollmentErrorOption(should_display_error_message()); observer_.SetShouldSucceed(is_enrollment_token_valid()); observer_.SetShouldDisplayErrorMessage(should_display_error_message());
diff --git a/chrome/browser/policy/fake_browser_dm_token_storage.cc b/chrome/browser/policy/fake_browser_dm_token_storage.cc new file mode 100644 index 0000000..177b7f99 --- /dev/null +++ b/chrome/browser/policy/fake_browser_dm_token_storage.cc
@@ -0,0 +1,66 @@ +// Copyright 2019 The Chromium 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/policy/fake_browser_dm_token_storage.h" + +namespace policy { + +FakeBrowserDMTokenStorage::FakeBrowserDMTokenStorage() { + BrowserDMTokenStorage::SetForTesting(this); +} + +FakeBrowserDMTokenStorage::FakeBrowserDMTokenStorage( + const std::string& client_id, + const std::string& enrollment_token, + const std::string& dm_token, + bool enrollment_error_option) + : client_id_(client_id), + enrollment_token_(enrollment_token), + dm_token_(dm_token), + enrollment_error_option_(enrollment_error_option) {} + +FakeBrowserDMTokenStorage::~FakeBrowserDMTokenStorage() = default; + +void FakeBrowserDMTokenStorage::SetClientId(const std::string& client_id) { + client_id_ = client_id; +} + +void FakeBrowserDMTokenStorage::SetEnrollmentToken( + const std::string& enrollment_token) { + enrollment_token_ = enrollment_token; +} + +void FakeBrowserDMTokenStorage::SetDMToken(const std::string& dm_token) { + dm_token_ = dm_token; +} + +void FakeBrowserDMTokenStorage::SetEnrollmentErrorOption(bool option) { + enrollment_error_option_ = option; +} + +void FakeBrowserDMTokenStorage::EnableStorage(bool storage_enabled) { + storage_enabled_ = storage_enabled; +} + +std::string FakeBrowserDMTokenStorage::InitClientId() { + return client_id_; +} + +std::string FakeBrowserDMTokenStorage::InitEnrollmentToken() { + return enrollment_token_; +} + +std::string FakeBrowserDMTokenStorage::InitDMToken() { + return dm_token_; +} + +bool FakeBrowserDMTokenStorage::InitEnrollmentErrorOption() { + return enrollment_error_option_; +} + +void FakeBrowserDMTokenStorage::SaveDMToken(const std::string& token) { + OnDMTokenStored(storage_enabled_); +} + +} // namespace policy
diff --git a/chrome/browser/policy/fake_browser_dm_token_storage.h b/chrome/browser/policy/fake_browser_dm_token_storage.h new file mode 100644 index 0000000..9bf3815 --- /dev/null +++ b/chrome/browser/policy/fake_browser_dm_token_storage.h
@@ -0,0 +1,51 @@ +// Copyright 2019 The Chromium 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_POLICY_FAKE_BROWSER_DM_TOKEN_STORAGE_H_ +#define CHROME_BROWSER_POLICY_FAKE_BROWSER_DM_TOKEN_STORAGE_H_ + +#include "chrome/browser/policy/browser_dm_token_storage.h" + +namespace policy { + +// A fake BrowserDMTokenStorage implementation for testing. Test +// cases can set CBCM related values instead of reading it +// from operating system. +class FakeBrowserDMTokenStorage : public BrowserDMTokenStorage { + public: + FakeBrowserDMTokenStorage(); + FakeBrowserDMTokenStorage(const std::string& client_id, + const std::string& enrollment_token, + const std::string& dm_token, + bool enrollment_error_option); + ~FakeBrowserDMTokenStorage() override; + + void SetClientId(const std::string& client_id); + void SetEnrollmentToken(const std::string& enrollment_token); + void SetDMToken(const std::string& dm_token); + void SetEnrollmentErrorOption(bool option); + // Determines if SaveDMToken will be succeeded or not. + void EnableStorage(bool storage_enabled); + + // policy::BrowserDMTokenStorage: + std::string InitClientId() override; + std::string InitEnrollmentToken() override; + std::string InitDMToken() override; + bool InitEnrollmentErrorOption() override; + void SaveDMToken(const std::string& token) override; + + private: + std::string client_id_ = ""; + std::string enrollment_token_ = ""; + std::string dm_token_ = ""; + bool enrollment_error_option_ = true; + + bool storage_enabled_ = true; + + DISALLOW_COPY_AND_ASSIGN(FakeBrowserDMTokenStorage); +}; + +} // namespace policy + +#endif // CHROME_BROWSER_POLICY_FAKE_BROWSER_DM_TOKEN_STORAGE_H_
diff --git a/chrome/browser/policy/machine_level_user_cloud_policy_register_watcher_unittest.cc b/chrome/browser/policy/machine_level_user_cloud_policy_register_watcher_unittest.cc index 5233452..89dc55bb 100644 --- a/chrome/browser/policy/machine_level_user_cloud_policy_register_watcher_unittest.cc +++ b/chrome/browser/policy/machine_level_user_cloud_policy_register_watcher_unittest.cc
@@ -11,7 +11,7 @@ #include "base/strings/string16.h" #include "base/test/metrics/histogram_tester.h" #include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/policy/browser_dm_token_storage.h" +#include "chrome/browser/policy/fake_browser_dm_token_storage.h" #include "chrome/browser/ui/enterprise_startup_dialog.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gmock/include/gmock/gmock.h" @@ -31,53 +31,6 @@ constexpr char kDMToken[] = "dm-token"; constexpr char kClientId[] = "client-id"; -// A fake token storage class for tested code to get enrollment token and DM -// token. -class FakeDMTokenStorage : public BrowserDMTokenStorage { - public: - FakeDMTokenStorage() = default; - std::string RetrieveDMToken() override { return dm_token_; } - std::string RetrieveEnrollmentToken() override { return enrollment_token_; } - std::string RetrieveClientId() override { return kClientId; } - bool ShouldDisplayErrorMessageOnFailure() override { - return should_display_error_message_on_failure_; - } - - std::string InitClientId() override { - NOTREACHED(); - return std::string(); - } - std::string InitEnrollmentToken() override { - NOTREACHED(); - return std::string(); - } - std::string InitDMToken() override { - NOTREACHED(); - return std::string(); - } - bool InitEnrollmentErrorOption() override { - NOTREACHED(); - return true; - } - - void SaveDMToken(const std::string& dm_token) override { NOTREACHED(); } - - void set_dm_token(const std::string& dm_token) { dm_token_ = dm_token; } - void set_enrollment_token(const std::string& enrollment_token) { - enrollment_token_ = enrollment_token; - } - void set_should_display_error_message_on_failure(bool should_display) { - should_display_error_message_on_failure_ = should_display; - } - - private: - std::string enrollment_token_; - std::string dm_token_; - bool should_display_error_message_on_failure_ = true; - - DISALLOW_COPY_AND_ASSIGN(FakeDMTokenStorage); -}; - // A fake MachineLevelUserCloudPolicyController that notifies all observers the // machine level user cloud policy enrollment process has been finished. class FakeMachineLevelUserCloudPolicyController @@ -136,9 +89,9 @@ : watcher_(&controller_), dialog_(std::make_unique<MockEnterpriseStartupDialog>()), dialog_ptr_(dialog_.get()) { - BrowserDMTokenStorage::SetForTesting(&storage_); - storage_.set_enrollment_token(kEnrollmentToken); - storage_.set_dm_token(std::string()); + storage_.SetEnrollmentToken(kEnrollmentToken); + storage_.SetDMToken(std::string()); + storage_.SetClientId(kClientId); watcher_.SetDialogCreationCallbackForTesting( base::BindOnce(&MachineLevelUserCloudPolicyRegisterWatcherTest:: CreateEnterpriseStartupDialog, @@ -146,7 +99,7 @@ } protected: - FakeDMTokenStorage* storage() { return &storage_; } + FakeBrowserDMTokenStorage* storage() { return &storage_; } FakeMachineLevelUserCloudPolicyController* controller() { return &controller_; } @@ -164,7 +117,7 @@ FakeMachineLevelUserCloudPolicyController controller_; MachineLevelUserCloudPolicyRegisterWatcher watcher_; - FakeDMTokenStorage storage_; + FakeBrowserDMTokenStorage storage_; std::unique_ptr<MockEnterpriseStartupDialog> dialog_; MockEnterpriseStartupDialog* dialog_ptr_; @@ -173,15 +126,15 @@ TEST_F(MachineLevelUserCloudPolicyRegisterWatcherTest, NoEnrollmentNeededWithDMToken) { - storage()->set_dm_token(kDMToken); + storage()->SetDMToken(kDMToken); EXPECT_EQ(RegisterResult::kEnrollmentSuccessBeforeDialogDisplayed, watcher()->WaitUntilCloudPolicyEnrollmentFinished()); } TEST_F(MachineLevelUserCloudPolicyRegisterWatcherTest, NoEnrollmentNeededWithoutEnrollmentToken) { - storage()->set_enrollment_token(std::string()); - storage()->set_dm_token(std::string()); + storage()->SetEnrollmentToken(std::string()); + storage()->SetDMToken(std::string()); EXPECT_EQ(RegisterResult::kNoEnrollmentNeeded, watcher()->WaitUntilCloudPolicyEnrollmentFinished()); } @@ -216,7 +169,7 @@ EXPECT_CALL(*dialog(), DisplayLaunchingInformationWithThrobber(_)); EXPECT_CALL(*dialog(), IsShowing()).WillOnce(Return(true)); - storage()->set_should_display_error_message_on_failure(false); + storage()->SetEnrollmentErrorOption(false); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce( @@ -320,7 +273,7 @@ base::HistogramTester histogram_tester; EXPECT_CALL(*dialog(), DisplayLaunchingInformationWithThrobber(_)); - storage()->set_should_display_error_message_on_failure(false); + storage()->SetEnrollmentErrorOption(false); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, @@ -368,7 +321,7 @@ EXPECT_CALL(*dialog(), DisplayLaunchingInformationWithThrobber(_)); EXPECT_CALL(*dialog(), IsShowing()).WillOnce(Return(true)); - storage()->set_should_display_error_message_on_failure(false); + storage()->SetEnrollmentErrorOption(false); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce( @@ -392,7 +345,7 @@ EnrollmentFailedBeforeDialogDisplayWithoutErrorMessage) { base::HistogramTester histogram_tester; - storage()->set_should_display_error_message_on_failure(false); + storage()->SetEnrollmentErrorOption(false); controller()->FireNotification(false); EXPECT_EQ(RegisterResult::kEnrollmentFailedSilentlyBeforeDialogDisplayed, watcher()->WaitUntilCloudPolicyEnrollmentFinished());
diff --git a/chrome/browser/policy/policy_conversions.cc b/chrome/browser/policy/policy_conversions.cc index eb6e8680..560bcd6 100644 --- a/chrome/browser/policy/policy_conversions.cc +++ b/chrome/browser/policy/policy_conversions.cc
@@ -151,15 +151,30 @@ error = l10n_util::GetStringUTF16(IDS_POLICY_UNKNOWN); } else { // The PolicyMap contains errors about retrieving the policy, while the - // PolicyErrorMap contains validation errors. Give priority to PolicyMap. - error = policy.GetLocalizedErrors( + // PolicyErrorMap contains validation errors. Concat the errors. + auto policy_map_errors = policy.GetLocalizedErrors( base::BindRepeating(&l10n_util::GetStringUTF16)); - if (error.empty()) - error = errors->GetErrors(policy_name); + auto error_map_errors = errors->GetErrors(policy_name); + if (policy_map_errors.empty()) + error = error_map_errors; + else if (error_map_errors.empty()) + error = policy_map_errors; + else + error = + base::JoinString({policy_map_errors, errors->GetErrors(policy_name)}, + base::ASCIIToUTF16("\n")); } if (!error.empty()) value.SetKey("error", Value(error)); + base::string16 warning = policy.GetLocalizedWarnings( + base::BindRepeating(&l10n_util::GetStringUTF16)); + if (!warning.empty()) + value.SetKey("warning", Value(warning)); + + if (policy.IsBlockedOrIgnored()) + value.SetBoolKey("ignored", true); + if (!policy.conflicts.empty()) { Value conflict_values(Value::Type::LIST); for (const auto& conflict : policy.conflicts) {
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc index 1a54f226..9e365b7 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -305,7 +305,7 @@ {42, -1, IDC_CONTENT_CONTEXT_DELETE}, {43, -1, IDC_CONTENT_CONTEXT_SELECTALL}, {44, 17, IDC_CONTENT_CONTEXT_SEARCHWEBFOR}, - {45, -1, IDC_CONTENT_CONTEXT_GOTOURL}, + {45, 40, IDC_CONTENT_CONTEXT_GOTOURL}, {46, -1, IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS}, {47, -1, IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS}, {52, -1, IDC_CONTENT_CONTEXT_OPENLINKWITH},
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js index b6df77a..11ac6f1 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js
@@ -15,10 +15,13 @@ /** * Starts the assistant opt-in flow. - * @param {number} type The type of the flow. */ - show: function(type) { - $('assistant-optin-flow-card').onShow(type); + show: function() { + var url = new URL(document.URL); + $('assistant-optin-flow-card') + .onShow( + url.searchParams.get('flow-type'), + url.searchParams.get('caption-bar-height')); }, /** @@ -60,6 +63,5 @@ }); document.addEventListener('DOMContentLoaded', function() { - var url = new URL(document.URL); - login.AssistantOptInFlowScreen.show(url.searchParams.get('flow-type')); + login.AssistantOptInFlowScreen.show(); });
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js index f15f940..236f3ed 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js
@@ -36,9 +36,14 @@ /** * Signal from host to show the screen. - * @param {?number} type The type of the flow. + * @param {?string} type The type of the flow. + * @param {?string} captionBarHeight The height of the caption bar. */ - onShow: function(type) { + onShow: function(type, captionBarHeight) { + captionBarHeight = captionBarHeight ? captionBarHeight + 'px' : '0px'; + this.style.setProperty('--caption-bar-height', captionBarHeight); + + type = type ? type : this.FlowType.CONSENT_FLOW.toString(); var flowType = Number(type); switch (flowType) { case this.FlowType.CONSENT_FLOW:
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css index b51c2047..2db47db 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css
@@ -8,10 +8,14 @@ text-decoration: none; } +oobe-dialog { + height: calc(640px - var(--caption-bar-height)); +} + .container { height: 496px; overflow: hidden; - padding: 60px 64px 0 64px; + padding: calc(60px - var(--caption-bar-height)) 64px 0 64px; position: absolute; width: 640px; }
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui.js b/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui.js index 2c2ea1a6..9d2027e 100644 --- a/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui.js +++ b/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui.js
@@ -48,9 +48,14 @@ element.appendChild(container); this.root_ = container; + var title = document.createElement('h2'); + title.textContent = Msgs.getMsg('options_bluetooth_braille_display_title'); + container.appendChild(title); + var controls = document.createElement('div'); container.appendChild(controls); this.controls_ = controls; + controls.className = 'option'; var selectLabel = document.createElement('span'); controls.appendChild(selectLabel);
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui_test.unitjs b/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui_test.unitjs index 197f8ee..4ca4a75e 100644 --- a/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui_test.unitjs +++ b/chrome/browser/resources/chromeos/chromevox/braille/bluetooth_braille_display_ui_test.unitjs
@@ -66,7 +66,8 @@ buildUIExpectation: function(controls) { return ` <div> - <div> + <h2>Bluetooth Braille Display</h2> + <div class="option"> <span id="bluetoothBrailleSelectLabel">${this.selectLabel}</span> ${controls} </div> @@ -81,7 +82,7 @@ var ui = new BluetoothBrailleDisplayUI(); ui.attach(document.body); assertEqualsDOM(this.buildUIExpectation(` - <select aria-labelledby="bluetoothBrailleSelectLabel"></select> + <select aria-labelledby="bluetoothBrailleSelectLabel"></select> <button id="connectOrDisconnect" disabled="">Connect</button> <button id="forget" disabled="">Forget</button>`), document.body.children[0]); @@ -95,8 +96,8 @@ ui.attach(document.body); var displays = []; - - // Fake out getDevice using |display| as the backing source which changes below. + +// Fake out getDevice using |display| as the backing source which changes below. chrome.bluetooth.getDevice = (address, callback) => { var display = displays.find((display) => display.address == address ); assertNotNullNorUndefined(display); @@ -153,7 +154,7 @@ displays = [ {name: 'Focus 40 BT', address: 'abcd1234', paired: true}, {name: 'Focus 40 BT rev 2', address: '4321dcba'} - ]; +]; ui.onDisplayListChanged(displays); assertEqualsDOM(this.buildUIExpectation(` <select aria-labelledby="bluetoothBrailleSelectLabel"> @@ -217,7 +218,19 @@ // Trigger pincode screen. ui.onPincodeRequested(); assertEqualsDOM(` - <div><form><label id="pincodeLabel">Please enter a pin</label><input id="pincode" type="text" aria-labelledby="pincodeLabel"></form><div hidden=""><span id="bluetoothBrailleSelectLabel">Select a bluetooth braille display</span><select aria-labelledby="bluetoothBrailleSelectLabel"></select><button id="connectOrDisconnect" disabled="">Connect</button><button id="forget" disabled="">Forget</button></div></div>`, + <div> + <h2>Bluetooth Braille Display</h2> + <form> + <label id="pincodeLabel">Please enter a pin</label> + <input id="pincode" type="text" aria-labelledby="pincodeLabel"> + </form> + <div class="option" hidden=""> + <span id="bluetoothBrailleSelectLabel">${this.selectLabel}</span> + <select aria-labelledby="bluetoothBrailleSelectLabel"></select> + <button id="connectOrDisconnect" disabled="">Connect</button> + <button id="forget" disabled="">Forget</button> + </div> + </div>`, document.body.children[0]); ui.detach(); });
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.css b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.css index 677a061..229a237 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.css +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.css
@@ -65,52 +65,22 @@ width: 40px; } -.option .settings-description { - display: block; - height: 15px; -} - -.option .settings-sub-description { - color: #757575; - display: block; -} - -.option .settings-expand-row { - display: block; - height: 60px; - padding-start: 50px; -} - -.option .braille-description-selection { - display: inline-block; - margin: 0; -} - .option .developerLog { height: 60px; padding-inline-end: 0; width: 666px; } -.option .left { - float: left; - height: 60px; - line-height: 15px; -} - -.option .right { - float: right; - height: 60px; +.option .sub-description { + color: rgb(95, 99, 104); + display: block; } .option .developer-option-icon-button { + background-color: #fff; float: right; - margin-top: 10px; -} - -.option .change-display-style { - margin: 0; - padding: 0; + height: 60px; + vertical-align: middle; } .option input[type='checkbox']:checked { @@ -157,3 +127,4 @@ vertical-align: middle; width: 646px; } +
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.html b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.html index 026e0c36..2dd545c1 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.html +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.html
@@ -12,10 +12,9 @@ <script type="text/javascript" src="options_loader.js"></script> <script type="text/javascript" src="../../chromeVoxChromeOptionsScript.js"> </script> -<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html"> -<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html"> -<link rel="import" href="chrome://resources/cr_elements/icons.html"> -<link rel="import" href="chrome://resources/html/polymer.html"> + <link rel="import" href="chrome://resources/cr_elements/icons.html"> + <link rel="import" href="chrome://resources/html/polymer.html"> + <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> </head> <body> @@ -61,20 +60,19 @@ </div> <h2 class="i18n description" msgid="options_audio_description" - id="audio-description"> + id="audioDescription"> When playing audio </h2> <div class="option"> - <select id="audio-strategy" class="pref" - aria-labelledby="audio-description"> - <option id="audio-normal" class="i18n" msgid="options_audio_normal"> + <select id="audioStrategy" class="pref" aria-labelledby="audioDescription"> + <option id="audioNormal" class="i18n" msgid="options_audio_normal"> play at normal volume even if ChromeVox is speaking </option> - <option id="audio-duck" class="i18n" msgid="options_audio_duck"> + <option id="audioDuck" class="i18n" msgid="options_audio_duck"> play at lower volume when ChromeVox is speaking </option> - <option id="audio-suspend" class="i18n" msgid="options_audio_suspend"> + <option id="audioSuspend" class="i18n" msgid="options_audio_suspend"> pause playback when ChromeVox is speaking </option> </select> @@ -109,201 +107,131 @@ </div> <h2 class="chromeos i18n" msgid="options_braille">Braille</h2> - <!-- Braille Settings --> <div class="chromeos option"> - <label> - <cr-icon-button iron-icon="cr:expand-more" - class="developer-option-icon-button" id="braille-settings-more" - name="chromevox-braille-settings"></cr-icon-button> - <cr-icon-button iron-icon="cr:expand-less" - class="developer-option-icon-button" id="braille-settings-less" - name="chromevox-developer-options" hidden></cr-icon-button> - <span class="i18n" msgid="options_braille_settings"> - Braille Settings - </span> - </label> - <div class="settings-expand-row" id="6-dot-braille" hidden> - <label> - <cr-radio-button class="left" id="braille-description-6"> - 6-dot braille table - </cr-radio-button> - <select class="braille-description-selection right" id="braille-table-6" - aria-labelledby="braille-description-6"></select> - </label> - </div> - - <div class="settings-expand-row" id="8-dot-braille" hidden> - <label> - <cr-radio-button class="left" id="braille-description-8"> - 8-dot braille table - </cr-radio-button> - <select class="braille-description-selection right" - id="braille-table-8" aria-labelledby="braille-description-8"> - </select> - </label> - </div> - <div class="settings-expand-row" id="braille-word-wrap" hidden> - <label> - <input id="braille-word-wrap" type="checkbox" class="checkbox pref" - name="braille-word-wrap"> - <span class="i18n" msgid="options_braille_word_wrap"> - Enable word wrap - </span> - </label> - </div> + <span class="i18n description" msgid="options_braille_description_6" + id="braille_description_6"> + Select a 6-dot braille table: + </span> + <select id="brailleTable6" aria-labelledby="braille_description_6"></select> </div> - - <!-- Bluetooth braille display --> <div class="chromeos option"> - <label> - <cr-icon-button iron-icon="cr:expand-more" - class="developer-option-icon-button" id="bt-braille-settings-more" - name="chromevox-braille-settings"></cr-icon-button> - <cr-icon-button iron-icon="cr:expand-less" - class="developer-option-icon-button" id="bt-braille-settings-less" - name="chromevox-developer-options" hidden></cr-icon-button> - <span class="i18n" msgid="options_bluetooth_braille_display_title"> - Bluetooth braille display - </span> - </label> - <div id="bluetooth-braille" hidden> - </div> + <span class="i18n description" msgid="options_braille_description_8" + id="braille_description_8"> + Select an 8-dot braille table: + </span> + <select id="brailleTable8" aria-labelledby="braille_description_8"></select> </div> - - <!-- Virtual braille display --> + <div class="chromeos option"> + <button id="brailleTableType"></button><span> </span> + </div> <div class="chromeos option"> <label> - <cr-icon-button iron-icon="cr:expand-more" - class="developer-option-icon-button" - id="virtual-braille-settings-more" name="chromevox-braille-settings"> - </cr-icon-button> - <cr-icon-button iron-icon="cr:expand-less" - class="developer-option-icon-button" - id="virtual-braille-settings-less" name="chromevox-developer-options" - hidden></cr-icon-button> - <span class="i18n settings-description" - msgid="options_virtual_braille_display"> - Virtual braille display - </span> - <span class="i18n settings-sub-description" - msgid="options_virtual_braille_display_details"> - Simulates the output of a refreshable braille display - in the ChromeVox panel at the top of the screen. + <input id="brailleWordWrap" type="checkbox" class="checkbox pref" + name="brailleWordWrap"> + <span class="i18n" msgid="options_braille_word_wrap"> + Enable word wrap </span> </label> - <div class="settings-expand-row" - id="virtual-braille-settings-num-lines" hidden> - <span class="i18n description left" - msgid="options_virtual_braille_display_rows" - id="virtual-braille-display-rows-description"> - Lines: - </span> - <input type="number" min="1" class="right" - id="virtual-braille-display-rows-input"> - </div> - <div class="settings-expand-row" - id="virtual-braille-settings-lines-cells" hidden> - <label> - <span class="i18n description left" - msgid="options_virtual_braille_display_columns" - id="virtual-braille-display-columns-description"> - Cells in each line: - </span> - <input type="number" min="1" class="right" - id="virtual-braille-display-columns-input"> - </label> - </div> - <div class="settings-expand-row" - id="virtual-braille-settings-display" hidden> - <label> - <span class="i18n description left" msgid="options_display_style"> - Display Style</span> - <select id="change-display-style" - class="pref right change-display-style" - aria-labelledby="audio-description"> - <option class="i18n" msgid="options_display_style_interleave"> - Interleave - </option> - <option class="i18n" msgid="options_display_style_side_by_side"> - Side-by-side - </option> - </select> - </label> - </div> </div> <div id="bluetoothBraille"></div> + <h2 class="i18n" msgid="options_virtual_braille_display"> + Virtual Braille Display + </h2> + <p class="i18n" msgid="options_virtual_braille_display_details"> + Simulates the output of a refreshable braille display + in the ChromeVox panel at the top of the screen. + </p> + <div class="option"> + <label> + <span class="i18n description" msgid="options_virtual_braille_display_rows" + id="virtual_braille_display_rows_description"> + Lines: + </span> + <input type="number" min="1" id="virtual_braille_display_rows_input"> + </label> + </div> + <div class="option"> + <label> + <span class="i18n description" + msgid="options_virtual_braille_display_columns" + id="virtual_braille_display_columns_description"> + Cells in each line: + </span> + <input type="number" min="1" id="virtual_braille_display_columns_input"> + </label> + </div> + <div class="option"> + <span id="currentDisplayStyle"></span> + <button id="changeDisplayStyle"></button> + </div> + <h2 class="i18n" msgid="options_developer_options" id="developerDescription"> Developer Options </h2> - <div class="chromeos option"> + <div class="chromeos option" id="developerLog"> <label> - <cr-icon-button iron-icon="cr:expand-more" - aria-describedby="developer-options-label" aria-expanded="false" - class="developer-option-icon-button" - id="chromevox-developer-options-more" - name="chromevox-developer-options"></cr-icon-button> - <cr-icon-button iron-icon="cr:expand-less" - aria-describedby="developer-options-label" aria-expanded="true" - class="developer-option-icon-button" - id="chromevox-developer-options-less" - name="chromevox-developer-options" hidden></cr-icon-button> + <paper-icon-button icon="cr:expand-more" + aria-describedby="developer-options-label" aria-expanded="false" + class="developer-option-icon-button" id="chromeVoxDeveloperOptionsMore" + name="chromeVoxDeveloperOptions"></paper-icon-button> + <paper-icon-button icon="cr:expand-less" + aria-describedby="developer-options-label" aria-expanded="true" + class="developer-option-icon-button" id="chromeVoxDeveloperOptionsLess" + name="chromeVoxDeveloperOptions" hidden></paper-icon-button> <span class="i18n" msgid="options_developer_options" id="developer-options-label"> Enable developer options </span> </label> - <div class="settings-expand-row" id="developer-speech-logging"> - <label> - <input id="enable-speech-logging" type="checkbox" - class="checkbox pref logging" name="enableSpeechLogging"> - <span class="i18n" msgid="options_developer_speech_logging"> - Enable speech logging - </span> - </label> - </div> - <div class="settings-expand-row" id="developer-earcon-logging"> - <label> - <input id="enable-earcon-logging" type="checkbox" - class="checkbox pref logging" name="enableEarcon-logging"> - <span class="i18n" msgid="options_developer_earcon_logging"> - Enable earcon logging - </span> - </label> - </div> - <div class="settings-expand-row" id="developer-braille-logging"> - <label> - <input id="enable-braille-logging" type="checkbox" - class="checkbox pref logging" name="enable-braillelogging"> - <span class="i18n" msgid="options_developer_braille_logging"> - Enable braille logging - </span> - </label> - </div> - <div class="settings-expand-row" id="developer-event-stream"> - <label> - <span class="i18n" msgid="options_event_stream_logging"> - Enable event stream logging - </span> - </label> - <button id="toggle-event-stream-filters"></button> - </div> - <div class="settings-expand-row" id="show-developer-log"> - <label> - <cr-icon-button iron-icon="cr:open-in-new" - aria-describedby="show-log-label" class="developer-option-icon-button" - id="open-developer-log"></cr-icon-button> - <span class="i18n settings-description" msgid="options_show_log" - id="show-log-label"> - Show Log</span> - <span class="i18n settings-sub-description" - msgid="options_show_log_key">Search + O + W</span> - </label> - </div> + </div> + <div class="option" id="developerSpeechLogging"> + <label> + <input id="enableSpeechLogging" type="checkbox" + class="checkbox pref logging" name="enableSpeechLogging"> + <span class="i18n" msgid="options_developer_speech_logging"> + Enable speech logging + </span> + </label> + </div> + <div class="option" id="developerEarconLogging"> + <label> + <input id="enableEarconLogging" type="checkbox" + class="checkbox pref logging" name="enableEarconLogging"> + <span class="i18n" msgid="options_developer_earcon_logging"> + Enable earcon logging + </span> + </label> + </div> + <div class="option" id="developerBrailleLogging"> + <label> + <input id="enableBrailleLogging" type="checkbox" + class="checkbox pref logging" name="enableBrailleLogging"> + <span class="i18n" msgid="options_developer_braille_logging"> + Enable braille logging + </span> + </label> + </div> + <div class="option" id="developerEventStream"> + <label> + <span class="i18n" msgid="options_event_stream_logging"> + Enable event stream logging + </span> + </label> + <button id="toggleEventStreamFilters"></button> + </div> + <div class="option" id="showDeveloperLog"> + <label> + <paper-icon-button aria-describedby="show-log-label" icon="cr:open-in-new" + class="developer-option-icon-button" id="openDeveloperLog"> + </paper-icon-button> + <span id="show-log-label" class="i18n" msgid="options_show_log"></span> + <span class="i18n sub-description" msgid="options_show_log_key"></span> + </label> </div> - <div id="event-stream-filters" hidden> + <div id="eventStreamFilters" hidden> <label><div class="option-eventstream"> <input name="activedescendantchanged" type="checkbox" class="checkbox pref eventstream">
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js index 5dfc0e4..a9544535 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
@@ -44,15 +44,6 @@ cvox.OptionsPage.consoleTts; /** - * Display style options for virtual braille display. - * @enum {number} - */ -cvox.OptionsPage.DisplayStyle = { - INTERLEAVE: 0, - SIDE_BY_SIDE: 1 -}; - -/** * Initialize the options page by setting the current value of all prefs, and * adding event listeners. * @suppress {missingProperties} Property prefs never defined on Window @@ -66,13 +57,14 @@ cvox.BrailleTable.getAll(function(tables) { /** @type {!Array<cvox.BrailleTable.Table>} */ cvox.OptionsPage.brailleTables = tables; + cvox.OptionsPage.populateBrailleTablesSelect(); }); chrome.storage.local.get({'brailleWordWrap': true}, function(items) { - $('braille-word-wrap').checked = items.brailleWordWrap; + $('brailleWordWrap').checked = items.brailleWordWrap; }); chrome.storage.local.get({'virtualBrailleRows': 1}, function(items) { - $('virtual-braille-display-rows-input').value = items['virtualBrailleRows']; + $('virtual_braille_display_rows_input').value = items['virtualBrailleRows']; }); chrome.storage.local.get({'virtualBrailleColumns': 40}, function(items) { $('virtual-braille-display-columns-input').value = @@ -86,15 +78,22 @@ Msgs.getMsg('options_current_display_style_interleave'); var currentlyDisplayingSideBySide = Msgs.getMsg('options_current_display_style_side_by_side'); + $('changeDisplayStyle').textContent = + localStorage['brailleSideBySide'] === 'true' ? changeToInterleave : + changeToSideBySide; + $('currentDisplayStyle').textContent = + localStorage['brailleSideBySide'] === 'true' ? + currentlyDisplayingSideBySide : + currentlyDisplayingInterleave; var showEventStreamFilters = Msgs.getMsg('options_show_event_stream_filters'); var hideEventStreamFilters = Msgs.getMsg('options_hide_event_stream_filters'); - $('toggle-event-stream-filters').textContent = showEventStreamFilters; + $('toggleEventStreamFilters').textContent = showEventStreamFilters; cvox.OptionsPage.disableEventStreamFilterCheckBoxes( localStorage['enableEventStreamLogging'] == 'false'); if (localStorage['audioStrategy']) { - for (var i = 0, opt; opt = $('audio-strategy').options[i]; i++) { + for (var i = 0, opt; opt = $('audioStrategy').options[i]; i++) { if (opt.id == localStorage['audioStrategy']) { opt.setAttribute('selected', ''); } @@ -118,122 +117,48 @@ }); var registerEventStreamFiltersListener = function() { - $('toggle-event-stream-filters').addEventListener('click', function(evt) { - if ($('event-stream-filters').hidden) { - $('event-stream-filters').hidden = false; - $('toggle-event-stream-filters').textContent = hideEventStreamFilters; + $('toggleEventStreamFilters').addEventListener('click', function(evt) { + if ($('eventStreamFilters').hidden) { + $('eventStreamFilters').hidden = false; + $('toggleEventStreamFilters').textContent = hideEventStreamFilters; } else { - $('event-stream-filters').hidden = true; - $('toggle-event-stream-filters').textContent = showEventStreamFilters; + $('eventStreamFilters').hidden = true; + $('toggleEventStreamFilters').textContent = showEventStreamFilters; } }); }; var toggleShowDeveloperOptions = function() { - $('developer-speech-logging').hidden = - !$('developer-speech-logging').hidden; - $('developer-earcon-logging').hidden = - !$('developer-earcon-logging').hidden; - $('developer-braille-logging').hidden = - !$('developer-braille-logging').hidden; - $('developer-event-stream').hidden = !$('developer-event-stream').hidden; - $('show-developer-log').hidden = !$('show-developer-log').hidden; - $('chromevox-developer-options-more').hidden = - !($('chromevox-developer-options-more').hidden); - $('chromevox-developer-options-less').hidden = - !($('chromevox-developer-options-less').hidden); + $('developerSpeechLogging').hidden = !$('developerSpeechLogging').hidden; + $('developerEarconLogging').hidden = !$('developerEarconLogging').hidden; + $('developerBrailleLogging').hidden = !$('developerBrailleLogging').hidden; + $('developerEventStream').hidden = !$('developerEventStream').hidden; + $('showDeveloperLog').hidden = !$('showDeveloperLog').hidden; + $('chromeVoxDeveloperOptionsMore').hidden = + !($('chromeVoxDeveloperOptionsMore').hidden); + $('chromeVoxDeveloperOptionsLess').hidden = + !($('chromeVoxDeveloperOptionsLess').hidden); }; - var toggleBrailleSettings = function() { - $('braille-settings-more').hidden = !($('braille-settings-more').hidden); - $('braille-settings-less').hidden = !($('braille-settings-less').hidden); - $('6-dot-braille').hidden = !($('6-dot-braille').hidden); - $('8-dot-braille').hidden = !($('8-dot-braille').hidden); - $('braille-word-wrap').hidden = !($('braille-word-wrap').hidden); - }; - - $('braille-settings-more').addEventListener('click', function(evt) { - toggleBrailleSettings(); + $('chromeVoxDeveloperOptionsMore').addEventListener('click', function(evt) { + toggleShowDeveloperOptions(); }); - $('braille-settings-less').addEventListener('click', function(evt) { - toggleBrailleSettings(); + $('chromeVoxDeveloperOptionsLess').addEventListener('click', function(evt) { + toggleShowDeveloperOptions(); }); - var toggleVirtualBrailleSettings = function() { - $('virtual-braille-settings-more').hidden = - !($('virtual-braille-settings-more').hidden); - $('virtual-braille-settings-less').hidden = - !($('virtual-braille-settings-less').hidden); - $('virtual-braille-settings-num-lines').hidden = - !($('virtual-braille-settings-num-lines').hidden); - $('virtual-braille-settings-lines-cells').hidden = - !($('virtual-braille-settings-lines-cells').hidden); - $('virtual-braille-settings-display').hidden = - !($('virtual-braille-settings-display').hidden); - }; - - $('virtual-braille-settings-more').addEventListener('click', function(evt) { - toggleVirtualBrailleSettings(); - }); - - $('virtual-braille-settings-less').addEventListener('click', function(evt) { - toggleVirtualBrailleSettings(); - }); - - $('braille-description-6').addEventListener('click', function(evt) { - $('braille-description-6').checked = true; - $('braille-description-8').checked = false; - }); - $('braille-description-8').addEventListener('click', function(evt) { - $('braille-description-8').checked = true; - $('braille-description-6').checked = false; - }); - - /** @type {!BluetoothBrailleDisplayUI} */ - cvox.OptionsPage.bluetoothBrailleDisplayUI = new BluetoothBrailleDisplayUI(); - var bluetoothBraille = $('bluetooth-braille'); - if (bluetoothBraille) { - cvox.OptionsPage.bluetoothBrailleDisplayUI.attach(bluetoothBraille); - } - - var toggleBluetoothBrailleSettings = function() { - $('bt-braille-settings-more').hidden = - !($('bt-braille-settings-more').hidden); - $('bt-braille-settings-less').hidden = - !($('bt-braille-settings-less').hidden); - $('bluetooth-braille').hidden = !($('bluetooth-braille').hidden); - }; - - $('bt-braille-settings-more').addEventListener('click', function(evt) { - toggleBluetoothBrailleSettings(); - }); - - $('bt-braille-settings-less').addEventListener('click', function(evt) { - toggleBluetoothBrailleSettings(); - }); - - $('chromevox-developer-options-more') - .addEventListener('click', function(evt) { - toggleShowDeveloperOptions(); - }); - - $('chromevox-developer-options-less') - .addEventListener('click', function(evt) { - toggleShowDeveloperOptions(); - }); - - $('open-developer-log').addEventListener('click', function(evt) { + $('openDeveloperLog').addEventListener('click', function(evt) { let logPage = {url: 'cvox2/background/log.html'}; chrome.tabs.create(logPage); }); // Hide developer options by default. - $('developer-speech-logging').hidden = true; - $('developer-earcon-logging').hidden = true; - $('developer-braille-logging').hidden = true; - $('developer-event-stream').hidden = true; - $('show-developer-log').hidden = true; + $('developerSpeechLogging').hidden = true; + $('developerEarconLogging').hidden = true; + $('developerBrailleLogging').hidden = true; + $('developerEventStream').hidden = true; + $('showDeveloperLog').hidden = true; registerEventStreamFiltersListener(); Msgs.addTranslatedMessagesToDom(document); @@ -265,8 +190,8 @@ var clearVirtualDisplay = function() { var groups = []; var sizeOfDisplay = - parseInt($('virtual-braille-display-rows-input').innerHTML, 10) * - parseInt($('virtual-braille-display-columns-input').innerHTML, 10); + parseInt($('virtual_braille_display_rows_input').innerHTML, 10) * + parseInt($('virtual_braille_display_columns_input').innerHTML, 10); for (var i = 0; i < sizeOfDisplay; i++) { groups.push(['X', 'X']); } @@ -275,11 +200,28 @@ })).send(); }; - handleNumericalInputPref( - 'virtual-braille-display-rows-input', 'virtualBrailleRows'); - handleNumericalInputPref( - 'virtual-braille-display-columns-input', 'virtualBrailleColumns'); + $('changeDisplayStyle').addEventListener('click', function(evt) { + var sideBySide = localStorage['brailleSideBySide'] !== 'true'; + localStorage['brailleSideBySide'] = sideBySide; + $('changeDisplayStyle').textContent = + sideBySide ? changeToInterleave : changeToSideBySide; + $('currentDisplayStyle').textContent = sideBySide ? + currentlyDisplayingSideBySide : + currentlyDisplayingInterleave; + clearVirtualDisplay(); + }, true); + handleNumericalInputPref( + 'virtual_braille_display_rows_input', 'virtualBrailleRows'); + handleNumericalInputPref( + 'virtual_braille_display_columns_input', 'virtualBrailleColumns'); + + /** @type {!BluetoothBrailleDisplayUI} */ + cvox.OptionsPage.bluetoothBrailleDisplayUI = new BluetoothBrailleDisplayUI(); + + var bluetoothBraille = $('bluetoothBraille'); + if (bluetoothBraille) + cvox.OptionsPage.bluetoothBrailleDisplayUI.attach(bluetoothBraille); }; /** @@ -378,16 +320,11 @@ /** * Populates the braille select control. - * @param {string} tableType The braille table type (6 or 8 dot). */ -cvox.OptionsPage.populateBrailleTablesSelect = function(tableType) { +cvox.OptionsPage.populateBrailleTablesSelect = function() { if (!cvox.ChromeVox.isChromeOS) { return; } - localStorage['brailleTable'] = tableType; - localStorage['brailleTableType'] = tableType; - cvox.OptionsPage.getBrailleTranslatorManager().refresh( - localStorage['brailleTable']); var tables = cvox.OptionsPage.brailleTables; var populateSelect = function(node, dots) { var activeTable = localStorage[node.id] || localStorage['brailleTable']; @@ -412,8 +349,8 @@ node.appendChild(elem); } }; - var select6 = $('braille-table-6'); - var select8 = $('braille-table-8'); + var select6 = $('brailleTable6'); + var select8 = $('brailleTable8'); populateSelect(select6, '6'); populateSelect(select8, '8'); @@ -427,11 +364,43 @@ localStorage['brailleTable']); }; }; - if (tableType == 'braille-table-6') { - handleBrailleSelect(select6); - } else if (tableType == 'braille-table-8') { - handleBrailleSelect(select8); - } + + select6.addEventListener('change', handleBrailleSelect(select6), true); + select8.addEventListener('change', handleBrailleSelect(select8), true); + + var tableTypeButton = $('brailleTableType'); + var updateTableType = function(setFocus) { + var currentTableType = localStorage['brailleTableType'] || 'brailleTable6'; + if (currentTableType == 'brailleTable6') { + select6.parentElement.style.display = 'block'; + select8.parentElement.style.display = 'none'; + if (setFocus) { + select6.focus(); + } + localStorage['brailleTable'] = localStorage['brailleTable6']; + localStorage['brailleTableType'] = 'brailleTable6'; + tableTypeButton.textContent = Msgs.getMsg('options_braille_table_type_6'); + } else { + select6.parentElement.style.display = 'none'; + select8.parentElement.style.display = 'block'; + if (setFocus) { + select8.focus(); + } + localStorage['brailleTable'] = localStorage['brailleTable8']; + localStorage['brailleTableType'] = 'brailleTable8'; + tableTypeButton.textContent = Msgs.getMsg('options_braille_table_type_8'); + } + cvox.OptionsPage.getBrailleTranslatorManager().refresh( + localStorage['brailleTable']); + }; + updateTableType(false); + + tableTypeButton.addEventListener('click', function(evt) { + var oldTableType = localStorage['brailleTableType']; + localStorage['brailleTableType'] = + oldTableType == 'brailleTable6' ? 'brailleTable8' : 'brailleTable6'; + updateTableType(true); + }, true); }; /** @@ -461,36 +430,16 @@ }; /** - * Event listener, called when an event occurs in the page - * that might affect one of the preference controls. + * Event listener, called when an event occurs in the page that might + * affect one of the preference controls. * @param {Event} event The event. - * @return {boolean} True if the default action should - * occur. + * @return {boolean} True if the default action should occur. */ cvox.OptionsPage.eventListener = function(event) { window.setTimeout(function() { var target = event.target; - if (target.id == 'braille-word-wrap') { + if (target.id == 'brailleWordWrap') { chrome.storage.local.set({brailleWordWrap: target.checked}); - } else if ( - target.id == 'braille-table-6' || target.id == 'braille-table-8') { - cvox.OptionsPage.populateBrailleTablesSelect(target.id); - } else if (target.id == 'change-display-style') { - var currentIndex = target.selectedIndex; - localStorage['brailleSideBySide'] = - ((currentIndex == cvox.OptionsPage.DisplayStyle.SIDE_BY_SIDE) ? - true : - false); - var groups = []; - var sizeOfDisplay = - parseInt($('virtual-braille-display-rows-input').innerHTML, 10) * - parseInt($('virtual-braille-display-columns-input').innerHTML, 10); - for (var i = 0; i < sizeOfDisplay; i++) { - groups.push(['X', 'X']); - } - (new PanelCommand(PanelCommandType.UPDATE_BRAILLE, { - groups: groups - })).send(); } else if (target.className.indexOf('logging') != -1) { cvox.OptionsPage.prefs.setLoggingPrefs(target.name, target.checked); if (target.name == 'enableEventStreamLogging') @@ -511,7 +460,7 @@ cvox.OptionsPage.prefs.setPref(target.name, elements[i].value); } } - } else if (target.id == 'audio-strategy') { + } else if (target.tagName == 'SELECT') { var selIndex = target.selectedIndex; var sel = target.options[selIndex]; var value = sel ? sel.id : 'audioNormal';
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.css b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.css index 66e25755d..6cb12b6f 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.css +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.css
@@ -2,8 +2,6 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -@import url(https://fonts.googleapis.com/css?family=Roboto); - body { border: 0; height: 35px;
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.html b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.html index 39725a3..7d571d56 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.html +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.html
@@ -6,6 +6,7 @@ <meta charset="utf-8"> <title class="i18n" msgid="panel_title"></title> +<link href="http://fonts.googleapis.com/css?family=Droid+Sans+Mono|Roboto:400,700,700italic" rel="stylesheet" type="text/css"> <link href="panel.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../../closure/base.js"></script>
diff --git a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd index 46f94be..0a00944 100644 --- a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd +++ b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd
@@ -459,9 +459,6 @@ <message desc="The title of the extension's options page." name="IDS_CHROMEVOX_OPTIONS_PAGE_TITLE"> ChromeVox Options </message> - <message name="IDS_CHROMEVOX_OPTIONS_BRAILLE_SETTINGS"> - Braille Settings - </message> <message desc="An options page section header for options about the ChromeVox virtual display. This section lets users change the rows, columns, and display style of the virtual braille display." name="IDS_CHROMEVOX_OPTIONS_VIRTUAL_BRAILLE_DISPLAY"> Virtual Braille Display </message> @@ -475,12 +472,6 @@ <message desc="The label for a numberic input field where the user can choose the number of cells in each line of a grid." name="IDS_CHROMEVOX_OPTIONS_VIRTUAL_BRAILLE_DISPLAY_COLUMNS"> Cells in each line: </message> - <message desc="A description that tells the user that the current display style of the virtual display interleaves braille and regular text, one on top of the other." name="IDS_CHROMEVOX_OPTIONS_DISPLAY_STYLE_INTERLEAVE"> - Interleave - </message> - <message desc="A description that tells the user that the current display style of the virtual display is side by side, where regular text is on the left and braille is on the right." name="IDS_CHROMEVOX_OPTIONS_DISPLAY_STYLE_SIDE_BY_SIDE"> - Side by side - </message> <message desc="A description that tells the user that the current display style of the virtual display interleaves braille and regular text, one on top of the other." name="IDS_CHROMEVOX_OPTIONS_CURRENT_DISPLAY_STYLE_INTERLEAVE"> Current display style is interleave. </message> @@ -592,9 +583,6 @@ <message desc="Enable event stream logging in chromevox for developer options." name="IDS_CHROMEVOX_OPTIONS_EVENT_STREAM_LOGGING"> Enable event stream logging </message> - <message desc="Display" name="IDS_CHROMEVOX_OPTIONS_DISPLAY_STYLE"> - Display Style - </message> <message desc="Show ChromeVox Event Log." name="IDS_CHROMEVOX_OPTIONS_SHOW_LOG"> Show Log </message>
diff --git a/chrome/browser/resources/chromeos/kiosk_next_home/api.js b/chrome/browser/resources/chromeos/kiosk_next_home/api.js index 37f981d..058ea54f 100644 --- a/chrome/browser/resources/chromeos/kiosk_next_home/api.js +++ b/chrome/browser/resources/chromeos/kiosk_next_home/api.js
@@ -64,15 +64,6 @@ launchApp(appId) {} /** - * Launches a URL prefixed by chromeos::switches::kKioskNextHomeUrlPrefix with - * the given suffix. - * @param {string} suffix - * @return {!Promise} Resolves if URL is launched, or rejects in case of - * failures. - */ - launchHomeUrl(suffix) {} - - /** * Launches an allowed ARC intent. Intents are checked via * chromeos::kiosk_next_home::IntentConfigHelper. * @param {string} intent
diff --git a/chrome/browser/resources/chromeos/kiosk_next_home/api_impl.js b/chrome/browser/resources/chromeos/kiosk_next_home/api_impl.js index 67a2676..41b8ee9a 100644 --- a/chrome/browser/resources/chromeos/kiosk_next_home/api_impl.js +++ b/chrome/browser/resources/chromeos/kiosk_next_home/api_impl.js
@@ -154,15 +154,6 @@ } /** @override */ - launchHomeUrl(suffix) { - return this.appControllerProxy_.launchHomeUrl(suffix).then(result => { - if (!result.launched) { - throw result.errorMessage; - } - }); - } - - /** @override */ launchIntent(intent) { return this.appControllerProxy_.launchIntent(intent).then(result => { if (!result.launched) {
diff --git a/chrome/browser/resources/omnibox/omnibox.js b/chrome/browser/resources/omnibox/omnibox.js index 1667287..1cac3e1 100644 --- a/chrome/browser/resources/omnibox/omnibox.js +++ b/chrome/browser/resources/omnibox/omnibox.js
@@ -20,6 +20,15 @@ (function() { /** * @typedef {{ + * inputText: string, + * callback: function(!mojom.OmniboxResponse):Promise, + * display: boolean, + * }} + */ +let Request; + +/** + * @typedef {{ * queryInputs: QueryInputs, * displayInputs: DisplayInputs, * responsesHistory: !Array<!Array<!mojom.OmniboxResponse>>, @@ -43,24 +52,9 @@ this.callbackRouter_ = new mojom.OmniboxPageCallbackRouter; this.callbackRouter_.handleNewAutocompleteResponse.addListener( - (response, isPageController) => { - // When unfocusing the browser omnibox, the autocomplete controller - // sends a response with no combined results. This response is ignored - // in order to prevent the previous non-empty response from being - // hidden and because these results wouldn't normally be displayed by - // the browser window omnibox. - if (isPageController || - (omniboxInput.connectWindowOmnibox && - response.combinedResults.length)) { - omniboxOutput.addAutocompleteResponse(response); - } - }); + this.handleNewAutocompleteResponse.bind(this)); this.callbackRouter_.handleNewAutocompleteQuery.addListener( - isPageController => { - if (isPageController || omniboxInput.connectWindowOmnibox) { - omniboxOutput.prepareNewQuery(); - } - }); + this.handleNewAutocompleteQuery.bind(this)); this.callbackRouter_.handleAnswerImageData.addListener( omniboxOutput.updateAnswerImage.bind(omniboxOutput)); @@ -68,11 +62,74 @@ this.handler_ = mojom.OmniboxPageHandler.getProxy(); this.handler_.setClientPage(this.callbackRouter_.createProxy()); - /** - * @type {function(string, boolean, number, boolean, boolean, boolean, - * string, number)} - */ - this.makeRequest = this.handler_.startOmniboxQuery.bind(this.handler_); + /** @private {Request} */ + this.lastRequest; + } + + + /** + * @param {!mojom.OmniboxResponse} response + * @param {boolean} isPageController + */ + handleNewAutocompleteResponse(response, isPageController) { + const isForLastPageRequest = isPageController && this.lastRequest && + this.lastRequest.inputText === response.host; + + // When unfocusing the browser omnibox, the autocomplete controller + // sends a response with no combined results. This response is ignored + // in order to prevent the previous non-empty response from being + // hidden and because these results wouldn't normally be displayed by + // the browser window omnibox. + if (isForLastPageRequest && this.lastRequest.display || + omniboxInput.connectWindowOmnibox && !isPageController && + response.combinedResults.length) { + omniboxOutput.addAutocompleteResponse(response); + } + + if (isForLastPageRequest && response.done) { + this.lastRequest.callback(response); + this.lastRequest = null; + } + } + + /** + * @param {boolean} isPageController + * @param {string} inputText + */ + handleNewAutocompleteQuery(isPageController, inputText) { + // If the request originated from the debug page and is not for display, + // then we don't want to clear the omniboxOutput. + if (isPageController && this.lastRequest && + this.lastRequest.inputText === inputText && + this.lastRequest.display || + omniboxInput.connectWindowOmnibox && !isPageController) { + omniboxOutput.prepareNewQuery(); + } + } + + /** + * @param {string} inputText + * @param {boolean} resetAutocompleteController + * @param {number} cursorPosition + * @param {boolean} zeroSuggest + * @param {boolean} preventInlineAutocomplete + * @param {boolean} preferKeyword + * @param {string} currentUrl + * @param {number} pageClassification + * @param {boolean} display + * @return {!Promise} + */ + makeRequest( + inputText, resetAutocompleteController, cursorPosition, zeroSuggest, + preventInlineAutocomplete, preferKeyword, currentUrl, pageClassification, + display) { + return new Promise(resolve => { + this.lastRequest = {inputText, callback: resolve, display}; + this.handler_.startOmniboxQuery( + inputText, resetAutocompleteController, cursorPosition, zeroSuggest, + preventInlineAutocomplete, preferKeyword, currentUrl, + pageClassification); + }); } } @@ -89,7 +146,7 @@ e.detail.inputText, e.detail.resetAutocompleteController, e.detail.cursorPosition, e.detail.zeroSuggest, e.detail.preventInlineAutocomplete, e.detail.preferKeyword, - e.detail.currentUrl, e.detail.pageClassification); + e.detail.currentUrl, e.detail.pageClassification, true); }); omniboxInput.addEventListener( 'display-inputs-changed',
diff --git a/chrome/browser/resources/policy/policy.css b/chrome/browser/resources/policy/policy.css index aaaea1f7..67d7f68 100644 --- a/chrome/browser/resources/policy/policy.css +++ b/chrome/browser/resources/policy/policy.css
@@ -80,7 +80,8 @@ background-color: rgb(250, 250, 250); } -.messages.row .value, +.warnings.row .value, +.errors.row .value, .value.row .value { flex-grow: 1; max-height: 200px; @@ -90,7 +91,8 @@ } <if expr="not is_android"> -.messages.row .name, +.errors.row .name, +.warnings.row .name, .conflict.row .name, .value.row .name { text-align: end;
diff --git a/chrome/browser/resources/policy/policy.html b/chrome/browser/resources/policy/policy.html index 743e944..e043cb9a 100644 --- a/chrome/browser/resources/policy/policy.html +++ b/chrome/browser/resources/policy/policy.html
@@ -166,7 +166,11 @@ <div class="name">$i18n{value}</div> <div class="value"></div> </div> - <div class="messages row" hidden> + <div class="errors row" hidden> + <div class="name">$i18n{error}</div> + <div class="value"></div> + </div> + <div class="warnings row" hidden> <div class="name">$i18n{warning}</div> <div class="value"></div> </div>
diff --git a/chrome/browser/resources/policy/policy_base.js b/chrome/browser/resources/policy/policy_base.js index f8ce952..31c815a 100644 --- a/chrome/browser/resources/policy/policy_base.js +++ b/chrome/browser/resources/policy/policy_base.js
@@ -34,6 +34,7 @@ /** * @typedef {{ + * ignored?: boolean, * name: string, * level: string, * link: ?string, @@ -172,10 +173,7 @@ // Set up the prototype chain. __proto__: HTMLDivElement.prototype, - decorate: function() { - this.querySelector('.policy.row') - .addEventListener('click', this.toggleExpanded_); - }, + decorate: function() {}, /** @param {Conflict} conflict */ initialize(conflict) { @@ -210,7 +208,7 @@ */ decorate: function() { const toggle = this.querySelector('.policy.row .toggle'); - toggle.addEventListener('click', this.toggleExpanded_); + toggle.addEventListener('click', this.toggleExpanded_.bind(this)); }, /** @param {Policy} policy */ @@ -222,7 +220,10 @@ this.unset_ = policy.value === undefined; /** @private {boolean} */ - this.hasMessages_ = !!policy.error; + this.hasErrors_ = !!policy.error; + + /** @private {boolean} */ + this.hasWarnings_ = !!policy.warning; /** @private {boolean} */ this.hasConflicts_ = !!policy.conflicts; @@ -265,18 +266,26 @@ const valueRowContentDisplay = this.querySelector('.value.row .value'); valueRowContentDisplay.textContent = policy.value; - const messageRowContentDisplay = - this.querySelector('.messages.row .value'); - messageRowContentDisplay.textContent = policy.error; + const errorRowContentDisplay = this.querySelector('.errors.row .value'); + errorRowContentDisplay.textContent = policy.error; + const warningRowContentDisplay = + this.querySelector('.warnings.row .value'); + warningRowContentDisplay.textContent = policy.warning; const messagesDisplay = this.querySelector('.messages'); - const messagesNotice = - this.hasMessages_ ? loadTimeData.getString('warning') : ''; + const errorsNotice = + this.hasErrors_ ? loadTimeData.getString('error') : ''; + const warningsNotice = + this.hasWarnings_ ? loadTimeData.getString('warning') : ''; const conflictsNotice = this.hasConflicts_ ? loadTimeData.getString('conflict') : ''; - const notice = (messagesNotice && conflictsNotice) ? - loadTimeData.getString('warningAndConflicts') : - messagesNotice || conflictsNotice || loadTimeData.getString('ok'); + const ignoredNotice = + this.policy.ignored ? loadTimeData.getString('ignored') : ''; + const notice = + [errorsNotice, warningsNotice, ignoredNotice, conflictsNotice] + .filter(x => !!x) + .join(', ') || + loadTimeData.getString('ok'); messagesDisplay.textContent = notice; @@ -298,23 +307,25 @@ * @private */ toggleExpanded_: function() { - const row = this.parentElement.parentElement; - const messageRowDisplay = row.querySelector('.messages.row'); - const valueRowDisplay = row.querySelector('.value.row'); + const warningRowDisplay = this.querySelector('.warnings.row'); + const errorRowDisplay = this.querySelector('.errors.row'); + const valueRowDisplay = this.querySelector('.value.row'); valueRowDisplay.hidden = !valueRowDisplay.hidden; if (valueRowDisplay.hidden) { - row.classList.remove('expanded'); + this.classList.remove('expanded'); } else { - row.classList.add('expanded'); + this.classList.add('expanded'); } - const messagesDisplay = row.querySelector('.messages'); this.querySelector('.show-more').hidden = !valueRowDisplay.hidden; this.querySelector('.show-less').hidden = valueRowDisplay.hidden; - if (messagesDisplay.textContent !== loadTimeData.getString('ok')) { - messageRowDisplay.hidden = !messageRowDisplay.hidden; + if (this.hasWarnings_) { + warningRowDisplay.hidden = !warningRowDisplay.hidden; } - row.querySelectorAll('.policy-conflict-data') + if (this.hasErrors_) { + errorRowDisplay.hidden = !errorRowDisplay.hidden; + } + this.querySelectorAll('.policy-conflict-data') .forEach(row => row.hidden = !row.hidden); }, };
diff --git a/chrome/browser/ui/app_list/app_list_client_impl.cc b/chrome/browser/ui/app_list/app_list_client_impl.cc index 89d1dc7..9bad5789 100644 --- a/chrome/browser/ui/app_list/app_list_client_impl.cc +++ b/chrome/browser/ui/app_list/app_list_client_impl.cc
@@ -130,11 +130,8 @@ result_id, suggestion_index, static_cast<int>(launched_from)); } - if (launched_from == - ash::mojom::AppListLaunchedFrom::kLaunchedFromSearchBox) { - RecordSearchResultOpenTypeHistogram(result->GetSearchResultType(), - IsTabletMode()); - } + RecordSearchResultOpenTypeHistogram( + launched_from, result->GetSearchResultType(), IsTabletMode()); } void AppListClientImpl::InvokeSearchResultAction(const std::string& result_id,
diff --git a/chrome/browser/ui/ash/ash_util.cc b/chrome/browser/ui/ash/ash_util.cc index 3d61019a..f8d75c69 100644 --- a/chrome/browser/ui/ash/ash_util.cc +++ b/chrome/browser/ui/ash/ash_util.cc
@@ -5,26 +5,16 @@ #include "chrome/browser/ui/ash/ash_util.h" #include "ash/public/cpp/shell_window_ids.h" -#include "ash/public/interfaces/event_properties.mojom.h" #include "ash/shell.h" #include "base/macros.h" #include "components/session_manager/core/session_manager.h" #include "content/public/common/service_manager_connection.h" -#include "ui/aura/window_event_dispatcher.h" -#include "ui/display/display.h" -#include "ui/display/screen.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/shadow_types.h" #include "ui/wm/core/window_animations.h" namespace ash_util { -bool WillAshProcessAcceleratorForEvent(const ui::KeyEvent& key_event) { - return key_event.properties() && - key_event.properties()->count( - ash::mojom::kWillProcessAccelerator_KeyEventProperty); -} - void SetupWidgetInitParamsForContainer(views::Widget::InitParams* params, int container_id) { DCHECK_GE(container_id, ash::kShellWindowId_MinContainer);
diff --git a/chrome/browser/ui/ash/ash_util.h b/chrome/browser/ui/ash/ash_util.h index b0984f85..5b1517af 100644 --- a/chrome/browser/ui/ash/ash_util.h +++ b/chrome/browser/ui/ash/ash_util.h
@@ -17,15 +17,8 @@ class Connector; } -namespace ui { -class KeyEvent; -} // namespace ui - namespace ash_util { -// Returns true if ash has an accelerator for |key_event| that is enabled. -bool WillAshProcessAcceleratorForEvent(const ui::KeyEvent& key_event); - // Sets up |params| to place the widget in an ash shell window container on // the primary display. See ash/public/cpp/shell_window_ids.h for |container_id| // values.
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index b034de9a..3fe1698 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -1092,8 +1092,8 @@ private: TestBrowserWindow* CreateTestBrowserWindowAura() { - std::unique_ptr<aura::Window> window(new aura::Window( - nullptr, aura::client::WINDOW_TYPE_NORMAL, GetContext()->env())); + std::unique_ptr<aura::Window> window( + new aura::Window(nullptr, aura::client::WINDOW_TYPE_NORMAL)); window->set_id(0); window->Init(ui::LAYER_TEXTURED); aura::client::ParentWindowWithContext(window.get(), GetContext(),
diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc index 34d7e739..b133ffee 100644 --- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc +++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
@@ -49,7 +49,7 @@ constexpr UserMetricsAction kAppMenuBookmarksNewBackgroundTab( "WrenchMenu_Bookmarks_ContextMenu_OpenAll"); constexpr UserMetricsAction kAppMenuBookmarksNewWindow( - "WrenchMenu_Bookmarks_ContextMenu_OpenAll"); + "WrenchMenu_Bookmarks_ContextMenu_OpenAllInNewWindow"); constexpr UserMetricsAction kAppMenuBookmarksIncognito( "WrenchMenu_Bookmarks_ContextMenu_OpenAllIncognito");
diff --git a/chrome/browser/ui/tabs/tab_group_data.cc b/chrome/browser/ui/tabs/tab_group_data.cc index f32c3f9..4c2d002 100644 --- a/chrome/browser/ui/tabs/tab_group_data.cc +++ b/chrome/browser/ui/tabs/tab_group_data.cc
@@ -15,5 +15,5 @@ ++next_placeholder_title_number; static SkRandom rand; - stroke_color_ = rand.nextU() | 0xff000000; + color_ = rand.nextU() | 0xff000000; }
diff --git a/chrome/browser/ui/tabs/tab_group_data.h b/chrome/browser/ui/tabs/tab_group_data.h index b0a230f..efe7745 100644 --- a/chrome/browser/ui/tabs/tab_group_data.h +++ b/chrome/browser/ui/tabs/tab_group_data.h
@@ -18,11 +18,11 @@ ~TabGroupData() = default; base::string16 title() const { return title_; } - SkColor stroke_color() const { return stroke_color_; } + SkColor color() const { return color_; } private: base::string16 title_; - SkColor stroke_color_; + SkColor color_; DISALLOW_COPY_AND_ASSIGN(TabGroupData); };
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc index 00a73125..52d1af1 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -82,9 +82,9 @@ class DialogWaiter : public aura::EnvObserver, public views::WidgetObserver { public: - explicit DialogWaiter(aura::Env* env) : env_(env) { env_->AddObserver(this); } + DialogWaiter() { aura::Env::GetInstance()->AddObserver(this); } - ~DialogWaiter() override { env_->RemoveObserver(this); } + ~DialogWaiter() override { aura::Env::GetInstance()->RemoveObserver(this); } views::Widget* WaitForDialog() { if (dialog_created_) @@ -118,7 +118,6 @@ } } - aura::Env* env_; bool dialog_created_ = false; views::Widget* dialog_ = nullptr; base::Closure quit_closure_; @@ -1278,8 +1277,7 @@ ASSERT_TRUE(child_menu != NULL); // Click and wait until the dialog box appears. - auto dialog_waiter = - std::make_unique<DialogWaiter>(GetWidget()->GetNativeWindow()->env()); + auto dialog_waiter = std::make_unique<DialogWaiter>(); ui_test_utils::MoveMouseToCenterAndPress( child_menu, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, base::BindOnce(&BookmarkBarViewTest12::Step4, base::Unretained(this),
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index ce415c82..25bbe8dc 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -173,7 +173,6 @@ #if defined(OS_CHROMEOS) #include "ash/public/cpp/accelerators.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/window_properties.h" #include "chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos.h" #include "chrome/grit/chrome_unscaled_resources.h" @@ -1636,14 +1635,6 @@ if (result != content::KeyboardEventProcessingResult::NOT_HANDLED) return result; -#if defined(OS_CHROMEOS) - if (event.os_event && event.os_event->IsKeyEvent() && - ash_util::WillAshProcessAcceleratorForEvent( - *event.os_event->AsKeyEvent())) { - return content::KeyboardEventProcessingResult::HANDLED_DONT_UPDATE_EVENT; - } -#endif - int id; if (!FindCommandIdForAccelerator(accelerator, &id)) { // |accelerator| is not a browser command, it may be handled by ash (e.g.
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 82ca994..2a030a7 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -620,6 +620,21 @@ } } +void Tab::SetGroup(base::Optional<int> group) { + if (group_ == group) + return; + group_ = group; + UpdateForegroundColors(); + SchedulePaint(); +} + +base::Optional<SkColor> Tab::GetGroupColor() const { + return group_.has_value() + ? base::make_optional( + controller_->GetDataForGroup(group_.value())->color()) + : base::nullopt; +} + SkColor Tab::GetAlertIndicatorColor(TabAlertState state) const { // If theme provider is not yet available, return the default button // color.
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h index d646db8..6daaebc 100644 --- a/chrome/browser/ui/views/tabs/tab.h +++ b/chrome/browser/ui/views/tabs/tab.h
@@ -12,6 +12,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/optional.h" #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" #include "ui/base/layout.h" #include "ui/gfx/animation/animation_delegate.h" @@ -117,6 +118,11 @@ void set_detached() { detached_ = true; } bool detached() const { return detached_; } + void SetGroup(base::Optional<int> group); + + // Returns the color for the tab's group, if any. + base::Optional<SkColor> GetGroupColor() const; + // Returns the color used for the alert indicator icon. SkColor GetAlertIndicatorColor(TabAlertState state) const; @@ -227,6 +233,9 @@ // True if the tab has been detached. bool detached_ = false; + // Defined when the tab is part of a group. + base::Optional<int> group_; + TabIcon* icon_ = nullptr; AlertIndicator* alert_indicator_ = nullptr; TabCloseButton* close_button_ = nullptr;
diff --git a/chrome/browser/ui/views/tabs/tab_controller.h b/chrome/browser/ui/views/tabs/tab_controller.h index d8bbbda..a666251 100644 --- a/chrome/browser/ui/views/tabs/tab_controller.h +++ b/chrome/browser/ui/views/tabs/tab_controller.h
@@ -12,6 +12,7 @@ class SkPath; class Tab; +class TabGroupData; namespace gfx { class Point; @@ -169,6 +170,9 @@ // Returns opacity for use on tab hover radial highlight. virtual float GetHoverOpacityForRadialHighlight() const = 0; + // Returns the TabGroupData instance for the given |group|. + virtual const TabGroupData* GetDataForGroup(int group) const = 0; + protected: virtual ~TabController() {} };
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index 3963d95..808c705 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -485,10 +485,6 @@ if (event_source == EVENT_SOURCE_TOUCH) SetCapture(source_context_); -#if defined(USE_AURA) - env_ = source_context_->AsView()->GetWidget()->GetNativeWindow()->env(); -#endif - window_finder_ = WindowFinder::Create( event_source, source_context->AsView()->GetWidget()->GetNativeWindow()); } @@ -1979,7 +1975,8 @@ gfx::Point TabDragController::GetCursorScreenPoint() { #if defined(OS_CHROMEOS) - if (event_source_ == EVENT_SOURCE_TOUCH && env_->is_touch_down()) { + if (event_source_ == EVENT_SOURCE_TOUCH && + aura::Env::GetInstance()->is_touch_down()) { views::Widget* widget = GetAttachedBrowserWidget(); DCHECK(widget); aura::Window* widget_window = widget->GetNativeWindow();
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chrome/browser/ui/views/tabs/tab_drag_controller.h index dd1f745..653d681 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.h +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.h
@@ -21,12 +21,6 @@ #include "ui/gfx/native_widget_types.h" #include "ui/views/widget/widget_observer.h" -#if defined(USE_AURA) -namespace aura { -class Env; -} -#endif - namespace ui { class ListSelectionModel; } @@ -650,10 +644,6 @@ std::unique_ptr<WindowFinder> window_finder_; -#if defined(USE_AURA) - aura::Env* env_ = nullptr; -#endif - base::WeakPtrFactory<TabDragController> weak_factory_; DISALLOW_COPY_AND_ASSIGN(TabDragController);
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index bf82036..17accbb9 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -2962,8 +2962,7 @@ ASSERT_TRUE(test->DragInputTo(target_point)); // Now add a second finger to tap on it. - not_attached_tab_strip->GetWidget()->GetNativeWindow()->env()->set_touch_down( - true); + aura::Env::GetInstance()->set_touch_down(true); ASSERT_TRUE(test->PressInput(gfx::Point(), 1)); ASSERT_TRUE(test->ReleaseInput(1));
diff --git a/chrome/browser/ui/views/tabs/tab_group_header.cc b/chrome/browser/ui/views/tabs/tab_group_header.cc index 69c8d7aa..9e24788 100644 --- a/chrome/browser/ui/views/tabs/tab_group_header.cc +++ b/chrome/browser/ui/views/tabs/tab_group_header.cc
@@ -10,7 +10,9 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ui/layout_constants.h" +#include "chrome/browser/ui/tabs/tab_group_data.h" #include "chrome/browser/ui/tabs/tab_style.h" +#include "chrome/browser/ui/views/tabs/tab_controller.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/gfx/canvas.h" @@ -22,7 +24,10 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -TabGroupHeader::TabGroupHeader(const base::string16& group_title) { +TabGroupHeader::TabGroupHeader(TabController* controller, int group) + : controller_(controller), group_(group) { + DCHECK(controller); + // TODO(crbug.com/905491): Call TabStyle::GetContentsInsets. constexpr gfx::Insets kPlaceholderInsets = gfx::Insets(4, 27); SetBorder(views::CreateEmptyBorder(kPlaceholderInsets)); @@ -34,11 +39,11 @@ .SetMainAxisAlignment(views::LayoutAlignment::kStart) .SetCrossAxisAlignment(views::LayoutAlignment::kCenter); - auto title = std::make_unique<views::Label>(group_title); + auto title = std::make_unique<views::Label>(GetGroupData()->title()); title->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); title->SetElideBehavior(gfx::FADE_TAIL); - auto* title_ptr = AddChildView(std::move(title)); - layout->SetFlexForView(title_ptr, + title_label_ = AddChildView(std::move(title)); + layout->SetFlexForView(title_label_, views::FlexSpecification::ForSizeRule( views::MinimumFlexSizeRule::kScaleToZero, views::MaximumFlexSizeRule::kUnbounded)); @@ -50,8 +55,13 @@ void TabGroupHeader::OnPaint(gfx::Canvas* canvas) { // TODO(crbug.com/905491): Call TabStyle::PaintTab. - constexpr SkColor kPlaceholderColor = SkColorSetRGB(0xAA, 0xBB, 0xCC); gfx::Rect fill_bounds(GetLocalBounds()); fill_bounds.Inset(TabStyle::GetTabOverlap(), 0); - canvas->FillRect(fill_bounds, kPlaceholderColor); + const SkColor color = GetGroupData()->color(); + canvas->FillRect(fill_bounds, color); + title_label_->SetBackgroundColor(color); +} + +const TabGroupData* TabGroupHeader::GetGroupData() { + return controller_->GetDataForGroup(group_); }
diff --git a/chrome/browser/ui/views/tabs/tab_group_header.h b/chrome/browser/ui/views/tabs/tab_group_header.h index 49a8471..254a459 100644 --- a/chrome/browser/ui/views/tabs/tab_group_header.h +++ b/chrome/browser/ui/views/tabs/tab_group_header.h
@@ -8,21 +8,34 @@ #include "base/strings/string16.h" #include "ui/views/view.h" +class TabController; +class TabGroupData; + namespace gfx { class Canvas; } +namespace views { +class Label; +} // View for tab group headers in the tab strip, which are tab-shaped markers of // group boundaries. There is one header for each group, which is included in // the tab strip flow and positioned left of the leftmost tab in the group. class TabGroupHeader : public views::View { public: - explicit TabGroupHeader(const base::string16& group_title); + TabGroupHeader(TabController* controller, int group); // views::View: void OnPaint(gfx::Canvas* canvas) override; private: + const TabGroupData* GetGroupData(); + + TabController* const controller_; + const int group_; + + views::Label* title_label_; + DISALLOW_COPY_AND_ASSIGN(TabGroupHeader); };
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc index 58d28f1..12cb000a 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
@@ -341,18 +341,22 @@ bool show_immediately = !last_visible_timestamp_.is_null() && elapsed_time <= kShowWithoutDelayTimeBuffer; + fade_animation_delegate_->CancelFadeOut(); + if (preview_image_) preview_image_->SetVisible(!tab->IsActive()); UpdateCardContent(tab->data()); + // If widget is already visible and anchored to the correct tab we should not + // try to reset the anchor view or reshow. + if (widget_->IsVisible() && GetAnchorView() == tab) + return; if (widget_->IsVisible() && !disable_animations_for_testing_) slide_animation_delegate_->AnimateToAnchorView(tab); else SetAnchorView(tab); - fade_animation_delegate_->CancelFadeOut(); - if (!widget_->IsVisible()) { if (disable_animations_for_testing_ || show_immediately || tab->HasFocus()) {
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 36444ce4..3da7d8f 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1199,10 +1199,9 @@ void TabStrip::ChangeTabGroup(int model_index, base::Optional<int> old_group, base::Optional<int> new_group) { + tab_at(model_index)->SetGroup(new_group); if (new_group.has_value() && !group_headers_[new_group.value()]) { - const TabGroupData* group_data = - controller_->GetDataForGroup(new_group.value()); - auto header = std::make_unique<TabGroupHeader>(group_data->title()); + auto header = std::make_unique<TabGroupHeader>(this, new_group.value()); header->set_owned_by_client(); AddChildView(header.get()); group_headers_[new_group.value()] = std::move(header); @@ -1768,6 +1767,10 @@ return radial_highlight_opacity_; } +const TabGroupData* TabStrip::GetDataForGroup(int group) const { + return controller_->GetDataForGroup(group); +} + /////////////////////////////////////////////////////////////////////////////// // TabStrip, views::AccessiblePaneView overrides:
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index 9b27520..97ab036 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h
@@ -267,6 +267,7 @@ gfx::Rect GetTabAnimationTargetBounds(const Tab* tab) override; float GetHoverOpacityForTab(float range_parameter) const override; float GetHoverOpacityForRadialHighlight() const override; + const TabGroupData* GetDataForGroup(int group) const override; // MouseWatcherListener: void MouseMovedOutOfHost() override;
diff --git a/chrome/browser/ui/views/tabs/tab_style_views.cc b/chrome/browser/ui/views/tabs/tab_style_views.cc index 464249b..ef3ebc4 100644 --- a/chrome/browser/ui/views/tabs/tab_style_views.cc +++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
@@ -11,6 +11,7 @@ #include "cc/paint/paint_record.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/ui/layout_constants.h" +#include "chrome/browser/ui/tabs/tab_group_data.h" #include "chrome/browser/ui/views/tabs/glow_hover_controller.h" #include "chrome/browser/ui/views/tabs/tab.h" #include "chrome/browser/ui/views/tabs/tab_close_button.h" @@ -80,23 +81,25 @@ // treated as an active tab regardless of its true current state. int GetStrokeThickness(bool should_paint_as_active = false) const; + bool ShouldPaintTabBackgroundColor(TabState active_state, int fill_id) const; + + SkColor GetTabBackgroundColor(TabState active_state) const; + // Painting helper functions: void PaintInactiveTabBackground(gfx::Canvas* canvas, const SkPath& clip) const; void PaintTabBackground(gfx::Canvas* canvas, - bool active, + TabState active_state, int fill_id, int y_inset, const SkPath* clip) const; void PaintTabBackgroundFill(gfx::Canvas* canvas, - bool active, + TabState active_state, bool paint_hover_effect, - SkColor active_color, - SkColor inactive_color, int fill_id, int y_inset) const; void PaintBackgroundStroke(gfx::Canvas* canvas, - bool active, + TabState active_state, SkColor stroke_color) const; void PaintSeparators(gfx::Canvas* canvas) const; @@ -392,8 +395,7 @@ expected_opacity = GetHoverOpacity(); } const SkColor bg_color = color_utils::AlphaBlend( - tab_->controller()->GetTabBackgroundColor(TAB_ACTIVE), - tab_->controller()->GetTabBackgroundColor(TAB_INACTIVE), + GetTabBackgroundColor(TAB_ACTIVE), GetTabBackgroundColor(TAB_INACTIVE), expected_opacity); SkColor title_color = tab_->controller()->GetTabForegroundColor( @@ -447,7 +449,7 @@ } if (tab_->IsActive()) { - PaintTabBackground(canvas, true /* active */, active_tab_fill_id, + PaintTabBackground(canvas, TAB_ACTIVE, active_tab_fill_id, active_tab_y_inset, nullptr /* clip */); } else { PaintInactiveTabBackground(canvas, clip); @@ -456,7 +458,7 @@ if (throb_value > 0) { canvas->SaveLayerAlpha(gfx::ToRoundedInt(throb_value * 0xff), tab_->GetLocalBounds()); - PaintTabBackground(canvas, true /* active */, active_tab_fill_id, + PaintTabBackground(canvas, TAB_ACTIVE, active_tab_fill_id, active_tab_y_inset, nullptr /* clip */); canvas->Restore(); } @@ -636,6 +638,42 @@ : 0; } +bool GM2TabStyle::ShouldPaintTabBackgroundColor(TabState active_state, + int fill_id) const { + // In the active case, always paint the tab background. The fill image may be + // transparent. + if (active_state == TAB_ACTIVE) + return true; + + // In the inactive case, the fill image is guaranteed to be opaque, so it's + // not necessary to paint the background when there is one. + if (fill_id) + return false; + + return tab_->GetThemeProvider()->GetDisplayProperty( + ThemeProperties::SHOULD_FILL_BACKGROUND_TAB_COLOR); +} + +SkColor GM2TabStyle::GetTabBackgroundColor(TabState active_state) const { + SkColor color = tab_->controller()->GetTabBackgroundColor(active_state); + + base::Optional<SkColor> group_color = tab_->GetGroupColor(); + if (group_color.has_value()) { + if (tab_->IsActive()) { + color = group_color.value(); + } else { + // Tint with group color. With a dark scheme, the tint needs a higher + // contrast to stand out effectively. + const float target_contrast = color_utils::IsDark(color) ? 1.8f : 1.2f; + const SkAlpha blend_alpha = color_utils::GetBlendValueWithMinimumContrast( + color, group_color.value(), color, target_contrast); + color = color_utils::AlphaBlend(group_color.value(), color, blend_alpha); + } + } + + return color; +} + void GM2TabStyle::PaintInactiveTabBackground(gfx::Canvas* canvas, const SkPath& clip) const { bool has_custom_image; @@ -643,63 +681,52 @@ if (!has_custom_image) fill_id = 0; - PaintTabBackground(canvas, false /* active */, fill_id, 0, + PaintTabBackground(canvas, TAB_INACTIVE, fill_id, 0, tab_->controller()->MaySetClip() ? &clip : nullptr); } void GM2TabStyle::PaintTabBackground(gfx::Canvas* canvas, - bool active, + TabState active_state, int fill_id, int y_inset, const SkPath* clip) const { // |y_inset| is only set when |fill_id| is being used. DCHECK(!y_inset || fill_id); - const SkColor active_color = - tab_->controller()->GetTabBackgroundColor(TAB_ACTIVE); - const SkColor inactive_color = - tab_->GetThemeProvider()->GetDisplayProperty( - ThemeProperties::SHOULD_FILL_BACKGROUND_TAB_COLOR) - ? tab_->controller()->GetTabBackgroundColor(TAB_INACTIVE) - : SK_ColorTRANSPARENT; const SkColor stroke_color = tab_->controller()->GetToolbarTopSeparatorColor(); - const bool paint_hover_effect = !active && IsHoverActive(); - const float stroke_thickness = GetStrokeThickness(active); + const bool paint_hover_effect = + active_state == TAB_INACTIVE && IsHoverActive(); + const float stroke_thickness = GetStrokeThickness(active_state == TAB_ACTIVE); - PaintTabBackgroundFill(canvas, active, paint_hover_effect, active_color, - inactive_color, fill_id, y_inset); + PaintTabBackgroundFill(canvas, active_state, paint_hover_effect, fill_id, + y_inset); if (stroke_thickness > 0) { gfx::ScopedCanvas scoped_canvas(clip ? canvas : nullptr); if (clip) canvas->sk_canvas()->clipPath(*clip, SkClipOp::kDifference, true); - PaintBackgroundStroke(canvas, active, stroke_color); + PaintBackgroundStroke(canvas, active_state, stroke_color); } PaintSeparators(canvas); } void GM2TabStyle::PaintTabBackgroundFill(gfx::Canvas* canvas, - bool active, + TabState active_state, bool paint_hover_effect, - SkColor active_color, - SkColor inactive_color, int fill_id, int y_inset) const { - const SkPath fill_path = - GetPath(PathType::kFill, canvas->image_scale(), active); + const SkPath fill_path = GetPath(PathType::kFill, canvas->image_scale(), + active_state == TAB_ACTIVE); gfx::ScopedCanvas scoped_canvas(canvas); const float scale = canvas->UndoDeviceScaleFactor(); canvas->ClipPath(fill_path, true); - // In the active case, always fill the tab with its bg color first in case the - // image is transparent. In the inactive case, the image is guaranteed to be - // opaque, so it's only necessary to fill the color when there's no image. - if (active || !fill_id) { + if (ShouldPaintTabBackgroundColor(active_state, fill_id)) { cc::PaintFlags flags; flags.setAntiAlias(true); - flags.setColor(active ? active_color : inactive_color); + flags.setColor(GetTabBackgroundColor(active_state)); canvas->DrawRect(gfx::ScaleToEnclosingRect(tab_->GetLocalBounds(), scale), flags); } @@ -719,22 +746,24 @@ const SkScalar radius = std::max(SkFloatToScalar(tab_->width() / 4.f), kMinHoverRadius); DrawHighlight(canvas, hover_location, radius * scale, - SkColorSetA(active_color, hover_controller_->GetAlpha())); + SkColorSetA(GetTabBackgroundColor(TAB_ACTIVE), + hover_controller_->GetAlpha())); } } void GM2TabStyle::PaintBackgroundStroke(gfx::Canvas* canvas, - bool active, + TabState active_state, SkColor stroke_color) const { SkPath outer_path = - GetPath(TabStyle::PathType::kBorder, canvas->image_scale(), active); + GetPath(TabStyle::PathType::kBorder, canvas->image_scale(), + active_state == TAB_ACTIVE); gfx::ScopedCanvas scoped_canvas(canvas); float scale = canvas->UndoDeviceScaleFactor(); cc::PaintFlags flags; flags.setAntiAlias(true); flags.setColor(stroke_color); flags.setStyle(cc::PaintFlags::kStroke_Style); - flags.setStrokeWidth(GetStrokeThickness(active) * scale); + flags.setStrokeWidth(GetStrokeThickness(active_state == TAB_ACTIVE) * scale); canvas->DrawPath(outer_path, flags); }
diff --git a/chrome/browser/ui/views/tabs/tab_unittest.cc b/chrome/browser/ui/views/tabs/tab_unittest.cc index 41ddb9c..766209c 100644 --- a/chrome/browser/ui/views/tabs/tab_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -12,6 +12,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/simple_test_tick_clock.h" #include "chrome/browser/ui/layout_constants.h" +#include "chrome/browser/ui/tabs/tab_group_data.h" #include "chrome/browser/ui/tabs/tab_utils.h" #include "chrome/browser/ui/views/tabs/alert_indicator.h" #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" @@ -115,6 +116,9 @@ return 1.0f; } float GetHoverOpacityForRadialHighlight() const override { return 1.0f; } + const TabGroupData* GetDataForGroup(int group) const override { + return nullptr; + } void SetTabColors(SkColor bg_color_active, SkColor fg_color_active,
diff --git a/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_handler.cc b/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_handler.cc index 281e7e74..65ab20f 100644 --- a/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_handler.cc +++ b/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_handler.cc
@@ -42,6 +42,7 @@ #include "content/public/browser/web_ui.h" #include "ui/aura/client/aura_constants.h" #include "ui/base/ui_base_features.h" +#include "ui/events/event.h" #include "ui/gfx/codec/png_codec.h" namespace chromeos {
diff --git a/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc b/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc index c975428a..a226243 100644 --- a/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc +++ b/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc
@@ -8,9 +8,9 @@ #include <string> #include <utility> -#include "ash/public/cpp/window_properties.h" #include "base/bind.h" #include "base/macros.h" +#include "base/strings/string_number_conversions.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/ash_util.h" @@ -27,7 +27,6 @@ #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/content_features.h" #include "net/base/url_util.h" -#include "ui/aura/window.h" #include "ui/views/widget/widget.h" namespace chromeos { @@ -38,13 +37,17 @@ constexpr int kAssistantOptInDialogWidth = 768; constexpr int kAssistantOptInDialogHeight = 640; +constexpr int kCaptionBarHeight = 32; constexpr char kFlowTypeParamKey[] = "flow-type"; +constexpr char kCaptionBarHeightParamKey[] = "caption-bar-height"; GURL CreateAssistantOptInURL(ash::mojom::FlowType type) { // TODO(updowndota): Directly use mojom enum types in js. - auto gurl = net::AppendOrReplaceQueryParameter( - GURL(chrome::kChromeUIAssistantOptInURL), kFlowTypeParamKey, - std::to_string(static_cast<int>(type))); + GURL gurl(chrome::kChromeUIAssistantOptInURL); + gurl = net::AppendQueryParameter( + gurl, kFlowTypeParamKey, base::NumberToString(static_cast<int>(type))); + gurl = net::AppendQueryParameter(gurl, kCaptionBarHeightParamKey, + base::NumberToString(kCaptionBarHeight)); return gurl; } @@ -123,7 +126,6 @@ g_dialog = new AssistantOptInDialog(type, std::move(callback)); g_dialog->ShowSystemDialog(); - g_dialog->dialog_window()->SetProperty(ash::kHideInOverviewKey, true); } AssistantOptInDialog::AssistantOptInDialog( @@ -139,21 +141,18 @@ void AssistantOptInDialog::AdjustWidgetInitParams( views::Widget::InitParams* params) { - *params = ash_util::GetFramelessInitParams(); + params->keep_on_top = false; } void AssistantOptInDialog::GetDialogSize(gfx::Size* size) const { - size->SetSize(kAssistantOptInDialogWidth, kAssistantOptInDialogHeight); + size->SetSize(kAssistantOptInDialogWidth, + kAssistantOptInDialogHeight - kCaptionBarHeight); } std::string AssistantOptInDialog::GetDialogArgs() const { return std::string(); } -bool AssistantOptInDialog::ShouldShowDialogTitle() const { - return false; -} - void AssistantOptInDialog::OnDialogShown( content::WebUI* webui, content::RenderViewHost* render_view_host) { @@ -173,8 +172,4 @@ SystemWebDialogDelegate::OnDialogClosed(json_retval); } -bool AssistantOptInDialog::CanCloseDialog() const { - return false; -} - } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h b/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h index 5ccd83e..45a5aca 100644 --- a/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h +++ b/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h
@@ -61,11 +61,9 @@ // ui::WebDialogDelegate void GetDialogSize(gfx::Size* size) const override; std::string GetDialogArgs() const override; - bool ShouldShowDialogTitle() const override; void OnDialogShown(content::WebUI* webui, content::RenderViewHost* render_view_host) override; void OnDialogClosed(const std::string& json_retval) override; - bool CanCloseDialog() const override; private: AssistantOptInUI* assistant_ui_ = nullptr;
diff --git a/chrome/browser/ui/webui/omnibox/omnibox.mojom b/chrome/browser/ui/webui/omnibox/omnibox.mojom index f24279a4..3427d03 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox.mojom +++ b/chrome/browser/ui/webui/omnibox/omnibox.mojom
@@ -79,6 +79,6 @@ interface OmniboxPage { handleNewAutocompleteResponse(OmniboxResponse response, bool isPageController); - HandleNewAutocompleteQuery(bool isPageController); + HandleNewAutocompleteQuery(bool isPageController, string input_text); HandleAnswerImageData(string image_url, string image_data); };
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc index 132a25c..4554907 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc +++ b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
@@ -235,8 +235,10 @@ OnOmniboxResultChanged(default_match_changed, controller_.get()); } -void OmniboxPageHandler::OnOmniboxQuery(AutocompleteController* controller) { - page_->HandleNewAutocompleteQuery(controller == controller_.get()); +void OmniboxPageHandler::OnOmniboxQuery(AutocompleteController* controller, + const base::string16& input_text) { + page_->HandleNewAutocompleteQuery(controller == controller_.get(), + base::UTF16ToUTF8(input_text)); } void OmniboxPageHandler::OnOmniboxResultChanged( @@ -412,7 +414,7 @@ input_.set_keyword_mode_entry_method(metrics::OmniboxEventProto::TAB); input_.set_from_omnibox_focus(zero_suggest); - OnOmniboxQuery(controller_.get()); + OnOmniboxQuery(controller_.get(), input_.text()); controller_->Start(input_); }
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.h b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.h index 389e1746..ec2f26b4 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.h +++ b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.h
@@ -39,7 +39,8 @@ void OnResultChanged(bool default_match_changed) override; // OmniboxControllerEmitter::Observer overrides: - void OnOmniboxQuery(AutocompleteController* controller) override; + void OnOmniboxQuery(AutocompleteController* controller, + const base::string16& input_text) override; void OnOmniboxResultChanged(bool default_match_changed, AutocompleteController* controller) override;
diff --git a/chrome/browser/ui/webui/policy_ui_browsertest.cc b/chrome/browser/ui/webui/policy_ui_browsertest.cc index 5dcd5c9a4..682f6f2 100644 --- a/chrome/browser/ui/webui/policy_ui_browsertest.cc +++ b/chrome/browser/ui/webui/policy_ui_browsertest.cc
@@ -134,8 +134,7 @@ // Populate expected status. if (unknown) - expected_policy.push_back( - l10n_util::GetStringUTF8(IDS_POLICY_HEADER_WARNING)); + expected_policy.push_back(l10n_util::GetStringUTF8(IDS_POLICY_LABEL_ERROR)); else if (!policy_map_entry) expected_policy.push_back(l10n_util::GetStringUTF8(IDS_POLICY_UNSET)); else @@ -149,6 +148,8 @@ const std::string& scope, const std::string& source, const std::string& error, + const std::string& warning, + bool ignored, const base::Value& value) { const char prefix[] = "chromePolicies"; expected->SetPath({prefix, name.c_str(), "level"}, base::Value(level)); @@ -156,6 +157,10 @@ expected->SetPath({prefix, name.c_str(), "source"}, base::Value(source)); if (!error.empty()) expected->SetPath({prefix, name.c_str(), "error"}, base::Value(error)); + if (!warning.empty()) + expected->SetPath({prefix, name.c_str(), "warning"}, base::Value(warning)); + if (ignored) + expected->SetPath({prefix, name.c_str(), "ignored"}, base::Value(ignored)); expected->SetPath({prefix, name.c_str(), "value"}, value.Clone()); } @@ -357,14 +362,14 @@ popups_blocked_for_urls.CreateDeepCopy(), nullptr); SetExpectedPolicy(&expected_values, policy::key::kPopupsBlockedForUrls, "mandatory", "machine", "sourcePlatform", std::string(), - popups_blocked_for_urls); + std::string(), false, popups_blocked_for_urls); values.Set(policy::key::kDefaultImagesSetting, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(2), nullptr); SetExpectedPolicy(&expected_values, policy::key::kDefaultImagesSetting, "mandatory", "machine", "sourceCloud", std::string(), - base::Value(2)); + std::string(), false, base::Value(2)); // This also checks that we save complex policies correctly. base::DictionaryValue unknown_policy; @@ -379,7 +384,7 @@ unknown_policy.CreateDeepCopy(), nullptr); SetExpectedPolicy(&expected_values, kUnknownPolicy, "recommended", "user", "sourceCloud", l10n_util::GetStringUTF8(IDS_POLICY_UNKNOWN), - unknown_policy); + std::string(), false, unknown_policy); // Set the extension policies to an empty dictionary as we haven't added any // such policies. @@ -411,7 +416,7 @@ std::make_unique<base::Value>(false), nullptr); SetExpectedPolicy(&expected_values, policy::key::kAllowFileSelectionDialogs, "mandatory", "machine", "sourcePlatform", std::string(), - base::Value(false)); + std::string(), false, base::Value(false)); #endif popups_blocked_for_urls.AppendString("ddd"); @@ -420,7 +425,7 @@ popups_blocked_for_urls.CreateDeepCopy(), nullptr); SetExpectedPolicy(&expected_values, policy::key::kPopupsBlockedForUrls, "mandatory", "machine", "sourcePlatform", std::string(), - popups_blocked_for_urls); + std::string(), false, popups_blocked_for_urls); provider_.UpdateChromePolicy(values);
diff --git a/chrome/browser/ui/webui/policy_ui_handler.cc b/chrome/browser/ui/webui/policy_ui_handler.cc index 2836de15..21ef975b 100644 --- a/chrome/browser/ui/webui/policy_ui_handler.cc +++ b/chrome/browser/ui/webui/policy_ui_handler.cc
@@ -642,9 +642,8 @@ source->AddLocalizedString("warning", IDS_POLICY_HEADER_WARNING); source->AddLocalizedString("levelMandatory", IDS_POLICY_LEVEL_MANDATORY); source->AddLocalizedString("levelRecommended", IDS_POLICY_LEVEL_RECOMMENDED); - source->AddLocalizedString("messages", IDS_POLICY_LABEL_MESSAGES); - source->AddLocalizedString("warningAndConflicts", - IDS_POLICY_LABEL_WARNING_AND_CONFLICT); + source->AddLocalizedString("error", IDS_POLICY_LABEL_ERROR); + source->AddLocalizedString("ignored", IDS_POLICY_LABEL_IGNORED); source->AddLocalizedString("notSpecified", IDS_POLICY_NOT_SPECIFIED); source->AddLocalizedString("ok", IDS_POLICY_OK); source->AddLocalizedString("scopeDevice", IDS_POLICY_SCOPE_DEVICE);
diff --git a/chrome/renderer/media/cast_receiver_session_delegate.cc b/chrome/renderer/media/cast_receiver_session_delegate.cc index 2e607c4..97a1c68 100644 --- a/chrome/renderer/media/cast_receiver_session_delegate.cc +++ b/chrome/renderer/media/cast_receiver_session_delegate.cc
@@ -54,7 +54,7 @@ void CastReceiverSessionDelegate::OnDecodedAudioFrame( std::unique_ptr<media::AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { DCHECK(io_task_runner_->BelongsToCurrentThread()); if (!audio_valve_) @@ -83,11 +83,11 @@ } void CastReceiverSessionDelegate::OnDecodedVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous) { if (frame_callback_.is_null()) return; - frame_callback_.Run(video_frame, playout_time); + frame_callback_.Run(std::move(video_frame), playout_time); cast_receiver_->RequestDecodedVideoFrame(on_video_decoded_cb_); }
diff --git a/chrome/renderer/media/cast_receiver_session_delegate.h b/chrome/renderer/media/cast_receiver_session_delegate.h index da0479f..9c8b8e24 100644 --- a/chrome/renderer/media/cast_receiver_session_delegate.h +++ b/chrome/renderer/media/cast_receiver_session_delegate.h
@@ -39,11 +39,11 @@ private: void OnDecodedAudioFrame(std::unique_ptr<media::AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous); - void OnDecodedVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + void OnDecodedVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous); scoped_refptr<CastReceiverAudioValve> audio_valve_;
diff --git a/chrome/renderer/media/cast_rtp_stream.cc b/chrome/renderer/media/cast_rtp_stream.cc index 025fc52..415153d6 100644 --- a/chrome/renderer/media/cast_rtp_stream.cc +++ b/chrome/renderer/media/cast_rtp_stream.cc
@@ -215,7 +215,7 @@ frame_input_ = std::move(frame_input); } - void OnVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, + void OnVideoFrame(scoped_refptr<media::VideoFrame> video_frame, base::TimeTicks estimated_capture_time) { main_task_runner_->PostTask( FROM_HERE, base::BindOnce(&CastVideoSink::DidReceiveFrame, sink_)); @@ -233,14 +233,14 @@ scoped_refptr<media::VideoFrame> frame = video_frame; // Drop alpha channel since we do not support it yet. if (frame->format() == media::PIXEL_FORMAT_I420A) - frame = media::WrapAsI420VideoFrame(video_frame); + frame = media::WrapAsI420VideoFrame(std::move(video_frame)); // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc TRACE_EVENT_INSTANT2("cast_perf_test", "ConsumeVideoFrame", TRACE_EVENT_SCOPE_THREAD, "timestamp", (timestamp - base::TimeTicks()).InMicroseconds(), "time_delta", frame->timestamp().InMicroseconds()); - frame_input_->InsertRawVideoFrame(frame, timestamp); + frame_input_->InsertRawVideoFrame(std::move(frame), timestamp); } private:
diff --git a/chrome/services/media_gallery_util/media_parser_android_unittest.cc b/chrome/services/media_gallery_util/media_parser_android_unittest.cc index d5cb5431..38bd5fa 100644 --- a/chrome/services/media_gallery_util/media_parser_android_unittest.cc +++ b/chrome/services/media_gallery_util/media_parser_android_unittest.cc
@@ -41,10 +41,10 @@ // Returns if the first few bytes in the YUV frame are not all zero. This is a // rough method to verify the frame is not empty. -bool HasValidYUVData(const scoped_refptr<media::VideoFrame>& frame) { +bool HasValidYUVData(const media::VideoFrame& frame) { bool valid = false; for (size_t i = 0; i < 8; ++i) { - valid |= *(frame->data(media::VideoFrame::kYPlane) + i); + valid |= *(frame.data(media::VideoFrame::kYPlane) + i); if (valid) break; } @@ -158,7 +158,7 @@ chrome::mojom::VideoFrameData::Tag::DECODED_FRAME); const auto& frame = result.video_frame_data->get_decoded_frame(); EXPECT_TRUE(frame); - EXPECT_TRUE(HasValidYUVData(frame)); + EXPECT_TRUE(HasValidYUVData(*frame)); EXPECT_TRUE(frame->IsMappable()); EXPECT_FALSE(frame->HasTextures()); EXPECT_EQ(frame->storage_type(), @@ -176,7 +176,7 @@ chrome::mojom::VideoFrameData::Tag::DECODED_FRAME); const auto& frame = result.video_frame_data->get_decoded_frame(); EXPECT_TRUE(frame); - EXPECT_TRUE(HasValidYUVData(frame)); + EXPECT_TRUE(HasValidYUVData(*frame)); EXPECT_TRUE(frame->IsMappable()); EXPECT_FALSE(frame->HasTextures()); EXPECT_EQ(frame->storage_type(),
diff --git a/chrome/test/chromedriver/test/run_webdriver_tests.py b/chrome/test/chromedriver/test/run_webdriver_tests.py index 3d95233..75e5096 100644 --- a/chrome/test/chromedriver/test/run_webdriver_tests.py +++ b/chrome/test/chromedriver/test/run_webdriver_tests.py
@@ -40,6 +40,23 @@ WEBDRIVER_CLIENT_ABS_PATH = os.path.join(BLINK_TOOLS_ABS_PATH, WD_CLIENT_PATH) +class TestShard(object): + def __init__(self, total_shards, shard_index): + self.total_shards = total_shards + self.shard_index = shard_index + + def is_matched_test(self, test_path): + """Determines if a test belongs to the current shard_index. + + Returns: + A boolean: True if tests in test_dir should be run in the + current shard index; False otherwise. + """ + if self.total_shards == 1: + return True + + return (hash(test_path) % self.total_shards) == self.shard_index + class WebDriverTestResult(object): def __init__(self, test_name, test_status, messsage=None): self.test_name = test_name @@ -178,6 +195,15 @@ help='log extra details that may be helpful when debugging') options = parser.parse_args() + env = os.environ + + total_shards = 1 + shard_index = 0 + if 'GTEST_TOTAL_SHARDS' in env: + total_shards = int(env['GTEST_TOTAL_SHARDS']) + if 'GTEST_SHARD_INDEX' in env: + shard_index = int(env['GTEST_SHARD_INDEX']) + test_shard = TestShard(total_shards, shard_index) test_results = [] log_level = logging.DEBUG if options.verbose else logging.INFO @@ -230,7 +256,10 @@ for filename in filenames: if '__init__' in filename: continue + test_file = os.path.join(root, filename) + if not test_shard.is_matched_test(test_file): + continue test_results += run_test(test_file, path_finder, port, skipped_tests) else: _log.error('%s is not a file nor directory.' % test_path) @@ -294,4 +323,4 @@ exit_code, exit_codes.MAX_FAILURES_EXIT_STATUS) exit_code = exit_codes.MAX_FAILURES_EXIT_STATUS - sys.exit(exit_code) \ No newline at end of file + sys.exit(exit_code)
diff --git a/chrome/test/data/android/usage_stats/amp_root.html b/chrome/test/data/android/usage_stats/amp_root.html new file mode 100644 index 0000000..381ae16 --- /dev/null +++ b/chrome/test/data/android/usage_stats/amp_root.html
@@ -0,0 +1,8 @@ +<html> + <head> + <link rel="canonical" href="http://example.com/" id="link_test_id" /> + </head> + <body> + <iframe id="iframe_test_id" src="">Test page with iframe and canonical url</iframe> + </body> +</html>
diff --git a/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js b/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js index f5cfdd4f..0ee9fb8 100644 --- a/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js +++ b/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js
@@ -383,29 +383,6 @@ * @constructor * @extends {CrElementsBrowserTest} */ -function CrElementsTabsTest() {} - -CrElementsTabsTest.prototype = { - __proto__: CrElementsBrowserTest.prototype, - - /** @override */ - browsePreload: 'chrome://resources/cr_elements/cr_tabs/cr_tabs.html', - - /** @override */ - extraLibraries: CrElementsBrowserTest.prototype.extraLibraries.concat([ - '../settings/test_util.js', - 'cr_tabs_test.js', - ]), -}; - -TEST_F('CrElementsTabsTest', 'All', function() { - mocha.run(); -}); - -/** - * @constructor - * @extends {CrElementsBrowserTest} - */ function CrElementsToastTest() {} CrElementsToastTest.prototype = {
diff --git a/chrome/test/data/webui/cr_elements/cr_elements_focus_test.js b/chrome/test/data/webui/cr_elements/cr_elements_focus_test.js index 770765f..5040264 100644 --- a/chrome/test/data/webui/cr_elements/cr_elements_focus_test.js +++ b/chrome/test/data/webui/cr_elements/cr_elements_focus_test.js
@@ -169,3 +169,27 @@ TEST_F('CrElementsExpandButtonTest', 'All', function() { mocha.run(); }); + +/** + * @constructor + * @extends {CrElementsBrowserTest} + */ +function CrElementsTabsTest() {} + +CrElementsTabsTest.prototype = { + __proto__: CrElementsFocusTest.prototype, + + /** @override */ + browsePreload: 'chrome://resources/cr_elements/cr_tabs/cr_tabs.html', + + /** @override */ + extraLibraries: CrElementsFocusTest.prototype.extraLibraries.concat([ + '//ui/webui/resources/js/util.js', + '../settings/test_util.js', + 'cr_tabs_test.js', + ]), +}; + +TEST_F('CrElementsTabsTest', 'All', function() { + mocha.run(); +});
diff --git a/chrome/test/data/webui/cr_elements/cr_tabs_test.js b/chrome/test/data/webui/cr_elements/cr_tabs_test.js index 911d560..6ba1caf 100644 --- a/chrome/test/data/webui/cr_elements/cr_tabs_test.js +++ b/chrome/test/data/webui/cr_elements/cr_tabs_test.js
@@ -29,13 +29,18 @@ */ async function checkUiChange(uiChange, initialSelection, expectedSelection) { tabs.selected = initialSelection; - const wait = test_util.eventToPromise('selected-changed', tabs); - uiChange(); - await wait; + if (initialSelection == expectedSelection) { + uiChange(); + } else { + const wait = test_util.eventToPromise('selected-changed', tabs); + uiChange(); + await wait; + } assertEquals(expectedSelection, tabs.selected); const tabElement = getTabElement(expectedSelection); assertTrue(!!tabElement); assertTrue(tabElement.classList.contains('selected')); + assertEquals(getDeepActiveElement(), tabElement); } /** @@ -59,17 +64,20 @@ expectedSelection); } - test('check CSS classes aria-selected for a tab', () => { + test('check CSS classes, aria-selected and tabindex for a tab', () => { const tab = getTabElement(0); assertEquals(1, tab.classList.length); assertEquals('false', tab.getAttribute('aria-selected')); + assertEquals('-1', tab.getAttribute('tabindex')); tabs.selected = 0; assertEquals(2, tab.classList.length); assertTrue(tab.classList.contains('selected')); assertEquals('true', tab.getAttribute('aria-selected')); + assertEquals('0', tab.getAttribute('tabindex')); tabs.selected = 1; assertEquals(1, tab.classList.length); assertEquals('false', tab.getAttribute('aria-selected')); + assertEquals('-1', tab.getAttribute('tabindex')); }); test('right/left pressed, selection changes and event fires', async () => { @@ -82,14 +90,24 @@ await checkKey('ArrowLeft', 1, 0); // Check that the selection wraps. await checkKey('ArrowLeft', 0, 2); + + await checkKey('Home', 0, 0); + await checkKey('Home', 1, 0); + await checkKey('Home', 2, 0); + await checkKey('End', 0, 2); + await checkKey('End', 1, 2); + await checkKey('End', 2, 2); }); test('clicking on tabs, selection changes and event fires', async () => { - await checkClickTab(0, 1); - await checkClickTab(1, 2); - await checkClickTab(2, 0); - await checkClickTab(2, 1); + await checkClickTab(0, 0); await checkClickTab(1, 0); + await checkClickTab(2, 0); + await checkClickTab(0, 1); + await checkClickTab(1, 1); + await checkClickTab(2, 1); await checkClickTab(0, 2); + await checkClickTab(1, 2); + await checkClickTab(2, 2); }); });
diff --git a/chromecast/browser/BUILD.gn b/chromecast/browser/BUILD.gn index 5bb6be4..8e49eb1 100644 --- a/chromecast/browser/BUILD.gn +++ b/chromecast/browser/BUILD.gn
@@ -244,6 +244,8 @@ "cast_content_window_aura.cc", "cast_content_window_aura.h", ] + + deps += [ "//ui/views:views" ] } if (!is_fuchsia) {
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 83fff78..ffce4483 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -98,6 +98,7 @@ #include "chromecast/graphics/cast_window_manager_aura.h" #include "components/viz/service/display/overlay_strategy_underlay_cast.h" // nogncheck #include "ui/display/screen.h" +#include "ui/views/views_delegate.h" #else #include "chromecast/graphics/cast_window_manager_default.h" #endif @@ -237,6 +238,21 @@ #endif +#if defined(USE_AURA) + +// Provide a basic implementation. No need to override anything since we're not +// planning on customizing any behavior at this point. +class CastViewsDelegate : public views::ViewsDelegate { + public: + CastViewsDelegate() = default; + ~CastViewsDelegate() override = default; + + private: + DISALLOW_COPY_AND_ASSIGN(CastViewsDelegate); +}; + +#endif // defined(USE_AURA) + } // namespace namespace chromecast { @@ -412,6 +428,12 @@ } void CastBrowserMainParts::ToolkitInitialized() { +#if defined(USE_AURA) + // Needs to be initialize before any UI is created. + if (!views::ViewsDelegate::GetInstance()) + views_delegate_ = std::make_unique<CastViewsDelegate>(); +#endif // defined(USE_AURA) + #if defined(OS_LINUX) // Without this call, the FontConfig library gets implicitly initialized // on the first call to FontConfig. Since it's not safe to initialize it
diff --git a/chromecast/browser/cast_browser_main_parts.h b/chromecast/browser/cast_browser_main_parts.h index 4577385..6659387 100644 --- a/chromecast/browser/cast_browser_main_parts.h +++ b/chromecast/browser/cast_browser_main_parts.h
@@ -31,6 +31,12 @@ class NetLog; } +#if defined(USE_AURA) +namespace views { +class ViewsDelegate; +} // namespace views +#endif // defined(USE_AURA) + namespace chromecast { class CastMemoryPressureMonitor; class WaylandServerController; @@ -96,6 +102,7 @@ std::unique_ptr<media::MediaCapsImpl> media_caps_; #if defined(USE_AURA) + std::unique_ptr<views::ViewsDelegate> views_delegate_; std::unique_ptr<CastWindowManagerAura> window_manager_; #else std::unique_ptr<CastWindowManager> window_manager_;
diff --git a/chromeos/constants/chromeos_switches.cc b/chromeos/constants/chromeos_switches.cc index 6ed0877..ce8fbe4 100644 --- a/chromeos/constants/chromeos_switches.cc +++ b/chromeos/constants/chromeos_switches.cc
@@ -403,9 +403,6 @@ const char kIgnoreUserProfileMappingForTests[] = "ignore-user-profile-mapping-for-tests"; -// URL prefix that can be launched by Kiosk Next Home. -const char kKioskNextHomeUrlPrefix[] = "kiosk-next-home-url-prefix"; - // Enables Chrome-as-a-login-manager behavior. const char kLoginManager[] = "login-manager";
diff --git a/chromeos/constants/chromeos_switches.h b/chromeos/constants/chromeos_switches.h index e6a900b..e27dc2e 100644 --- a/chromeos/constants/chromeos_switches.h +++ b/chromeos/constants/chromeos_switches.h
@@ -155,8 +155,6 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kHomedir[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kIgnoreUserProfileMappingForTests[]; -COMPONENT_EXPORT(CHROMEOS_CONSTANTS) -extern const char kKioskNextHomeUrlPrefix[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLoginManager[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLoginProfile[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLoginUser[];
diff --git a/components/chromeos_camera/fake_mjpeg_decode_accelerator.cc b/components/chromeos_camera/fake_mjpeg_decode_accelerator.cc index e40bbf6..1dcbe54 100644 --- a/components/chromeos_camera/fake_mjpeg_decode_accelerator.cc +++ b/components/chromeos_camera/fake_mjpeg_decode_accelerator.cc
@@ -38,7 +38,7 @@ void FakeMjpegDecodeAccelerator::Decode( media::BitstreamBuffer bitstream_buffer, - const scoped_refptr<media::VideoFrame>& video_frame) { + scoped_refptr<media::VideoFrame> video_frame) { DCHECK(io_task_runner_->BelongsToCurrentThread()); auto src_shm = std::make_unique<media::UnalignedSharedMemory>( @@ -55,13 +55,13 @@ decoder_task_runner_->PostTask( FROM_HERE, base::BindOnce(&FakeMjpegDecodeAccelerator::DecodeOnDecoderThread, - base::Unretained(this), bitstream_buffer.id(), video_frame, - base::Passed(&src_shm))); + base::Unretained(this), bitstream_buffer.id(), + std::move(video_frame), base::Passed(&src_shm))); } void FakeMjpegDecodeAccelerator::DecodeOnDecoderThread( int32_t bitstream_buffer_id, - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, std::unique_ptr<media::UnalignedSharedMemory> src_shm) { DCHECK(decoder_task_runner_->BelongsToCurrentThread());
diff --git a/components/chromeos_camera/fake_mjpeg_decode_accelerator.h b/components/chromeos_camera/fake_mjpeg_decode_accelerator.h index b6f4d14a..51b16c3 100644 --- a/components/chromeos_camera/fake_mjpeg_decode_accelerator.h +++ b/components/chromeos_camera/fake_mjpeg_decode_accelerator.h
@@ -33,13 +33,13 @@ // MjpegDecodeAccelerator implementation. bool Initialize(MjpegDecodeAccelerator::Client* client) override; void Decode(media::BitstreamBuffer bitstream_buffer, - const scoped_refptr<media::VideoFrame>& video_frame) override; + scoped_refptr<media::VideoFrame> video_frame) override; bool IsSupported() override; private: void DecodeOnDecoderThread( int32_t bitstream_buffer_id, - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, std::unique_ptr<media::UnalignedSharedMemory> src_shm); void NotifyError(int32_t bitstream_buffer_id, Error error); void NotifyErrorOnClientThread(int32_t bitstream_buffer_id, Error error);
diff --git a/components/chromeos_camera/mjpeg_decode_accelerator.h b/components/chromeos_camera/mjpeg_decode_accelerator.h index 6fc5816a..d8c5344 100644 --- a/components/chromeos_camera/mjpeg_decode_accelerator.h +++ b/components/chromeos_camera/mjpeg_decode_accelerator.h
@@ -115,7 +115,7 @@ // VideoFrameReady or NotifyError() is invoked for given id of // |bitstream_buffer|, or destructor returns. virtual void Decode(media::BitstreamBuffer bitstream_buffer, - const scoped_refptr<media::VideoFrame>& video_frame) = 0; + scoped_refptr<media::VideoFrame> video_frame) = 0; // Returns true when the JPEG decoder is supported. This can be called before // Initialize().
diff --git a/components/chromeos_camera/mjpeg_decode_accelerator_unittest.cc b/components/chromeos_camera/mjpeg_decode_accelerator_unittest.cc index 24fab73..11d431f0 100644 --- a/components/chromeos_camera/mjpeg_decode_accelerator_unittest.cc +++ b/components/chromeos_camera/mjpeg_decode_accelerator_unittest.cc
@@ -269,7 +269,7 @@ // Save a video frame that contains a decoded JPEG. The output is a PNG file. // The suffix will be added before the .png extension. void SaveToFile(int32_t bitstream_buffer_id, - const scoped_refptr<media::VideoFrame>& in_frame, + scoped_refptr<media::VideoFrame> in_frame, const std::string& suffix = ""); // Calculate mean absolute difference of hardware and software decode results @@ -414,9 +414,9 @@ } void JpegClient::SaveToFile(int32_t bitstream_buffer_id, - const scoped_refptr<media::VideoFrame>& in_frame, + scoped_refptr<media::VideoFrame> in_frame, const std::string& suffix) { - LOG_ASSERT(in_frame.get()); + LOG_ASSERT(in_frame); ParsedJpegImage* image_file = test_image_files_[bitstream_buffer_id]; // First convert to ARGB format. Note that in our case, the coded size and the
diff --git a/components/chromeos_camera/mojo_mjpeg_decode_accelerator.cc b/components/chromeos_camera/mojo_mjpeg_decode_accelerator.cc index d23e3b3..8c9cc8e5 100644 --- a/components/chromeos_camera/mojo_mjpeg_decode_accelerator.cc +++ b/components/chromeos_camera/mojo_mjpeg_decode_accelerator.cc
@@ -49,7 +49,7 @@ void MojoMjpegDecodeAccelerator::Decode( media::BitstreamBuffer bitstream_buffer, - const scoped_refptr<media::VideoFrame>& video_frame) { + scoped_refptr<media::VideoFrame> video_frame) { DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); DCHECK(jpeg_decoder_.is_bound());
diff --git a/components/chromeos_camera/mojo_mjpeg_decode_accelerator.h b/components/chromeos_camera/mojo_mjpeg_decode_accelerator.h index be223a53..1b57915 100644 --- a/components/chromeos_camera/mojo_mjpeg_decode_accelerator.h +++ b/components/chromeos_camera/mojo_mjpeg_decode_accelerator.h
@@ -35,7 +35,7 @@ bool Initialize(Client* client) override; void InitializeAsync(Client* client, InitCB init_cb) override; void Decode(media::BitstreamBuffer bitstream_buffer, - const scoped_refptr<media::VideoFrame>& video_frame) override; + scoped_refptr<media::VideoFrame> video_frame) override; bool IsSupported() override; private:
diff --git a/components/download/content/internal/download_driver_impl.cc b/components/download/content/internal/download_driver_impl.cc index d7b2dbf6..749bff5 100644 --- a/components/download/content/internal/download_driver_impl.cc +++ b/components/download/content/internal/download_driver_impl.cc
@@ -10,11 +10,13 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/feature_list.h" #include "base/metrics/histogram_functions.h" #include "base/strings/string_number_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_usage_estimator.h" #include "components/download/internal/background_service/driver_entry.h" +#include "components/download/public/common/download_features.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "components/download/public/common/download_url_parameters.h" #include "components/download/public/common/simple_download_manager_coordinator.h" @@ -115,6 +117,7 @@ SimpleDownloadManagerCoordinator* download_manager_coordinator) : client_(nullptr), download_manager_coordinator_(download_manager_coordinator), + is_ready_(false), weak_ptr_factory_(this) { DCHECK(download_manager_coordinator_); DETACH_FROM_SEQUENCE(sequence_checker_); @@ -147,9 +150,10 @@ } bool DownloadDriverImpl::IsReady() const { - // TODO(qinmin): return true when only active downloads are available. return client_ && download_manager_coordinator_ && - download_manager_coordinator_->has_all_history_downloads(); + (download_manager_coordinator_->has_all_history_downloads() || + base::FeatureList::IsEnabled( + features::kUseInProgressDownloadManagerForDownloadService)); } void DownloadDriverImpl::Start( @@ -328,10 +332,16 @@ if (!client_) return; - // TODO(qinmin): allow client_ to be used even if only active downloads are - // ready. - if (!active_downloads_only) + + if (is_ready_) + return; + + if (!active_downloads_only || + base::FeatureList::IsEnabled( + features::kUseInProgressDownloadManagerForDownloadService)) { client_->OnDriverReady(true); + is_ready_ = true; + } } void DownloadDriverImpl::OnManagerGoingDown(
diff --git a/components/download/content/internal/download_driver_impl.h b/components/download/content/internal/download_driver_impl.h index 141188d7..1fca209 100644 --- a/components/download/content/internal/download_driver_impl.h +++ b/components/download/content/internal/download_driver_impl.h
@@ -83,6 +83,9 @@ // no longer used. SimpleDownloadManagerCoordinator* download_manager_coordinator_; + // Whether this object is ready to handle download requests. + bool is_ready_; + SEQUENCE_CHECKER(sequence_checker_); // Only used to post tasks on the same thread.
diff --git a/components/download/internal/common/simple_download_manager.cc b/components/download/internal/common/simple_download_manager.cc index eaae3fc..5401b46 100644 --- a/components/download/internal/common/simple_download_manager.cc +++ b/components/download/internal/common/simple_download_manager.cc
@@ -13,10 +13,6 @@ observer.OnManagerGoingDown(); } -bool SimpleDownloadManager::CanDownload(DownloadUrlParameters* parameters) { - return true; -} - void SimpleDownloadManager::AddObserver(Observer* observer) { simple_download_manager_observers_.AddObserver(observer); if (initialized_)
diff --git a/components/download/public/common/download_features.cc b/components/download/public/common/download_features.cc index 4d925630..1545119 100644 --- a/components/download/public/common/download_features.cc +++ b/components/download/public/common/download_features.cc
@@ -41,5 +41,9 @@ const base::Feature kPreventDownloadsWithSamePath{ "PreventDownloadsWithSamePath", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kUseInProgressDownloadManagerForDownloadService{ + "UseInProgressDownloadManagerForDownloadService", + base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace features } // namespace download
diff --git a/components/download/public/common/download_features.h b/components/download/public/common/download_features.h index 914b17a..72740803 100644 --- a/components/download/public/common/download_features.h +++ b/components/download/public/common/download_features.h
@@ -37,6 +37,10 @@ COMPONENTS_DOWNLOAD_EXPORT extern const base::Feature kPreventDownloadsWithSamePath; +// Whether in-progress download manager will be used to initialize download +// service. +COMPONENTS_DOWNLOAD_EXPORT extern const base::Feature + kUseInProgressDownloadManagerForDownloadService; } // namespace features } // namespace download
diff --git a/components/download/public/common/mock_simple_download_manager.h b/components/download/public/common/mock_simple_download_manager.h index 4aecea6..9a878f7c 100644 --- a/components/download/public/common/mock_simple_download_manager.h +++ b/components/download/public/common/mock_simple_download_manager.h
@@ -30,6 +30,7 @@ DownloadUrlMock(params.get()); } + MOCK_METHOD1(CanDownload, bool(DownloadUrlParameters*)); MOCK_METHOD1(DownloadUrlMock, void(DownloadUrlParameters*)); MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); MOCK_METHOD1(GetAllDownloads, void(DownloadVector* downloads));
diff --git a/components/download/public/common/simple_download_manager.h b/components/download/public/common/simple_download_manager.h index 8a606e00..8a3bd82 100644 --- a/components/download/public/common/simple_download_manager.h +++ b/components/download/public/common/simple_download_manager.h
@@ -46,7 +46,7 @@ std::unique_ptr<DownloadUrlParameters> parameters) = 0; // Returns whether the manager can handle this download. - virtual bool CanDownload(DownloadUrlParameters* parameters); + virtual bool CanDownload(DownloadUrlParameters* parameters) = 0; using DownloadVector = std::vector<DownloadItem*>; // Add all download items to |downloads|, no matter the type or state, without
diff --git a/components/exo/buffer.cc b/components/exo/buffer.cc index e67dde3..75e4831c 100644 --- a/components/exo/buffer.cc +++ b/components/exo/buffer.cc
@@ -19,7 +19,6 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/traced_value.h" #include "components/exo/frame_sink_resource_manager.h" -#include "components/exo/wm_helper.h" #include "components/viz/common/gpu/context_lost_observer.h" #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/resources/resource_format.h" @@ -386,7 +385,7 @@ texture_.reset(); ui::ContextFactory* context_factory = - WMHelper::GetInstance()->env()->context_factory(); + aura::Env::GetInstance()->context_factory(); // Note: This can fail if GPU acceleration has been disabled. scoped_refptr<viz::RasterContextProvider> context_provider = context_factory->SharedMainThreadRasterContextProvider();
diff --git a/components/exo/fullscreen_shell_surface_unittest.cc b/components/exo/fullscreen_shell_surface_unittest.cc index c989df5..b340598 100644 --- a/components/exo/fullscreen_shell_surface_unittest.cc +++ b/components/exo/fullscreen_shell_surface_unittest.cc
@@ -26,8 +26,7 @@ std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format) { - return WMHelper::GetInstance() - ->env() + return aura::Env::GetInstance() ->context_factory() ->GetGpuMemoryBufferManager() ->CreateGpuMemoryBuffer(size, format, gfx::BufferUsage::GPU_READ,
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc index 991e3c0..c1cd110 100644 --- a/components/exo/shell_surface.cc +++ b/components/exo/shell_surface.cc
@@ -15,7 +15,6 @@ #include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "components/exo/shell_surface_util.h" -#include "components/exo/wm_helper.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/env.h" @@ -638,7 +637,7 @@ target, location, component, base::BindOnce(end_drag, base::Unretained(this))); } else { - gfx::Point location = WMHelper::GetInstance()->env()->last_mouse_location(); + gfx::Point location = aura::Env::GetInstance()->last_mouse_location(); ::wm::ConvertPointFromScreen(widget_->GetNativeWindow()->GetRootWindow(), &location); toplevel_handler->AttemptToStartDrag(
diff --git a/components/exo/surface.cc b/components/exo/surface.cc index 74a97003..33ddb35f 100644 --- a/components/exo/surface.cc +++ b/components/exo/surface.cc
@@ -229,9 +229,9 @@ // Surface, public: Surface::Surface() - : window_(std::make_unique<aura::Window>(new CustomWindowDelegate(this), - aura::client::WINDOW_TYPE_CONTROL, - WMHelper::GetInstance()->env())) { + : window_( + std::make_unique<aura::Window>(new CustomWindowDelegate(this), + aura::client::WINDOW_TYPE_CONTROL)) { window_->SetName("ExoSurface"); window_->SetProperty(kSurfaceKey, this); window_->Init(ui::LAYER_NOT_DRAWN);
diff --git a/components/exo/surface_tree_host.cc b/components/exo/surface_tree_host.cc index 5053abb..dc973767 100644 --- a/components/exo/surface_tree_host.cc +++ b/components/exo/surface_tree_host.cc
@@ -82,8 +82,7 @@ SurfaceTreeHost::SurfaceTreeHost(const std::string& window_name) : host_window_( std::make_unique<aura::Window>(nullptr, - aura::client::WINDOW_TYPE_CONTROL, - WMHelper::GetInstance()->env())) { + aura::client::WINDOW_TYPE_CONTROL)) { host_window_->SetName(window_name); host_window_->Init(ui::LAYER_SOLID_COLOR); host_window_->set_owned_by_parent(false); @@ -94,11 +93,11 @@ host_window_->SetEventTargeter(std::make_unique<CustomWindowTargeter>(this)); layer_tree_frame_sink_holder_ = std::make_unique<LayerTreeFrameSinkHolder>( this, host_window_->CreateLayerTreeFrameSink()); - WMHelper::GetInstance()->env()->context_factory()->AddObserver(this); + aura::Env::GetInstance()->context_factory()->AddObserver(this); } SurfaceTreeHost::~SurfaceTreeHost() { - WMHelper::GetInstance()->env()->context_factory()->RemoveObserver(this); + aura::Env::GetInstance()->context_factory()->RemoveObserver(this); SetRootSurface(nullptr); LayerTreeFrameSinkHolder::DeleteWhenLastResourceHasBeenReclaimed( std::move(layer_tree_frame_sink_holder_)); @@ -112,7 +111,7 @@ // ensure that occlusion isn't recomputed before all changes have been // applied. aura::WindowOcclusionTracker::ScopedPause pause_occlusion( - host_window_->env()); + aura::Env::GetInstance()); if (root_surface_) { root_surface_->window()->Hide(); @@ -262,7 +261,7 @@ for (auto& resource : frame.resource_list) sync_tokens.push_back(resource.mailbox_holder.sync_token.GetData()); ui::ContextFactory* context_factory = - WMHelper::GetInstance()->env()->context_factory(); + aura::Env::GetInstance()->context_factory(); gpu::gles2::GLES2Interface* gles2 = context_factory->SharedMainThreadContextProvider()->ContextGL(); gles2->VerifySyncTokensCHROMIUM(sync_tokens.data(), sync_tokens.size()); @@ -278,7 +277,7 @@ // to ensure that occlusion isn't recomputed before all changes have been // applied. aura::WindowOcclusionTracker::ScopedPause pause_occlusion( - host_window_->env()); + aura::Env::GetInstance()); gfx::Rect bounds = root_surface_->surface_hierarchy_content_bounds(); host_window_->SetBounds(
diff --git a/components/exo/surface_unittest.cc b/components/exo/surface_unittest.cc index 00c5e798..a54bc4a 100644 --- a/components/exo/surface_unittest.cc +++ b/components/exo/surface_unittest.cc
@@ -12,7 +12,6 @@ #include "components/exo/sub_surface.h" #include "components/exo/test/exo_test_base.h" #include "components/exo/test/exo_test_helper.h" -#include "components/exo/wm_helper.h" #include "components/viz/common/quads/compositor_frame.h" #include "components/viz/common/quads/texture_draw_quad.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" @@ -117,8 +116,7 @@ const viz::CompositorFrame& GetFrameFromSurface(ShellSurface* shell_surface) { viz::SurfaceId surface_id = shell_surface->host_window()->GetSurfaceId(); - viz::SurfaceManager* surface_manager = WMHelper::GetInstance() - ->env() + viz::SurfaceManager* surface_manager = aura::Env::GetInstance() ->context_factory_private() ->GetFrameSinkManager() ->surface_manager();
diff --git a/components/exo/test/exo_test_base.cc b/components/exo/test/exo_test_base.cc index 92c3e49..6d34243e 100644 --- a/components/exo/test/exo_test_base.cc +++ b/components/exo/test/exo_test_base.cc
@@ -28,8 +28,7 @@ void ExoTestBase::SetUp() { ui::SetUpInputMethodFactoryForTesting(); AshTestBase::SetUp(); - wm_helper_ = - std::make_unique<WMHelperChromeOS>(ash::Shell::Get()->aura_env()); + wm_helper_ = std::make_unique<WMHelperChromeOS>(); WMHelper::SetInstance(wm_helper_.get()); test::TestClientControlledStateDelegate::InstallFactory(); }
diff --git a/components/exo/test/exo_test_base_views.cc b/components/exo/test/exo_test_base_views.cc index 0aafb55..b2843cac 100644 --- a/components/exo/test/exo_test_base_views.cc +++ b/components/exo/test/exo_test_base_views.cc
@@ -18,12 +18,11 @@ class WMHelperTester : public WMHelper, public VSyncTimingManager::Delegate { public: - WMHelperTester(aura::Env* env, aura::Window* root_window) - : env_(env), root_window_(root_window), vsync_timing_manager_(this) {} + WMHelperTester(aura::Window* root_window) + : root_window_(root_window), vsync_timing_manager_(this) {} ~WMHelperTester() override {} // Overridden from WMHelper - aura::Env* env() override { return env_; } void AddActivationObserver(wm::ActivationChangeObserver* observer) override {} void RemoveActivationObserver( wm::ActivationChangeObserver* observer) override {} @@ -80,7 +79,6 @@ viz::mojom::VSyncParameterObserverPtr observer) override {} private: - aura::Env* const env_; aura::Window* root_window_; LifetimeManager lifetime_manager_; VSyncTimingManager vsync_timing_manager_; @@ -99,8 +97,7 @@ // Takes care of its own lifetime. new wm::DefaultActivationClient(root_window()); - wm_helper_ = - std::make_unique<WMHelperTester>(aura::Env::GetInstance(), root_window()); + wm_helper_ = std::make_unique<WMHelperTester>(root_window()); WMHelper::SetInstance(wm_helper_.get()); }
diff --git a/components/exo/test/exo_test_helper.cc b/components/exo/test/exo_test_helper.cc index 6a44e3f..1c3d7c9 100644 --- a/components/exo/test/exo_test_helper.cc +++ b/components/exo/test/exo_test_helper.cc
@@ -66,8 +66,7 @@ std::unique_ptr<gfx::GpuMemoryBuffer> ExoTestHelper::CreateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format) { - return WMHelper::GetInstance() - ->env() + return aura::Env::GetInstance() ->context_factory() ->GetGpuMemoryBufferManager() ->CreateGpuMemoryBuffer(size, format, gfx::BufferUsage::GPU_READ,
diff --git a/components/exo/wayland/clients/test/wayland_client_test.cc b/components/exo/wayland/clients/test/wayland_client_test.cc index f4501f0..f6d33a3 100644 --- a/components/exo/wayland/clients/test/wayland_client_test.cc +++ b/components/exo/wayland/clients/test/wayland_client_test.cc
@@ -23,7 +23,6 @@ #include "components/exo/wayland/server.h" #include "components/exo/wm_helper.h" #include "components/exo/wm_helper_chromeos.h" -#include "ui/aura/env.h" #include "ui/aura/window_tree_host.h" #include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/wm/core/cursor_manager.h" @@ -128,8 +127,7 @@ gesture_config->set_long_press_time_in_ms(1000); gesture_config->set_max_touch_move_in_pixels_for_click(5); - wm_helper_ = - std::make_unique<WMHelperChromeOS>(ash::Shell::Get()->aura_env()); + wm_helper_ = std::make_unique<WMHelperChromeOS>(); WMHelper::SetInstance(wm_helper_.get()); display_ = std::make_unique<Display>(nullptr, nullptr, nullptr); wayland_server_ = exo::wayland::Server::Create(display_.get());
diff --git a/components/exo/wayland/zaura_shell.cc b/components/exo/wayland/zaura_shell.cc index 7f3285f4..95872439 100644 --- a/components/exo/wayland/zaura_shell.cc +++ b/components/exo/wayland/zaura_shell.cc
@@ -18,6 +18,7 @@ #include "components/exo/wayland/server_util.h" #include "components/exo/wayland/wayland_display_observer.h" #include "components/exo/wayland/wl_output.h" +#include "ui/aura/env.h" #include "ui/aura/window_occlusion_tracker.h" #include "ui/display/manager/display_manager.h" #include "ui/display/manager/display_util.h" @@ -235,7 +236,8 @@ // window. To support overview, we would need to have it keep the original // window activated and also do this inside OnWindowStackingChanged. // See crbug.com/948492. - auto* occlusion_tracker = window->env()->GetWindowOcclusionTracker(); + auto* occlusion_tracker = + aura::Env::GetInstance()->GetWindowOcclusionTracker(); if (occlusion_tracker->HasIgnoredAnimatingWindows()) { const auto& occlusion_data = occlusion_tracker->ComputeTargetOcclusionForWindow(window);
diff --git a/components/exo/wm_helper.h b/components/exo/wm_helper.h index 62db25e3..2629279 100644 --- a/components/exo/wm_helper.h +++ b/components/exo/wm_helper.h
@@ -11,7 +11,6 @@ #include "base/observer_list.h" #include "base/time/time.h" #include "ui/aura/client/drag_drop_delegate.h" -#include "ui/aura/env.h" #include "ui/base/cursor/cursor.h" namespace aura { @@ -88,8 +87,6 @@ static WMHelper* GetInstance(); static bool HasInstance(); - virtual aura::Env* env() = 0; - virtual void AddActivationObserver( wm::ActivationChangeObserver* observer) = 0; virtual void RemoveActivationObserver(
diff --git a/components/exo/wm_helper_chromeos.cc b/components/exo/wm_helper_chromeos.cc index 0665833..269d1f1 100644 --- a/components/exo/wm_helper_chromeos.cc +++ b/components/exo/wm_helper_chromeos.cc
@@ -30,8 +30,7 @@ //////////////////////////////////////////////////////////////////////////////// // WMHelperChromeOS, public: -WMHelperChromeOS::WMHelperChromeOS(aura::Env* env) - : env_(env), vsync_timing_manager_(this) {} +WMHelperChromeOS::WMHelperChromeOS() : vsync_timing_manager_(this) {} WMHelperChromeOS::~WMHelperChromeOS() {} @@ -59,10 +58,6 @@ ash::Shell::Get()->window_tree_host_manager()->RemoveObserver(observer); } -aura::Env* WMHelperChromeOS::env() { - return env_; -} - void WMHelperChromeOS::AddActivationObserver( wm::ActivationChangeObserver* observer) { ash::Shell::Get()->activation_client()->AddObserver(observer);
diff --git a/components/exo/wm_helper_chromeos.h b/components/exo/wm_helper_chromeos.h index 2fd8879..856d49f 100644 --- a/components/exo/wm_helper_chromeos.h +++ b/components/exo/wm_helper_chromeos.h
@@ -20,7 +20,6 @@ } namespace aura { -class env; class Window; namespace client { class CursorClient; @@ -51,7 +50,7 @@ // features. class WMHelperChromeOS : public WMHelper, public VSyncTimingManager::Delegate { public: - explicit WMHelperChromeOS(aura::Env* env); + WMHelperChromeOS(); ~WMHelperChromeOS() override; static WMHelperChromeOS* GetInstance(); void AddTabletModeObserver(ash::TabletModeObserver* observer); @@ -62,7 +61,6 @@ ash::WindowTreeHostManager::Observer* observer); // Overridden from WMHelper - aura::Env* env() override; void AddActivationObserver(wm::ActivationChangeObserver* observer) override; void RemoveActivationObserver( wm::ActivationChangeObserver* observer) override; @@ -108,7 +106,6 @@ private: base::ObserverList<DragDropObserver>::Unchecked drag_drop_observers_; - aura::Env* const env_; LifetimeManager lifetime_manager_; VSyncTimingManager vsync_timing_manager_;
diff --git a/components/omnibox/browser/omnibox_controller.cc b/components/omnibox/browser/omnibox_controller.cc index a86a4c5..5e260bf2 100644 --- a/components/omnibox/browser/omnibox_controller.cc +++ b/components/omnibox/browser/omnibox_controller.cc
@@ -34,9 +34,10 @@ const AutocompleteInput& input) const { ClearPopupKeywordMode(); - if (client_->GetOmniboxControllerEmitter()) + if (client_->GetOmniboxControllerEmitter()) { client_->GetOmniboxControllerEmitter()->NotifyOmniboxQuery( - autocomplete_controller_.get()); + autocomplete_controller_.get(), input.text()); + } // We don't explicitly clear OmniboxPopupModel::manually_selected_match, as // Start ends up invoking OmniboxPopupModel::OnResultChanged which clears it.
diff --git a/components/omnibox/browser/omnibox_controller_emitter.cc b/components/omnibox/browser/omnibox_controller_emitter.cc index 0325a71..0e173275 100644 --- a/components/omnibox/browser/omnibox_controller_emitter.cc +++ b/components/omnibox/browser/omnibox_controller_emitter.cc
@@ -68,9 +68,10 @@ } void OmniboxControllerEmitter::NotifyOmniboxQuery( - AutocompleteController* controller) { + AutocompleteController* controller, + const base::string16& input_text) { for (Observer& observer : observers_) - observer.OnOmniboxQuery(controller); + observer.OnOmniboxQuery(controller, input_text); } void OmniboxControllerEmitter::NotifyOmniboxResultChanged(
diff --git a/components/omnibox/browser/omnibox_controller_emitter.h b/components/omnibox/browser/omnibox_controller_emitter.h index e88acd1..ce27cb5 100644 --- a/components/omnibox/browser/omnibox_controller_emitter.h +++ b/components/omnibox/browser/omnibox_controller_emitter.h
@@ -22,7 +22,8 @@ public: // Invoked when new autocomplete queries are made from the omnibox // controller or when those queries' results change. - virtual void OnOmniboxQuery(AutocompleteController* controller) = 0; + virtual void OnOmniboxQuery(AutocompleteController* controller, + const base::string16& input_text) = 0; virtual void OnOmniboxResultChanged(bool default_match_changed, AutocompleteController* controller) = 0; }; @@ -41,7 +42,8 @@ // Notifies registered observers when new autocomplete queries are made from // the omnibox controller or when those queries' results change. - void NotifyOmniboxQuery(AutocompleteController* controller); + void NotifyOmniboxQuery(AutocompleteController* controller, + const base::string16& input_text); void NotifyOmniboxResultChanged(bool default_match_changed, AutocompleteController* controller);
diff --git a/components/password_manager/content/common/credential_manager_mojom_traits.cc b/components/password_manager/content/common/credential_manager_mojom_traits.cc index 09a87af00..fe37c698 100644 --- a/components/password_manager/content/common/credential_manager_mojom_traits.cc +++ b/components/password_manager/content/common/credential_manager_mojom_traits.cc
@@ -92,7 +92,6 @@ ANDROID_USER_VERIFICATION_UNSUPPORTED: case blink::mojom::CredentialManagerError::INVALID_DOMAIN: case blink::mojom::CredentialManagerError::CREDENTIAL_EXCLUDED: - case blink::mojom::CredentialManagerError::CREDENTIAL_NOT_RECOGNIZED: case blink::mojom::CredentialManagerError::NOT_IMPLEMENTED: case blink::mojom::CredentialManagerError::NOT_FOCUSED: case blink::mojom::CredentialManagerError::RESIDENT_CREDENTIALS_UNSUPPORTED:
diff --git a/components/policy/core/common/config_dir_policy_loader_unittest.cc b/components/policy/core/common/config_dir_policy_loader_unittest.cc index 4c64d97..4a50c9b 100644 --- a/components/policy/core/common/config_dir_policy_loader_unittest.cc +++ b/components/policy/core/common/config_dir_policy_loader_unittest.cc
@@ -252,7 +252,7 @@ ->AddConflictingPolicy(conflict_policy); expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) .GetMutable(kHomepageLocation) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); } EXPECT_TRUE(bundle->Equals(expected_bundle)); }
diff --git a/components/policy/core/common/policy_bundle_unittest.cc b/components/policy/core/common/policy_bundle_unittest.cc index daa5383..eff687b 100644 --- a/components/policy/core/common/policy_bundle_unittest.cc +++ b/components/policy/core/common/policy_bundle_unittest.cc
@@ -198,9 +198,9 @@ expected.GetMutable(kPolicyClashing0) ->AddConflictingPolicy(*policy2.Get(kPolicyClashing0)); expected.GetMutable(kPolicyClashing0) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.GetMutable(kPolicyClashing0) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.Set(kPolicyClashing1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr); expected.GetMutable(kPolicyClashing1) @@ -208,9 +208,9 @@ expected.GetMutable(kPolicyClashing1) ->AddConflictingPolicy(*policy2.Get(kPolicyClashing1)); expected.GetMutable(kPolicyClashing1) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.GetMutable(kPolicyClashing1) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr); expected.Set(kPolicy1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc index 0377307..e05e75f8 100644 --- a/components/policy/core/common/policy_loader_win_unittest.cc +++ b/components/policy/core/common/policy_loader_win_unittest.cc
@@ -457,7 +457,7 @@ nullptr); expected.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) .GetMutable(test_keys::kKeyString) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); PolicyMap::Entry conflict(POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_PLATFORM, @@ -517,9 +517,9 @@ expected_policy.Set( "a", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(kMachineMandatory), nullptr); - expected_policy.GetMutable("a")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); - expected_policy.GetMutable("a")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); - expected_policy.GetMutable("a")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected_policy.GetMutable("a")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected_policy.GetMutable("a")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected_policy.GetMutable("a")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); PolicyMap::Entry a_conflict_1( POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM, @@ -537,8 +537,8 @@ expected_policy.Set("b", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(kUserMandatory), nullptr); - expected_policy.GetMutable("b")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); - expected_policy.GetMutable("b")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected_policy.GetMutable("b")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected_policy.GetMutable("b")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); PolicyMap::Entry b_conflict_1( POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM, @@ -553,7 +553,7 @@ POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(kMachineRecommended), nullptr); - expected_policy.GetMutable("c")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected_policy.GetMutable("c")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); PolicyMap::Entry c_conflict_1( POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, POLICY_SOURCE_PLATFORM,
diff --git a/components/policy/core/common/policy_map.cc b/components/policy/core/common/policy_map.cc index 1b0d35c..119c0c7 100644 --- a/components/policy/core/common/policy_map.cc +++ b/components/policy/core/common/policy_map.cc
@@ -15,6 +15,27 @@ #include "components/strings/grit/components_strings.h" namespace policy { + +namespace { + +const base::string16 GetLocalizedString( + PolicyMap::Entry::L10nLookupFunction lookup, + const base::string16& initial_string, + const std::set<int>& localized_string_ids) { + base::string16 result = initial_string; + base::string16 line_feed = base::UTF8ToUTF16("\n"); + for (int id : localized_string_ids) { + result += lookup.Run(id); + result += line_feed; + } + // Remove the trailing newline. + if (!result.empty() && result[result.length() - 1] == line_feed[0]) + result.pop_back(); + return result; +} + +} // namespace + PolicyMap::Entry::Entry() = default; PolicyMap::Entry::Entry( PolicyLevel level, @@ -42,6 +63,7 @@ copy.value = value->CreateDeepCopy(); copy.error_strings_ = error_strings_; copy.error_message_ids_ = error_message_ids_; + copy.warning_message_ids_ = warning_message_ids_; if (external_data_fetcher) { copy.external_data_fetcher.reset( new ExternalDataFetcher(*external_data_fetcher)); @@ -68,15 +90,18 @@ for (size_t i = 0; conflicts_are_equal && i < conflicts.size(); ++i) conflicts_are_equal &= conflicts[i].Equals(other.conflicts[i]); - return conflicts_are_equal && level == other.level && scope == other.scope && - source == other.source && // Necessary for PolicyUIHandler observers. - // They have to update when sources change. - error_strings_ == other.error_strings_ && - error_message_ids_ == other.error_message_ids_ && - ((!value && !other.value) || - (value && other.value && *value == *other.value)) && - ExternalDataFetcher::Equals(external_data_fetcher.get(), - other.external_data_fetcher.get()); + const bool equals = + conflicts_are_equal && level == other.level && scope == other.scope && + source == other.source && // Necessary for PolicyUIHandler observers. + // They have to update when sources change. + error_strings_ == other.error_strings_ && + error_message_ids_ == other.error_message_ids_ && + warning_message_ids_ == other.warning_message_ids_ && + ((!value && !other.value) || + (value && other.value && *value == *other.value)) && + ExternalDataFetcher::Equals(external_data_fetcher.get(), + other.external_data_fetcher.get()); + return equals; } void PolicyMap::Entry::AddError(base::StringPiece error) { @@ -87,6 +112,10 @@ error_message_ids_.insert(message_id); } +void PolicyMap::Entry::AddWarning(int message_id) { + warning_message_ids_.insert(message_id); +} + void PolicyMap::Entry::AddConflictingPolicy(const Entry& conflict) { Entry conflicted_policy_copy = conflict.DeepCopy(); @@ -97,6 +126,7 @@ // Avoid conflict nesting conflicted_policy_copy.conflicts.clear(); conflicted_policy_copy.error_message_ids_.clear(); + conflicted_policy_copy.warning_message_ids_.clear(); conflicted_policy_copy.error_strings_.clear(); conflicts.push_back(std::move(conflicted_policy_copy)); } @@ -109,16 +139,13 @@ base::string16 PolicyMap::Entry::GetLocalizedErrors( L10nLookupFunction lookup) const { - base::string16 error_string = base::UTF8ToUTF16(error_strings_); - base::string16 line_feed = base::UTF8ToUTF16("\n"); - for (int message_id : error_message_ids_) { - error_string += lookup.Run(message_id); - error_string += line_feed; - } - // Remove the trailing newline. - if (!error_string.empty()) - error_string.pop_back(); - return error_string; + return GetLocalizedString(lookup, base::UTF8ToUTF16(error_strings_), + error_message_ids_); +} + +base::string16 PolicyMap::Entry::GetLocalizedWarnings( + L10nLookupFunction lookup) const { + return GetLocalizedString(lookup, base::string16(), warning_message_ids_); } bool PolicyMap::Entry::IsBlockedOrIgnored() const { @@ -262,10 +289,11 @@ conflict.source == POLICY_SOURCE_ENTERPRISE_DEFAULT; if (!overwriting_default_policy) { new_policy.AddConflictingPolicy(conflict); - new_policy.AddError((current_policy->value && - it.second.value->Equals(current_policy->value.get())) - ? IDS_POLICY_CONFLICT_SAME_VALUE - : IDS_POLICY_CONFLICT_DIFF_VALUE); + new_policy.AddWarning( + (current_policy->value && + it.second.value->Equals(current_policy->value.get())) + ? IDS_POLICY_CONFLICT_SAME_VALUE + : IDS_POLICY_CONFLICT_DIFF_VALUE); } if (current_policy != &new_policy)
diff --git a/components/policy/core/common/policy_map.h b/components/policy/core/common/policy_map.h index 6ac0dcd..69195c5 100644 --- a/components/policy/core/common/policy_map.h +++ b/components/policy/core/common/policy_map.h
@@ -69,6 +69,9 @@ // Add a localized error given its l10n message ID. void AddError(int message_id); + // Add a localized error given its l10n message ID. + void AddWarning(int message_id); + // Adds a conflicting policy. void AddConflictingPolicy(const Entry& conflict); @@ -95,9 +98,14 @@ // separated with LF characters. base::string16 GetLocalizedErrors(L10nLookupFunction lookup) const; + // Returns localized warnings added through AddWarning(), as UTF-16, and + // separated with LF characters. + base::string16 GetLocalizedWarnings(L10nLookupFunction lookup) const; + private: std::string error_strings_; std::set<int> error_message_ids_; + std::set<int> warning_message_ids_; }; typedef std::map<std::string, Entry> PolicyMapType;
diff --git a/components/policy/core/common/policy_map_unittest.cc b/components/policy/core/common/policy_map_unittest.cc index d95bfc2..cbd9c7b 100644 --- a/components/policy/core/common/policy_map_unittest.cc +++ b/components/policy/core/common/policy_map_unittest.cc
@@ -263,31 +263,31 @@ c.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("chromium.org"), nullptr); - c.GetMutable(kTestPolicyName1)->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + c.GetMutable(kTestPolicyName1)->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); c.GetMutable(kTestPolicyName1)->AddConflictingPolicy(conflicted_policy_1); // |a| has precedence over |b|. c.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr); - c.GetMutable(kTestPolicyName2)->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + c.GetMutable(kTestPolicyName2)->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); c.GetMutable(kTestPolicyName2) ->AddConflictingPolicy(*b.Get(kTestPolicyName2)); c.Set(kTestPolicyName3, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_ENTERPRISE_DEFAULT, nullptr, CreateExternalDataFetcher("a")); - c.GetMutable(kTestPolicyName3)->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + c.GetMutable(kTestPolicyName3)->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); c.GetMutable(kTestPolicyName3) ->AddConflictingPolicy(*b.Get(kTestPolicyName3)); // POLICY_SCOPE_MACHINE over POLICY_SCOPE_USER for POLICY_LEVEL_RECOMMENDED. c.Set(kTestPolicyName4, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, POLICY_SOURCE_DEVICE_LOCAL_ACCOUNT_OVERRIDE, std::make_unique<base::Value>(true), nullptr); - c.GetMutable(kTestPolicyName4)->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + c.GetMutable(kTestPolicyName4)->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); c.GetMutable(kTestPolicyName4)->AddConflictingPolicy(conflicted_policy_4); // POLICY_LEVEL_MANDATORY over POLICY_LEVEL_RECOMMENDED. c.Set(kTestPolicyName5, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(std::string()), nullptr); - c.GetMutable(kTestPolicyName5)->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + c.GetMutable(kTestPolicyName5)->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); c.GetMutable(kTestPolicyName5)->AddConflictingPolicy(conflicted_policy_5); // Merge new ones. c.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, @@ -301,7 +301,7 @@ c.Set(kTestPolicyName8, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_ACTIVE_DIRECTORY, std::make_unique<base::Value>("blocked AD policy"), nullptr); - c.GetMutable(kTestPolicyName8)->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + c.GetMutable(kTestPolicyName8)->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); c.GetMutable(kTestPolicyName8)->AddConflictingPolicy(conflicted_policy_8); c.GetMutable(kTestPolicyName8)->SetBlocked();
diff --git a/components/policy/core/common/policy_service_impl_unittest.cc b/components/policy/core/common/policy_service_impl_unittest.cc index 13bd863..a427cb35 100644 --- a/components/policy/core/common/policy_service_impl_unittest.cc +++ b/components/policy/core/common/policy_service_impl_unittest.cc
@@ -363,8 +363,8 @@ std::make_unique<base::Value>(13), nullptr); expected.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr); - expected.GetMutable("aaa")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); - expected.GetMutable("aaa")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected.GetMutable("aaa")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected.GetMutable("aaa")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); policy0_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr); policy1_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, @@ -382,7 +382,7 @@ expected.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr); - expected.GetMutable("aaa")->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + expected.GetMutable("aaa")->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); policy0_.Erase("aaa"); provider0_.UpdateChromePolicy(policy0_); expected.GetMutable("aaa")->AddConflictingPolicy(*policy2_.Get("aaa")); @@ -391,7 +391,7 @@ expected.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(2), nullptr); - expected.GetMutable("aaa")->AddError(IDS_POLICY_CONFLICT_SAME_VALUE); + expected.GetMutable("aaa")->AddWarning(IDS_POLICY_CONFLICT_SAME_VALUE); policy1_.Set("aaa", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr); expected.GetMutable("aaa")->AddConflictingPolicy(*policy2_.Get("aaa")); @@ -543,9 +543,9 @@ POLICY_SOURCE_ENTERPRISE_DEFAULT, std::make_unique<base::Value>("bundle0"), nullptr); expected.GetMutable(kSameLevelPolicy) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.GetMutable(kSameLevelPolicy) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.GetMutable(kSameLevelPolicy) ->AddConflictingPolicy( *bundle1->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) @@ -560,7 +560,7 @@ POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>("bundle2"), nullptr); expected.GetMutable(kDiffLevelPolicy) - ->AddError(IDS_POLICY_CONFLICT_DIFF_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected.GetMutable(kDiffLevelPolicy) ->AddConflictingPolicy( *bundle0->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) @@ -785,6 +785,7 @@ POLICY_SOURCE_MERGED, std::move(result), nullptr); merged.AddConflictingPolicy(entry_dict_1.DeepCopy()); merged.AddConflictingPolicy(entry_dict_2.DeepCopy()); + merged.AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected_chrome.Set(key::kContentPackManualBehaviorURLs, std::move(merged)); provider0_.UpdatePolicy(std::move(policy_bundle1)); @@ -839,6 +840,7 @@ POLICY_SOURCE_MERGED, std::move(result), nullptr); merged.AddConflictingPolicy(entry_list_2.DeepCopy()); merged.AddConflictingPolicy(entry_list_1.DeepCopy()); + merged.AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected_chrome.Set(key::kExtensionInstallForcelist, std::move(merged)); provider0_.UpdatePolicy(std::move(policy_bundle1)); @@ -899,6 +901,7 @@ POLICY_SOURCE_MERGED, std::move(result), nullptr); merged.AddConflictingPolicy(entry_list_2.DeepCopy()); merged.AddConflictingPolicy(entry_list_1.DeepCopy()); + merged.AddWarning(IDS_POLICY_CONFLICT_DIFF_VALUE); expected_chrome.Set(key::kExtensionInstallForcelist, merged.DeepCopy()); expected_chrome.Set(key::kExtensionInstallBlacklist, std::move(merged)); entry_list_3.SetIgnoredByPolicyAtomicGroup();
diff --git a/components/policy/core/common/schema_map_unittest.cc b/components/policy/core/common/schema_map_unittest.cc index cc8a211..ee196422 100644 --- a/components/policy/core/common/schema_map_unittest.cc +++ b/components/policy/core/common/schema_map_unittest.cc
@@ -189,7 +189,7 @@ *expected_bundle.Get(chrome_ns).Get("ChromePolicy")); expected_bundle.Get(chrome_ns) .GetMutable("ChromePolicy") - ->AddError(IDS_POLICY_CONFLICT_SAME_VALUE); + ->AddWarning(IDS_POLICY_CONFLICT_SAME_VALUE); EXPECT_TRUE(bundle.Equals(expected_bundle)); // Mismatched types are also removed.
diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp index 32be4891..b7a819ba 100644 --- a/components/policy_strings.grdp +++ b/components/policy_strings.grdp
@@ -328,14 +328,14 @@ <message name="IDS_POLICY_LABEL_REFRESH_INTERVAL" desc="Label for the refresh interval in the policy status boxes."> Fetch interval: </message> - <message name="IDS_POLICY_LABEL_MESSAGES" desc="Label for the messages row in the policy table."> - Messages - </message> <message name="IDS_POLICY_LABEL_CONFLICT" desc="Label for the conflict row in the policy table."> Conflict </message> - <message name="IDS_POLICY_LABEL_WARNING_AND_CONFLICT" desc="Label for the conflict row in the policy table when there are warnings and conflicts."> - Warnings, Conflict + <message name="IDS_POLICY_LABEL_ERROR" desc="Label for the error row in the policy table."> + Error + </message> + <message name="IDS_POLICY_LABEL_IGNORED" desc="Label for the ignored row in the policy table."> + Ignored </message> <message name="IDS_POLICY_LABEL_VALUE" desc="Label for the value row in the policy table."> Value @@ -453,10 +453,10 @@ Warning: This policy was not merged as specified in PolicyDictionaryMultipleSourceMergeList policy because it is not part of the dictionary policies that can be merged. </message> <message name="IDS_POLICY_CONFLICT_SAME_VALUE" desc="Text explaining that a policy had conflicting sources, but with the same values."> - Warning: More than one source is present for the policy, but the values are the same. + More than one source is present for the policy, but the values are the same. </message> <message name="IDS_POLICY_CONFLICT_DIFF_VALUE" desc="Text explaining that a policy had conflicting sources and values."> - Warning: More than one source with conflicting values is present for this policy! + More than one source with conflicting values is present for this policy! </message> <message name="IDS_POLICY_MIGRATED_OLD_POLICY" desc="Text explaining that a policy is deprecated, and that admins should use the new policy instead"> This policy is deprecated. You should use the <ph name="NEW_POLICY">$1<ex>AllowDinosaurEasterEgg</ex></ph> policy instead.
diff --git a/components/signin/core/browser/account_tracker_service.cc b/components/signin/core/browser/account_tracker_service.cc index 0988ac0..202a291 100644 --- a/components/signin/core/browser/account_tracker_service.cc +++ b/components/signin/core/browser/account_tracker_service.cc
@@ -153,7 +153,7 @@ } AccountInfo AccountTrackerService::GetAccountInfo( - const std::string& account_id) const { + const CoreAccountId& account_id) const { const auto iterator = accounts_.find(account_id); if (iterator != accounts_.end()) return iterator->second; @@ -214,7 +214,7 @@ } void AccountTrackerService::NotifyAccountUpdateFailed( - const std::string& account_id) { + const CoreAccountId& account_id) { for (auto& observer : observer_list_) observer.OnAccountUpdateFailed(account_id); } @@ -227,17 +227,18 @@ } void AccountTrackerService::StartTrackingAccount( - const std::string& account_id) { + const CoreAccountId& account_id) { if (!base::ContainsKey(accounts_, account_id)) { DVLOG(1) << "StartTracking " << account_id; AccountInfo account_info; account_info.account_id = account_id; account_info.is_child_account = false; - accounts_.insert(make_pair(account_id, account_info)); + accounts_.insert(std::make_pair(account_id, account_info)); } } -void AccountTrackerService::StopTrackingAccount(const std::string& account_id) { +void AccountTrackerService::StopTrackingAccount( + const CoreAccountId& account_id) { DVLOG(1) << "StopTracking " << account_id; if (base::ContainsKey(accounts_, account_id)) { AccountInfo account_info = std::move(accounts_[account_id]); @@ -251,7 +252,7 @@ } void AccountTrackerService::SetAccountInfoFromUserInfo( - const std::string& account_id, + const CoreAccountId& account_id, const base::DictionaryValue* user_info) { DCHECK(base::ContainsKey(accounts_, account_id)); AccountInfo& account_info = accounts_[account_id]; @@ -274,7 +275,7 @@ SaveToPrefs(account_info); } -void AccountTrackerService::SetAccountImage(const std::string& account_id, +void AccountTrackerService::SetAccountImage(const CoreAccountId& account_id, const gfx::Image& image) { if (!base::ContainsKey(accounts_, account_id)) return; @@ -284,7 +285,7 @@ NotifyAccountUpdated(account_info); } -void AccountTrackerService::SetIsChildAccount(const std::string& account_id, +void AccountTrackerService::SetIsChildAccount(const CoreAccountId& account_id, bool is_child_account) { DCHECK(base::ContainsKey(accounts_, account_id)); AccountInfo& account_info = accounts_[account_id]; @@ -297,7 +298,7 @@ } void AccountTrackerService::SetIsAdvancedProtectionAccount( - const std::string& account_id, + const CoreAccountId& account_id, bool is_under_advanced_protection) { DCHECK(base::ContainsKey(accounts_, account_id)); AccountInfo& account_info = accounts_[account_id]; @@ -312,10 +313,10 @@ void AccountTrackerService::MigrateToGaiaId() { DCHECK_EQ(GetMigrationState(), MIGRATION_IN_PROGRESS); - std::vector<std::string> to_remove; + std::vector<CoreAccountId> to_remove; std::vector<AccountInfo> migrated_accounts; for (const auto& pair : accounts_) { - const std::string& new_account_id = pair.second.gaia; + const CoreAccountId new_account_id(pair.second.gaia); if (pair.first == new_account_id) continue; @@ -337,7 +338,7 @@ for (AccountInfo& new_account_info : migrated_accounts) { // Copy the AccountInfo |gaia| member field so that it is not left in // an undeterminate state in the structure after std::map::emplace call. - std::string account_id = new_account_info.gaia; + CoreAccountId account_id = new_account_info.account_id; SaveToPrefs(new_account_info); accounts_.emplace(std::move(account_id), std::move(new_account_info)); @@ -398,14 +399,15 @@ } base::FilePath AccountTrackerService::GetImagePathFor( - const std::string& account_id) { + const CoreAccountId& account_id) { return user_data_dir_.Append(kAccountsFolder) .Append(kAvatarImagesFolder) - .AppendASCII(account_id); + .AppendASCII(account_id.id); } -void AccountTrackerService::OnAccountImageLoaded(const std::string& account_id, - gfx::Image image) { +void AccountTrackerService::OnAccountImageLoaded( + const CoreAccountId& account_id, + gfx::Image image) { if (base::ContainsKey(accounts_, account_id) && accounts_[account_id].account_image.IsEmpty()) { AccountInfo& account_info = accounts_[account_id]; @@ -418,7 +420,7 @@ if (!image_storage_task_runner_) return; for (const auto& pair : accounts_) { - const std::string& account_id = pair.second.account_id; + const CoreAccountId& account_id = pair.second.account_id; PostTaskAndReplyWithResult( image_storage_task_runner_.get(), FROM_HERE, base::BindOnce(&ReadImage, GetImagePathFor(account_id)), @@ -428,7 +430,7 @@ } void AccountTrackerService::SaveAccountImageToDisk( - const std::string& account_id, + const CoreAccountId& account_id, const gfx::Image& image) { if (!image_storage_task_runner_) return; @@ -438,7 +440,7 @@ } void AccountTrackerService::RemoveAccountImageFromDisk( - const std::string& account_id) { + const CoreAccountId& account_id) { if (!image_storage_task_runner_) return; image_storage_task_runner_->PostTask( @@ -447,38 +449,37 @@ void AccountTrackerService::LoadFromPrefs() { const base::ListValue* list = pref_service_->GetList(prefs::kAccountInfo); - std::set<std::string> to_remove; + std::set<CoreAccountId> to_remove; for (size_t i = 0; i < list->GetSize(); ++i) { const base::DictionaryValue* dict; if (list->GetDictionary(i, &dict)) { - base::string16 value; + std::string value; if (dict->GetString(kAccountKeyPath, &value)) { - std::string account_id = base::UTF16ToUTF8(value); - // Ignore incorrectly persisted non-canonical account ids. - if (account_id.find('@') != std::string::npos && - account_id != gaia::CanonicalizeEmail(account_id)) { - to_remove.insert(account_id); + if (value.find('@') != std::string::npos && + value != gaia::CanonicalizeEmail(value)) { + to_remove.insert(CoreAccountId(value)); continue; } + CoreAccountId account_id(value); StartTrackingAccount(account_id); AccountInfo& account_info = accounts_[account_id]; if (dict->GetString(kAccountGaiaPath, &value)) - account_info.gaia = base::UTF16ToUTF8(value); + account_info.gaia = value; if (dict->GetString(kAccountEmailPath, &value)) - account_info.email = base::UTF16ToUTF8(value); + account_info.email = value; if (dict->GetString(kAccountHostedDomainPath, &value)) - account_info.hosted_domain = base::UTF16ToUTF8(value); + account_info.hosted_domain = value; if (dict->GetString(kAccountFullNamePath, &value)) - account_info.full_name = base::UTF16ToUTF8(value); + account_info.full_name = value; if (dict->GetString(kAccountGivenNamePath, &value)) - account_info.given_name = base::UTF16ToUTF8(value); + account_info.given_name = value; if (dict->GetString(kAccountLocalePath, &value)) - account_info.locale = base::UTF16ToUTF8(value); + account_info.locale = value; if (dict->GetString(kAccountPictureURLPath, &value)) - account_info.picture_url = base::UTF16ToUTF8(value); + account_info.picture_url = value; bool is_child_account = false; if (dict->GetBoolean(kAccountChildAccountStatusPath, &is_child_account)) @@ -584,14 +585,14 @@ } } -std::string AccountTrackerService::PickAccountIdForAccount( +CoreAccountId AccountTrackerService::PickAccountIdForAccount( const std::string& gaia, const std::string& email) const { return PickAccountIdForAccount(pref_service_, gaia, email); } // static -std::string AccountTrackerService::PickAccountIdForAccount( +CoreAccountId AccountTrackerService::PickAccountIdForAccount( const PrefService* pref_service, const std::string& gaia, const std::string& email) { @@ -602,24 +603,24 @@ case MIGRATION_NOT_STARTED: // Some tests don't use a real email address. To support these cases, // don't try to canonicalize these strings. - return (email.find('@') == std::string::npos) - ? email - : gaia::CanonicalizeEmail(email); + return CoreAccountId(email.find('@') == std::string::npos + ? email + : gaia::CanonicalizeEmail(email)); case MIGRATION_IN_PROGRESS: case MIGRATION_DONE: - return gaia; + return CoreAccountId(gaia); default: NOTREACHED(); - return email; + return CoreAccountId(email); } } -std::string AccountTrackerService::SeedAccountInfo(const std::string& gaia, - const std::string& email) { +CoreAccountId AccountTrackerService::SeedAccountInfo(const std::string& gaia, + const std::string& email) { AccountInfo account_info; account_info.gaia = gaia; account_info.email = email; - std::string account_id = SeedAccountInfo(account_info); + CoreAccountId account_id = SeedAccountInfo(account_info); DVLOG(1) << "AccountTrackerService::SeedAccountInfo" << " account_id=" << account_id << " gaia_id=" << gaia @@ -628,7 +629,7 @@ return account_id; } -std::string AccountTrackerService::SeedAccountInfo(AccountInfo info) { +CoreAccountId AccountTrackerService::SeedAccountInfo(AccountInfo info) { info.account_id = PickAccountIdForAccount(info.gaia, info.email); const bool already_exists = base::ContainsKey(accounts_, info.account_id); @@ -647,7 +648,7 @@ return info.account_id; } -void AccountTrackerService::RemoveAccount(const std::string& account_id) { +void AccountTrackerService::RemoveAccount(const CoreAccountId& account_id) { StopTrackingAccount(account_id); }
diff --git a/components/signin/core/browser/account_tracker_service.h b/components/signin/core/browser/account_tracker_service.h index cb61e2e4..30591e6 100644 --- a/components/signin/core/browser/account_tracker_service.h +++ b/components/signin/core/browser/account_tracker_service.h
@@ -19,6 +19,7 @@ #include "build/build_config.h" #include "components/keyed_service/core/keyed_service.h" #include "components/signin/core/browser/account_info.h" +#include "google_apis/gaia/core_account_id.h" #include "google_apis/gaia/gaia_auth_util.h" #include "ui/gfx/image/image.h" @@ -55,7 +56,7 @@ public: virtual ~Observer() {} virtual void OnAccountUpdated(const AccountInfo& info) {} - virtual void OnAccountUpdateFailed(const std::string& account_id) {} + virtual void OnAccountUpdateFailed(const CoreAccountId& account_id) {} virtual void OnAccountRemoved(const AccountInfo& info) {} }; @@ -89,37 +90,38 @@ // Returns the list of known accounts and for which gaia IDs // have been fetched. std::vector<AccountInfo> GetAccounts() const; - AccountInfo GetAccountInfo(const std::string& account_id) const; + AccountInfo GetAccountInfo(const CoreAccountId& account_id) const; AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id) const; AccountInfo FindAccountInfoByEmail(const std::string& email) const; // Picks the correct account_id for the specified account depending on the // migration state. - std::string PickAccountIdForAccount(const std::string& gaia, - const std::string& email) const; - static std::string PickAccountIdForAccount(const PrefService* pref_service, - const std::string& gaia, - const std::string& email); + CoreAccountId PickAccountIdForAccount(const std::string& gaia, + const std::string& email) const; + static CoreAccountId PickAccountIdForAccount(const PrefService* pref_service, + const std::string& gaia, + const std::string& email); // Seeds the account whose account_id is given by PickAccountIdForAccount() // with its corresponding gaia id and email address. Returns the same // value PickAccountIdForAccount() when given the same arguments. - std::string SeedAccountInfo(const std::string& gaia, - const std::string& email); + CoreAccountId SeedAccountInfo(const std::string& gaia, + const std::string& email); // Seeds the account represented by |info|. If the account is already tracked // and compatible, the empty fields will be updated with values from |info|. // If after the update IsValid() is true, OnAccountUpdated will be fired. - std::string SeedAccountInfo(AccountInfo info); + CoreAccountId SeedAccountInfo(AccountInfo info); // Sets whether the account is a Unicorn account. - void SetIsChildAccount(const std::string& account_id, bool is_child_account); + void SetIsChildAccount(const CoreAccountId& account_id, + bool is_child_account); // Sets whether the account is under advanced protection. - void SetIsAdvancedProtectionAccount(const std::string& account_id, + void SetIsAdvancedProtectionAccount(const CoreAccountId& account_id, bool is_under_advanced_protection); - void RemoveAccount(const std::string& account_id); + void RemoveAccount(const CoreAccountId& account_id); // Is migration of the account id from normalized email to gaia id supported // on the current platform? @@ -135,12 +137,13 @@ protected: // Available to be called in tests. - void SetAccountInfoFromUserInfo(const std::string& account_id, + void SetAccountInfoFromUserInfo(const CoreAccountId& account_id, const base::DictionaryValue* user_info); // Updates the account image. Does nothing if |account_id| does not exist in // |accounts_|. - void SetAccountImage(const std::string& account_id, const gfx::Image& image); + void SetAccountImage(const CoreAccountId& account_id, + const gfx::Image& image); private: friend class AccountFetcherService; @@ -156,11 +159,11 @@ const std::string&); void NotifyAccountUpdated(const AccountInfo& account_info); - void NotifyAccountUpdateFailed(const std::string& account_id); - void NotifyAccountRemoved(const AccountInfo& accoint_info); + void NotifyAccountUpdateFailed(const CoreAccountId& account_id); + void NotifyAccountRemoved(const AccountInfo& account_info); - void StartTrackingAccount(const std::string& account_id); - void StopTrackingAccount(const std::string& account_id); + void StartTrackingAccount(const CoreAccountId& account_id); + void StopTrackingAccount(const CoreAccountId& account_id); // Load the current state of the account info from the preferences file. void LoadFromPrefs(); @@ -168,12 +171,12 @@ void RemoveFromPrefs(const AccountInfo& account); // Used to load/save account images from/to disc. - base::FilePath GetImagePathFor(const std::string& account_id); - void OnAccountImageLoaded(const std::string& account_id, gfx::Image image); + base::FilePath GetImagePathFor(const CoreAccountId& account_id); + void OnAccountImageLoaded(const CoreAccountId& account_id, gfx::Image image); void LoadAccountImagesFromDisk(); - void SaveAccountImageToDisk(const std::string& account_id, + void SaveAccountImageToDisk(const CoreAccountId& account_id, const gfx::Image& image); - void RemoveAccountImageFromDisk(const std::string& account_id); + void RemoveAccountImageFromDisk(const CoreAccountId& account_id); // Migrate accounts to be keyed by gaia id instead of normalized email. // Requires that the migration state is set to MIGRATION_IN_PROGRESS. @@ -196,7 +199,7 @@ const PrefService* pref_service); PrefService* pref_service_ = nullptr; // Not owned. - std::map<std::string, AccountInfo> accounts_; + std::map<CoreAccountId, AccountInfo> accounts_; base::ObserverList<Observer>::Unchecked observer_list_; base::FilePath user_data_dir_;
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc index ca788f5..f5e18df 100644 --- a/components/viz/host/host_display_client.cc +++ b/components/viz/host/host_display_client.cc
@@ -59,4 +59,10 @@ } #endif +#if defined(USE_X11) +void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) { + NOTIMPLEMENTED(); +} +#endif + } // namespace viz
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h index af64385..5e5c5da4 100644 --- a/components/viz/host/host_display_client.h +++ b/components/viz/host/host_display_client.h
@@ -42,6 +42,10 @@ mojom::LayeredWindowUpdaterRequest request) override; #endif +#if defined(USE_X11) + void DidCompleteSwapWithNewSize(const gfx::Size& size) override; +#endif + mojo::Binding<mojom::DisplayClient> binding_; #if defined(OS_MACOSX) || defined(OS_WIN) gfx::AcceleratedWidget widget_;
diff --git a/components/viz/service/display/ca_layer_overlay.cc b/components/viz/service/display/ca_layer_overlay.cc index 48268ba0..7958757d 100644 --- a/components/viz/service/display/ca_layer_overlay.cc +++ b/components/viz/service/display/ca_layer_overlay.cc
@@ -53,6 +53,7 @@ CA_LAYER_FAILED_RENDER_PASS_FILTER_OPERATION, CA_LAYER_FAILED_RENDER_PASS_SORTING_CONTEXT_ID, CA_LAYER_FAILED_TOO_MANY_RENDER_PASS_DRAW_QUADS, + CA_LAYER_FAILED_QUAD_ROUNDED_CORNER, CA_LAYER_FAILED_COUNT, }; @@ -192,6 +193,12 @@ return CA_LAYER_SUCCESS; } + // TODO(enne): we could probably handle set rounded corner info on + // the CALayer in the case that rounded corner rect aligns with the quad. + if (!quad->shared_quad_state->rounded_corner_bounds.IsEmpty()) { + return CA_LAYER_FAILED_QUAD_ROUNDED_CORNER; + } + // Enable edge anti-aliasing only on layer boundaries. ca_layer_overlay->edge_aa_mask = 0; if (quad->IsLeftEdge())
diff --git a/components/viz/service/display/software_output_device.cc b/components/viz/service/display/software_output_device.cc index 6508266d..90b65bc 100644 --- a/components/viz/service/display/software_output_device.cc +++ b/components/viz/service/display/software_output_device.cc
@@ -4,6 +4,7 @@ #include "components/viz/service/display/software_output_device.h" +#include "base/bind.h" #include "base/logging.h" #include "base/threading/sequenced_task_runner_handle.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -49,8 +50,10 @@ return vsync_provider_.get(); } -void SoftwareOutputDevice::OnSwapBuffers(base::OnceClosure swap_ack_callback) { - task_runner_->PostTask(FROM_HERE, std::move(swap_ack_callback)); +void SoftwareOutputDevice::OnSwapBuffers( + SwapBuffersCallback swap_ack_callback) { + task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(swap_ack_callback), + viewport_pixel_size_)); } } // namespace viz
diff --git a/components/viz/service/display/software_output_device.h b/components/viz/service/display/software_output_device.h index ac80d971..f7ad234 100644 --- a/components/viz/service/display/software_output_device.h +++ b/components/viz/service/display/software_output_device.h
@@ -66,11 +66,12 @@ // hardware vsync. Return null if a provider doesn't exist. virtual gfx::VSyncProvider* GetVSyncProvider(); + using SwapBuffersCallback = base::OnceCallback<void(const gfx::Size&)>; // Called from OutputSurface::SwapBuffers(). The default implementation will // immediately run |swap_ack_callback| via PostTask. If swap isn't synchronous // this can be overriden so that |swap_ack_callback| is run after swap // completes. - virtual void OnSwapBuffers(base::OnceClosure swap_ack_callback); + virtual void OnSwapBuffers(SwapBuffersCallback swap_ack_callback); protected: scoped_refptr<base::SequencedTaskRunner> task_runner_;
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc index 0fcded1..4e3f0255 100644 --- a/components/viz/service/display_embedder/software_output_device_win.cc +++ b/components/viz/service/display_embedder/software_output_device_win.cc
@@ -183,7 +183,7 @@ ~SoftwareOutputDeviceWinProxy() override = default; // SoftwareOutputDevice implementation. - void OnSwapBuffers(base::OnceClosure swap_ack_callback) override; + void OnSwapBuffers(SwapBuffersCallback swap_ack_callback) override; // SoftwareOutputDeviceWinBase implementation. void ResizeDelegated() override; @@ -212,16 +212,19 @@ } void SoftwareOutputDeviceWinProxy::OnSwapBuffers( - base::OnceClosure swap_ack_callback) { + SwapBuffersCallback swap_ack_callback) { DCHECK(swap_ack_callback_.is_null()); // We aren't waiting on DrawAck() and can immediately run the callback. if (!waiting_on_draw_ack_) { - task_runner_->PostTask(FROM_HERE, std::move(swap_ack_callback)); + task_runner_->PostTask( + FROM_HERE, + base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_)); return; } - swap_ack_callback_ = std::move(swap_ack_callback); + swap_ack_callback_ = + base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_); } void SoftwareOutputDeviceWinProxy::ResizeDelegated() {
diff --git a/components/viz/service/display_embedder/software_output_surface.cc b/components/viz/service/display_embedder/software_output_surface.cc index c6d272b..45ab3cf 100644 --- a/components/viz/service/display_embedder/software_output_surface.cc +++ b/components/viz/service/display_embedder/software_output_surface.cc
@@ -112,7 +112,7 @@ return 0; } -void SoftwareOutputSurface::SwapBuffersCallback() { +void SoftwareOutputSurface::SwapBuffersCallback(const gfx::Size& pixel_size) { latency_tracker_.OnGpuSwapBuffersCompleted(stored_latency_info_); client_->DidFinishLatencyInfo(stored_latency_info_); std::vector<ui::LatencyInfo>().swap(stored_latency_info_); @@ -121,7 +121,10 @@ base::TimeTicks now = base::TimeTicks::Now(); base::TimeDelta interval_to_next_refresh = now.SnappedToNextTick(refresh_timebase_, refresh_interval_) - now; - +#if defined(USE_X11) + if (needs_swap_size_notifications_) + client_->DidSwapWithSize(pixel_size); +#endif client_->DidReceivePresentationFeedback( gfx::PresentationFeedback(now, interval_to_next_refresh, 0u)); } @@ -147,4 +150,11 @@ return gfx::OVERLAY_TRANSFORM_NONE; } +#if defined(USE_X11) +void SoftwareOutputSurface::SetNeedsSwapSizeNotifications( + bool needs_swap_size_notifications) { + needs_swap_size_notifications_ = needs_swap_size_notifications; +} +#endif + } // namespace viz
diff --git a/components/viz/service/display_embedder/software_output_surface.h b/components/viz/service/display_embedder/software_output_surface.h index 5436eba..8699803 100644 --- a/components/viz/service/display_embedder/software_output_surface.h +++ b/components/viz/service/display_embedder/software_output_surface.h
@@ -48,9 +48,13 @@ UpdateVSyncParametersCallback callback) override; void SetDisplayTransformHint(gfx::OverlayTransform transform) override {} gfx::OverlayTransform GetDisplayTransform() override; +#if defined(USE_X11) + void SetNeedsSwapSizeNotifications( + bool needs_swap_size_notifications) override; +#endif private: - void SwapBuffersCallback(); + void SwapBuffersCallback(const gfx::Size& pixel_size); void UpdateVSyncParameters(base::TimeTicks timebase, base::TimeDelta interval); @@ -63,6 +67,10 @@ std::vector<ui::LatencyInfo> stored_latency_info_; ui::LatencyTracker latency_tracker_; +#if defined(USE_X11) + bool needs_swap_size_notifications_ = false; +#endif + base::WeakPtrFactory<SoftwareOutputSurface> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(SoftwareOutputSurface);
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc index a594b5c..d76296e 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -49,6 +49,12 @@ output_surface->SetNeedsSwapSizeNotifications( params->send_swap_size_notifications); +#if defined(USE_X11) + // For X11, we need notify client about swap completion after resizing, so the + // client can use it for synchronize with X11 WM. + output_surface->SetNeedsSwapSizeNotifications(true); +#endif + // Create some sort of a BeginFrameSource, depending on the platform and // |params|. std::unique_ptr<ExternalBeginFrameSource> external_begin_frame_source; @@ -348,6 +354,11 @@ #if defined(OS_ANDROID) if (display_client_) display_client_->DidCompleteSwapWithSize(pixel_size); +#elif defined(USE_X11) + if (display_client_ && pixel_size != last_swap_pixel_size_) { + last_swap_pixel_size_ = pixel_size; + display_client_->DidCompleteSwapWithNewSize(last_swap_pixel_size_); + } #else NOTREACHED(); ALLOW_UNUSED_LOCAL(display_client_);
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h index b649b25..455b60d64 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h
@@ -132,6 +132,10 @@ // to the BFS. std::unique_ptr<Display> display_; +#if defined(USE_X11) + gfx::Size last_swap_pixel_size_; +#endif + DISALLOW_COPY_AND_ASSIGN(RootCompositorFrameSinkImpl); };
diff --git a/components/viz/test/fake_display_client.cc b/components/viz/test/fake_display_client.cc index 9f41365..55a1ae0 100644 --- a/components/viz/test/fake_display_client.cc +++ b/components/viz/test/fake_display_client.cc
@@ -25,4 +25,8 @@ mojom::LayeredWindowUpdaterRequest request) {} #endif +#if defined(USE_X11) +void FakeDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {} +#endif + } // namespace viz
diff --git a/components/viz/test/fake_display_client.h b/components/viz/test/fake_display_client.h index c9b55eb..73f9d511 100644 --- a/components/viz/test/fake_display_client.h +++ b/components/viz/test/fake_display_client.h
@@ -31,6 +31,10 @@ mojom::LayeredWindowUpdaterRequest request) override; #endif +#if defined(USE_X11) + void DidCompleteSwapWithNewSize(const gfx::Size& size) override; +#endif + private: mojo::Binding<mojom::DisplayClient> binding_;
diff --git a/components/viz/test/fake_output_surface.cc b/components/viz/test/fake_output_surface.cc index 18b9d5be..6362f551 100644 --- a/components/viz/test/fake_output_surface.cc +++ b/components/viz/test/fake_output_surface.cc
@@ -112,4 +112,9 @@ return gfx::OVERLAY_TRANSFORM_NONE; } +#if defined(USE_X11) +void FakeOutputSurface::SetNeedsSwapSizeNotifications( + bool needs_swap_size_notifications) {} +#endif + } // namespace viz
diff --git a/components/viz/test/fake_output_surface.h b/components/viz/test/fake_output_surface.h index 6d2a86e..f629e35 100644 --- a/components/viz/test/fake_output_surface.h +++ b/components/viz/test/fake_output_surface.h
@@ -79,6 +79,10 @@ UpdateVSyncParametersCallback callback) override; void SetDisplayTransformHint(gfx::OverlayTransform transform) override {} gfx::OverlayTransform GetDisplayTransform() override; +#if defined(USE_X11) + void SetNeedsSwapSizeNotifications( + bool needs_swap_size_notifications) override; +#endif void set_framebuffer(GLint framebuffer, GLenum format) { framebuffer_ = framebuffer;
diff --git a/components/viz/test/mock_display_client.h b/components/viz/test/mock_display_client.h index cd691c0..f43156e2 100644 --- a/components/viz/test/mock_display_client.h +++ b/components/viz/test/mock_display_client.h
@@ -34,6 +34,9 @@ void(gpu::ContextResult)); MOCK_METHOD1(SetPreferredRefreshRate, void(float refresh_rate)); #endif +#if defined(USE_X11) + MOCK_METHOD1(DidCompleteSwapWithNewSize, void(const gfx::Size&)); +#endif private: mojo::Binding<mojom::DisplayClient> binding_;
diff --git a/content/browser/background_sync/background_sync_browsertest.cc b/content/browser/background_sync/background_sync_browsertest.cc index abc17ed..cb7cf276 100644 --- a/content/browser/background_sync/background_sync_browsertest.cc +++ b/content/browser/background_sync/background_sync_browsertest.cc
@@ -100,7 +100,7 @@ ASSERT_EQ(blink::ServiceWorkerStatusCode::kOk, status); int64_t service_worker_id = registration->id(); BackgroundSyncManager* sync_manager = sync_context->background_sync_manager(); - sync_manager->GetRegistrations( + sync_manager->GetOneShotSyncRegistrations( service_worker_id, base::BindOnce(&RegistrationPendingDidGetSyncRegistration, tag, std::move(callback))); @@ -514,7 +514,7 @@ EXPECT_TRUE(GetTags(registered_tags)); } -// Verify that GetRegistrations works in a service worker +// Verify that GetOneShotSyncRegistrations works in a service worker IN_PROC_BROWSER_TEST_F(BackgroundSyncBrowserTest, GetRegistrationsFromServiceWorker) { EXPECT_TRUE(RegisterServiceWorker()); @@ -535,7 +535,7 @@ EXPECT_TRUE(GetTagsFromServiceWorker(registered_tags)); } -// Verify that GetRegistration works in a service worker +// Verify that GetOneShotSyncRegistration works in a service worker IN_PROC_BROWSER_TEST_F(BackgroundSyncBrowserTest, HasTagFromServiceWorker) { EXPECT_TRUE(RegisterServiceWorker()); EXPECT_TRUE(LoadTestPage(kDefaultTestURL)); // Control the page.
diff --git a/content/browser/background_sync/background_sync_manager.cc b/content/browser/background_sync/background_sync_manager.cc index e57d69a..964f0b0 100644 --- a/content/browser/background_sync/background_sync_manager.cc +++ b/content/browser/background_sync/background_sync_manager.cc
@@ -222,8 +222,8 @@ BackgroundSyncType GetBackgroundSyncType( const blink::mojom::SyncRegistrationOptions& options) { - return options.min_interval >= 0 ? BackgroundSyncType::PERIODIC - : BackgroundSyncType::ONE_SHOT; + return options.min_interval == -1 ? BackgroundSyncType::ONE_SHOT + : BackgroundSyncType::PERIODIC; } std::string GetEventStatusString(blink::ServiceWorkerStatusCode status_code) { @@ -364,7 +364,22 @@ std::move(registration_info))); } +void BackgroundSyncManager::GetOneShotSyncRegistrations( + int64_t sw_registration_id, + StatusAndRegistrationsCallback callback) { + GetRegistrations(BackgroundSyncType::ONE_SHOT, sw_registration_id, + std::move(callback)); +} + +void BackgroundSyncManager::GetPeriodicSyncRegistrations( + int64_t sw_registration_id, + StatusAndRegistrationsCallback callback) { + GetRegistrations(BackgroundSyncType::PERIODIC, sw_registration_id, + std::move(callback)); +} + void BackgroundSyncManager::GetRegistrations( + BackgroundSyncType sync_type, int64_t sw_registration_id, StatusAndRegistrationsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -381,7 +396,8 @@ op_scheduler_.ScheduleOperation( CacheStorageSchedulerOp::kBackgroundSync, base::BindOnce(&BackgroundSyncManager::GetRegistrationsImpl, - weak_ptr_factory_.GetWeakPtr(), sw_registration_id, + weak_ptr_factory_.GetWeakPtr(), sync_type, + sw_registration_id, op_scheduler_.WrapCallbackToRunNext(std::move(callback)))); } @@ -1146,6 +1162,7 @@ } void BackgroundSyncManager::GetRegistrationsImpl( + BackgroundSyncType sync_type, int64_t sw_registration_id, StatusAndRegistrationsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -1167,6 +1184,8 @@ for (const auto& key_and_registration : registrations.registration_map) { const BackgroundSyncRegistration& registration = key_and_registration.second; + if (registration.sync_type() != sync_type) + continue; out_registrations.push_back( std::make_unique<BackgroundSyncRegistration>(registration)); }
diff --git a/content/browser/background_sync/background_sync_manager.h b/content/browser/background_sync/background_sync_manager.h index b436489a..6d743ad 100644 --- a/content/browser/background_sync/background_sync_manager.h +++ b/content/browser/background_sync/background_sync_manager.h
@@ -96,11 +96,17 @@ void DidResolveRegistration( blink::mojom::BackgroundSyncRegistrationInfoPtr registration_info); - // Finds the background sync registrations associated with + // Finds the one-shot Background Sync registrations associated with // |sw_registration_id|. Calls |callback| with BACKGROUND_SYNC_STATUS_OK on // success. - void GetRegistrations(int64_t sw_registration_id, - StatusAndRegistrationsCallback callback); + void GetOneShotSyncRegistrations(int64_t sw_registration_id, + StatusAndRegistrationsCallback callback); + + // Finds the periodic Background Sync registrations associated with + // |sw_registration_id|. Calls |callback| with BACKGROUND_SYNC_STATUS_OK on + // success. + void GetPeriodicSyncRegistrations(int64_t sw_registration_id, + StatusAndRegistrationsCallback callback); // ServiceWorkerContextCoreObserver overrides. void OnRegistrationDeleted(int64_t sw_registration_id, @@ -234,6 +240,10 @@ const std::vector<std::pair<int64_t, std::string>>& user_data, blink::ServiceWorkerStatusCode status); + void GetRegistrations(blink::mojom::BackgroundSyncType sync_type, + int64_t sw_registration_id, + StatusAndRegistrationsCallback callback); + // Register callbacks void RegisterCheckIfHasMainFrame( int64_t sw_registration_id, @@ -273,7 +283,8 @@ std::unique_ptr<BackgroundSyncEventKeepAlive> keepalive); // GetRegistrations callbacks - void GetRegistrationsImpl(int64_t sw_registration_id, + void GetRegistrationsImpl(blink::mojom::BackgroundSyncType sync_type, + int64_t sw_registration_id, StatusAndRegistrationsCallback callback); bool AreOptionConditionsMet();
diff --git a/content/browser/background_sync/background_sync_manager_unittest.cc b/content/browser/background_sync/background_sync_manager_unittest.cc index d7f9989..efbc151 100644 --- a/content/browser/background_sync/background_sync_manager_unittest.cc +++ b/content/browser/background_sync/background_sync_manager_unittest.cc
@@ -18,6 +18,7 @@ #include "base/metrics/field_trial.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" +#include "base/stl_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/mock_entropy_provider.h" #include "base/test/simple_test_clock.h" @@ -86,8 +87,9 @@ blink::mojom::BackgroundSyncType GetBackgroundSyncType( const blink::mojom::SyncRegistrationOptions& options) { - return options.min_interval >= 0 ? blink::mojom::BackgroundSyncType::PERIODIC - : blink::mojom::BackgroundSyncType::ONE_SHOT; + return options.min_interval == -1 + ? blink::mojom::BackgroundSyncType::ONE_SHOT + : blink::mojom::BackgroundSyncType::PERIODIC; } } // namespace @@ -196,22 +198,40 @@ } } - void StatusAndRegistrationCallback( + void StatusAndOneShotSyncRegistrationCallback( bool* was_called, BackgroundSyncStatus status, std::unique_ptr<BackgroundSyncRegistration> registration) { *was_called = true; - callback_status_ = status; - callback_registration_ = std::move(registration); + one_shot_sync_callback_status_ = status; + callback_one_shot_sync_registration_ = std::move(registration); } - void StatusAndRegistrationsCallback( + void StatusAndPeriodicSyncRegistrationCallback( + bool* was_called, + BackgroundSyncStatus status, + std::unique_ptr<BackgroundSyncRegistration> registration) { + *was_called = true; + periodic_sync_callback_status_ = status; + callback_periodic_sync_registration_ = std::move(registration); + } + + void StatusAndOneShotSyncRegistrationsCallback( bool* was_called, BackgroundSyncStatus status, std::vector<std::unique_ptr<BackgroundSyncRegistration>> registrations) { *was_called = true; - callback_status_ = status; - callback_registrations_ = std::move(registrations); + one_shot_sync_callback_status_ = status; + callback_one_shot_sync_registrations_ = std::move(registrations); + } + + void StatusAndPeriodicSyncRegistrationsCallback( + bool* was_called, + BackgroundSyncStatus status, + std::vector<std::unique_ptr<BackgroundSyncRegistration>> registrations) { + *was_called = true; + periodic_sync_callback_status_ = status; + callback_periodic_sync_registrations_ = std::move(registrations); } void StatusCallback(bool* was_called, BackgroundSyncStatus status) { @@ -288,24 +308,37 @@ int64_t sw_registration_id, blink::mojom::SyncRegistrationOptions options) { bool was_called = false; - background_sync_manager_->Register( - sw_registration_id, std::move(options), - base::BindOnce( - &BackgroundSyncManagerTest::StatusAndRegistrationCallback, - base::Unretained(this), &was_called)); + BackgroundSyncStatus* callback_status; + if (GetBackgroundSyncType(options) == + blink::mojom::BackgroundSyncType::ONE_SHOT) { + background_sync_manager_->Register( + sw_registration_id, std::move(options), + base::BindOnce(&BackgroundSyncManagerTest:: + StatusAndOneShotSyncRegistrationCallback, + base::Unretained(this), &was_called)); + callback_status = &one_shot_sync_callback_status_; + } else { + background_sync_manager_->Register( + sw_registration_id, std::move(options), + base::BindOnce(&BackgroundSyncManagerTest:: + StatusAndPeriodicSyncRegistrationCallback, + base::Unretained(this), &was_called)); + callback_status = &periodic_sync_callback_status_; + } + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(was_called); // Mock the client receiving the response and calling // DidResolveRegistration. - if (callback_status_ == BACKGROUND_SYNC_STATUS_OK) { + if (*callback_status == BACKGROUND_SYNC_STATUS_OK) { background_sync_manager_->DidResolveRegistration( blink::mojom::BackgroundSyncRegistrationInfo::New( sw_registration_id, options.tag, GetBackgroundSyncType(options))); base::RunLoop().RunUntilIdle(); } - return callback_status_ == BACKGROUND_SYNC_STATUS_OK; + return *callback_status == BACKGROUND_SYNC_STATUS_OK; } bool UnregisterWithServiceWorkerId( @@ -335,30 +368,40 @@ bool GetRegistration( blink::mojom::SyncRegistrationOptions registration_options) { - return GetRegistrationWithServiceWorkerId(sw_registration_id_1_, - std::move(registration_options)); + if (GetBackgroundSyncType(registration_options) == + blink::mojom::BackgroundSyncType::ONE_SHOT) { + return GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_1_, std::move(registration_options)); + } + return GetPeriodicSyncRegistrationWithServiceWorkerId( + sw_registration_id_1_, std::move(registration_options)); } - bool GetRegistrationWithServiceWorkerId( + bool GetOneShotSyncRegistrationWithServiceWorkerId( int64_t sw_registration_id, blink::mojom::SyncRegistrationOptions registration_options) { bool was_called = false; - background_sync_manager_->GetRegistrations( + + background_sync_manager_->GetOneShotSyncRegistrations( sw_registration_id, - base::BindOnce( - &BackgroundSyncManagerTest::StatusAndRegistrationsCallback, - base::Unretained(this), &was_called)); + base::BindOnce(&BackgroundSyncManagerTest:: + StatusAndOneShotSyncRegistrationsCallback, + base::Unretained(this), &was_called)); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(was_called); - if (callback_status_ == BACKGROUND_SYNC_STATUS_OK) { - for (auto iter = callback_registrations_.begin(); - iter < callback_registrations_.end(); ++iter) { - if ((*iter)->options()->Equals(registration_options)) { + if (one_shot_sync_callback_status_ == BACKGROUND_SYNC_STATUS_OK) { + for (auto& one_shot_sync_registration : + callback_one_shot_sync_registrations_) { + if (one_shot_sync_registration->options()->Equals( + registration_options)) { // Transfer the matching registration out of the vector into - // callback_registration_ for testing. - callback_registration_ = std::move(*iter); - callback_registrations_.erase(iter); + // |callback_one_shot_sync_registration_| for testing. + callback_one_shot_sync_registration_ = + std::move(one_shot_sync_registration); + base::Erase(callback_one_shot_sync_registrations_, + one_shot_sync_registration); return true; } } @@ -366,21 +409,62 @@ return false; } - bool GetRegistrations() { - return GetRegistrationsWithServiceWorkerId(sw_registration_id_1_); - } - - bool GetRegistrationsWithServiceWorkerId(int64_t sw_registration_id) { + bool GetPeriodicSyncRegistrationWithServiceWorkerId( + int64_t sw_registration_id, + blink::mojom::SyncRegistrationOptions registration_options) { bool was_called = false; - background_sync_manager_->GetRegistrations( + + background_sync_manager_->GetPeriodicSyncRegistrations( sw_registration_id, - base::BindOnce( - &BackgroundSyncManagerTest::StatusAndRegistrationsCallback, - base::Unretained(this), &was_called)); + base::BindOnce(&BackgroundSyncManagerTest:: + StatusAndPeriodicSyncRegistrationsCallback, + base::Unretained(this), &was_called)); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(was_called); - return callback_status_ == BACKGROUND_SYNC_STATUS_OK; + if (periodic_sync_callback_status_ == BACKGROUND_SYNC_STATUS_OK) { + for (auto& periodic_sync_registration : + callback_periodic_sync_registrations_) { + if (periodic_sync_registration->options()->Equals( + registration_options)) { + // Transfer the matching registration out of the vector into + // |callback_periodic_sync_registration_| for testing. + callback_periodic_sync_registration_ = + std::move(periodic_sync_registration); + base::Erase(callback_periodic_sync_registrations_, + periodic_sync_registration); + return true; + } + } + } + return false; + } + + bool GetOneShotSyncRegistrations() { + bool was_called = false; + background_sync_manager_->GetOneShotSyncRegistrations( + sw_registration_id_1_, + base::BindOnce(&BackgroundSyncManagerTest:: + StatusAndOneShotSyncRegistrationsCallback, + base::Unretained(this), &was_called)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(was_called); + + return one_shot_sync_callback_status_ == BACKGROUND_SYNC_STATUS_OK; + } + + bool GetPeriodicSyncRegistrations() { + bool was_called = false; + background_sync_manager_->GetPeriodicSyncRegistrations( + sw_registration_id_1_, + base::BindOnce(&BackgroundSyncManagerTest:: + StatusAndPeriodicSyncRegistrationsCallback, + base::Unretained(this), &was_called)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(was_called); + + return periodic_sync_callback_status_ == BACKGROUND_SYNC_STATUS_OK; } MockBackgroundSyncController* GetController() { @@ -518,10 +602,19 @@ blink::mojom::SyncRegistrationOptions sync_options_2_; // Callback values. + BackgroundSyncStatus one_shot_sync_callback_status_ = + BACKGROUND_SYNC_STATUS_OK; + BackgroundSyncStatus periodic_sync_callback_status_ = + BACKGROUND_SYNC_STATUS_OK; BackgroundSyncStatus callback_status_ = BACKGROUND_SYNC_STATUS_OK; - std::unique_ptr<BackgroundSyncRegistration> callback_registration_; + std::unique_ptr<BackgroundSyncRegistration> + callback_one_shot_sync_registration_; + std::unique_ptr<BackgroundSyncRegistration> + callback_periodic_sync_registration_; std::vector<std::unique_ptr<BackgroundSyncRegistration>> - callback_registrations_; + callback_one_shot_sync_registrations_; + std::vector<std::unique_ptr<BackgroundSyncRegistration>> + callback_periodic_sync_registrations_; blink::ServiceWorkerStatusCode callback_sw_status_code_ = blink::ServiceWorkerStatusCode::kOk; int sync_events_called_ = 0; @@ -592,8 +685,9 @@ bool was_called = false; background_sync_manager_->Register( sw_registration_id_1_, sync_options_1_, - base::BindOnce(&BackgroundSyncManagerTest::StatusAndRegistrationCallback, - base::Unretained(this), &was_called)); + base::BindOnce( + &BackgroundSyncManagerTest::StatusAndOneShotSyncRegistrationCallback, + base::Unretained(this), &was_called)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(was_called); @@ -614,8 +708,9 @@ bool was_called = false; background_sync_manager_->Register( sw_registration_id_1_, sync_options_1_, - base::BindOnce(&BackgroundSyncManagerTest::StatusAndRegistrationCallback, - base::Unretained(this), &was_called)); + base::BindOnce( + &BackgroundSyncManagerTest::StatusAndOneShotSyncRegistrationCallback, + base::Unretained(this), &was_called)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(was_called); @@ -634,8 +729,12 @@ TEST_F(BackgroundSyncManagerTest, RegistrationIntact) { EXPECT_TRUE(Register(sync_options_1_)); - EXPECT_STREQ(sync_options_1_.tag.c_str(), - callback_registration_->options()->tag.c_str()); + EXPECT_EQ(sync_options_1_.tag, + callback_one_shot_sync_registration_->options()->tag); + sync_options_2_.min_interval = 3600; + EXPECT_TRUE(Register(sync_options_2_)); + EXPECT_EQ(sync_options_2_.tag, + callback_periodic_sync_registration_->options()->tag); } TEST_F(BackgroundSyncManagerTest, RegisterWithoutLiveSWRegistration) { @@ -655,13 +754,15 @@ sw_registration_1_ = nullptr; EXPECT_FALSE(Register(sync_options_1_)); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_NO_SERVICE_WORKER, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_NO_SERVICE_WORKER, + one_shot_sync_callback_status_); } TEST_F(BackgroundSyncManagerTest, RegisterWithoutActiveSWRegistration) { sw_registration_1_->UnsetVersion(sw_registration_1_->active_version()); EXPECT_FALSE(Register(sync_options_1_)); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_NO_SERVICE_WORKER, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_NO_SERVICE_WORKER, + one_shot_sync_callback_status_); } TEST_F(BackgroundSyncManagerTest, RegisterBadBackend) { @@ -738,38 +839,55 @@ } TEST_F(BackgroundSyncManagerTest, GetRegistrationsZero) { - EXPECT_TRUE(GetRegistrations()); - EXPECT_EQ(0u, callback_registrations_.size()); + EXPECT_TRUE(GetOneShotSyncRegistrations()); + EXPECT_EQ(0u, callback_one_shot_sync_registrations_.size()); } TEST_F(BackgroundSyncManagerTest, GetRegistrationsOne) { EXPECT_TRUE(Register(sync_options_1_)); - EXPECT_TRUE(GetRegistrations()); + EXPECT_TRUE(GetOneShotSyncRegistrations()); - EXPECT_EQ(1u, callback_registrations_.size()); - sync_options_1_.Equals(*callback_registrations_[0]->options()); + ASSERT_EQ(1u, callback_one_shot_sync_registrations_.size()); + sync_options_1_.Equals(*callback_one_shot_sync_registrations_[0]->options()); + + sync_options_1_.min_interval = 3600; + EXPECT_TRUE(Register(sync_options_1_)); + EXPECT_TRUE(GetPeriodicSyncRegistrations()); + + ASSERT_EQ(1u, callback_periodic_sync_registrations_.size()); + sync_options_1_.Equals(*callback_periodic_sync_registrations_[0]->options()); } TEST_F(BackgroundSyncManagerTest, GetRegistrationsTwo) { EXPECT_TRUE(Register(sync_options_1_)); EXPECT_TRUE(Register(sync_options_2_)); - EXPECT_TRUE(GetRegistrations()); + EXPECT_TRUE(GetOneShotSyncRegistrations()); - EXPECT_EQ(2u, callback_registrations_.size()); - sync_options_1_.Equals(*callback_registrations_[0]->options()); - sync_options_2_.Equals(*callback_registrations_[1]->options()); + ASSERT_EQ(2u, callback_one_shot_sync_registrations_.size()); + sync_options_1_.Equals(*callback_one_shot_sync_registrations_[0]->options()); + sync_options_2_.Equals(*callback_one_shot_sync_registrations_[1]->options()); + + sync_options_1_.min_interval = 3600; + sync_options_2_.min_interval = 3600; + EXPECT_TRUE(Register(sync_options_1_)); + EXPECT_TRUE(Register(sync_options_2_)); + EXPECT_TRUE(GetPeriodicSyncRegistrations()); + + ASSERT_EQ(2u, callback_periodic_sync_registrations_.size()); + sync_options_1_.Equals(*callback_periodic_sync_registrations_[0]->options()); + sync_options_2_.Equals(*callback_periodic_sync_registrations_[1]->options()); } TEST_F(BackgroundSyncManagerTest, GetRegistrationsBadBackend) { EXPECT_TRUE(Register(sync_options_1_)); test_background_sync_manager_->set_corrupt_backend(true); - EXPECT_TRUE(GetRegistrations()); + EXPECT_TRUE(GetOneShotSyncRegistrations()); EXPECT_FALSE(Register(sync_options_2_)); // Registration should have discovered the bad backend and disabled the // BackgroundSyncManager. - EXPECT_FALSE(GetRegistrations()); + EXPECT_FALSE(GetOneShotSyncRegistrations()); test_background_sync_manager_->set_corrupt_backend(false); - EXPECT_FALSE(GetRegistrations()); + EXPECT_FALSE(GetOneShotSyncRegistrations()); } @@ -791,7 +909,7 @@ sync_options_2_.tag = std::string(MaxTagLength() + 1, 'b'); EXPECT_FALSE(Register(sync_options_2_)); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_NOT_ALLOWED, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_NOT_ALLOWED, one_shot_sync_callback_status_); } TEST_F(BackgroundSyncManagerTest, RebootRecovery) { @@ -811,19 +929,19 @@ SetupBackgroundSyncManager(); - EXPECT_TRUE(GetRegistrationWithServiceWorkerId(sw_registration_id_1_, - sync_options_1_)); - EXPECT_FALSE(GetRegistrationWithServiceWorkerId(sw_registration_id_1_, - sync_options_2_)); - EXPECT_FALSE(GetRegistrationWithServiceWorkerId(sw_registration_id_2_, - sync_options_1_)); - EXPECT_TRUE(GetRegistrationWithServiceWorkerId(sw_registration_id_2_, - sync_options_2_)); + EXPECT_TRUE(GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_1_, sync_options_1_)); + EXPECT_FALSE(GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_1_, sync_options_2_)); + EXPECT_FALSE(GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_2_, sync_options_1_)); + EXPECT_TRUE(GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_2_, sync_options_2_)); - EXPECT_TRUE(GetRegistrationWithServiceWorkerId(sw_registration_id_1_, - sync_options_1_)); - EXPECT_TRUE(GetRegistrationWithServiceWorkerId(sw_registration_id_2_, - sync_options_2_)); + EXPECT_TRUE(GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_1_, sync_options_1_)); + EXPECT_TRUE(GetOneShotSyncRegistrationWithServiceWorkerId( + sw_registration_id_2_, sync_options_2_)); EXPECT_TRUE( RegisterWithServiceWorkerId(sw_registration_id_1_, sync_options_2_)); @@ -847,12 +965,14 @@ bool get_registrations_called = false; test_background_sync_manager_->Register( sw_registration_id_1_, sync_options_1_, - base::BindOnce(&BackgroundSyncManagerTest::StatusAndRegistrationCallback, - base::Unretained(this), ®ister_called)); - test_background_sync_manager_->GetRegistrations( + base::BindOnce( + &BackgroundSyncManagerTest::StatusAndOneShotSyncRegistrationCallback, + base::Unretained(this), ®ister_called)); + test_background_sync_manager_->GetOneShotSyncRegistrations( sw_registration_id_1_, - base::BindOnce(&BackgroundSyncManagerTest::StatusAndRegistrationsCallback, - base::Unretained(this), &get_registrations_called)); + base::BindOnce( + &BackgroundSyncManagerTest::StatusAndOneShotSyncRegistrationsCallback, + base::Unretained(this), &get_registrations_called)); base::RunLoop().RunUntilIdle(); // Init should be blocked while loading from the backend. @@ -868,7 +988,7 @@ test_background_sync_manager_->ResumeBackendOperation(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(register_called); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_OK, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_OK, one_shot_sync_callback_status_); // GetRegistrations should run immediately as it doesn't write to disk. EXPECT_TRUE(get_registrations_called); } @@ -882,13 +1002,15 @@ TEST_F(BackgroundSyncManagerTest, UnregisterServiceWorkerDuringSyncRegistration) { EXPECT_TRUE(Register(sync_options_1_)); + sync_options_2_.min_interval = 3600; test_background_sync_manager_->set_delay_backend(true); bool callback_called = false; test_background_sync_manager_->Register( sw_registration_id_1_, sync_options_2_, - base::BindOnce(&BackgroundSyncManagerTest::StatusAndRegistrationCallback, - base::Unretained(this), &callback_called)); + base::BindOnce( + &BackgroundSyncManagerTest::StatusAndPeriodicSyncRegistrationCallback, + base::Unretained(this), &callback_called)); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(callback_called); @@ -897,7 +1019,8 @@ test_background_sync_manager_->ResumeBackendOperation(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(callback_called); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, + periodic_sync_callback_status_); test_background_sync_manager_->set_delay_backend(false); EXPECT_FALSE(GetRegistration(sync_options_1_)); @@ -966,21 +1089,23 @@ SetupBackgroundSyncManager(); EXPECT_TRUE(GetRegistration(options)); - EXPECT_TRUE(options.Equals(*callback_registration_->options())); + EXPECT_TRUE(options.Equals(*callback_one_shot_sync_registration_->options())); } TEST_F(BackgroundSyncManagerTest, EmptyTagSupported) { sync_options_1_.tag = ""; EXPECT_TRUE(Register(sync_options_1_)); EXPECT_TRUE(GetRegistration(sync_options_1_)); - EXPECT_TRUE(sync_options_1_.Equals(*callback_registration_->options())); + EXPECT_TRUE( + sync_options_1_.Equals(*callback_one_shot_sync_registration_->options())); } TEST_F(BackgroundSyncManagerTest, PeriodicSyncOptions) { sync_options_1_.min_interval = 2; EXPECT_TRUE(Register(sync_options_1_)); EXPECT_TRUE(GetRegistration(sync_options_1_)); - EXPECT_TRUE(sync_options_1_.Equals(*callback_registration_->options())); + EXPECT_TRUE( + sync_options_1_.Equals(*callback_periodic_sync_registration_->options())); } TEST_F(BackgroundSyncManagerTest, BothTypesOfSyncShareATag) { @@ -991,13 +1116,15 @@ EXPECT_TRUE(Register(sync_options_1_)); EXPECT_TRUE(GetRegistration(sync_options_1_)); - EXPECT_EQ(callback_registration_->options()->tag, "foo"); - EXPECT_TRUE(sync_options_1_.Equals(*callback_registration_->options())); + EXPECT_EQ(callback_one_shot_sync_registration_->options()->tag, "foo"); + EXPECT_TRUE( + sync_options_1_.Equals(*callback_one_shot_sync_registration_->options())); EXPECT_TRUE(Register(sync_options_2_)); EXPECT_TRUE(GetRegistration(sync_options_2_)); - EXPECT_TRUE(sync_options_2_.Equals(*callback_registration_->options())); - EXPECT_EQ(callback_registration_->options()->tag, "foo"); + EXPECT_TRUE( + sync_options_2_.Equals(*callback_periodic_sync_registration_->options())); + EXPECT_EQ(callback_periodic_sync_registration_->options()->tag, "foo"); } TEST_F(BackgroundSyncManagerTest, FiresOnRegistration) { @@ -1291,7 +1418,8 @@ // Check that the manager is disabled EXPECT_FALSE(Register(sync_options_1_)); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, + one_shot_sync_callback_status_); const BackgroundSyncParameters* manager_parameters = test_background_sync_manager_->background_sync_parameters(); @@ -1327,14 +1455,16 @@ // Check that the manager is disabled EXPECT_FALSE(Register(sync_options_1_)); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, + one_shot_sync_callback_status_); // If the service worker is wiped and the manager is restarted, the manager // should stay disabled. DeleteServiceWorkerAndStartOver(); RegisterServiceWorkers(); EXPECT_FALSE(Register(sync_options_1_)); - EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_); + EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, + one_shot_sync_callback_status_); } TEST_F(BackgroundSyncManagerTest, NotifyBackgroundSyncRegistered) {
diff --git a/content/browser/background_sync/background_sync_service_impl.cc b/content/browser/background_sync/background_sync_service_impl.cc index 24a6427..0808e03 100644 --- a/content/browser/background_sync/background_sync_service_impl.cc +++ b/content/browser/background_sync/background_sync_service_impl.cc
@@ -84,14 +84,14 @@ background_sync_manager->DidResolveRegistration(std::move(registration_info)); } -void BackgroundSyncServiceImpl::GetRegistrations( +void BackgroundSyncServiceImpl::GetOneShotSyncRegistrations( int64_t sw_registration_id, - GetRegistrationsCallback callback) { + GetOneShotSyncRegistrationsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BackgroundSyncManager* background_sync_manager = background_sync_context_->background_sync_manager(); DCHECK(background_sync_manager); - background_sync_manager->GetRegistrations( + background_sync_manager->GetOneShotSyncRegistrations( sw_registration_id, base::BindOnce(&BackgroundSyncServiceImpl::OnGetRegistrationsResult, weak_ptr_factory_.GetWeakPtr(), std::move(callback))); @@ -119,7 +119,7 @@ } void BackgroundSyncServiceImpl::OnGetRegistrationsResult( - GetRegistrationsCallback callback, + GetOneShotSyncRegistrationsCallback callback, BackgroundSyncStatus status, std::vector<std::unique_ptr<BackgroundSyncRegistration>> result_registrations) {
diff --git a/content/browser/background_sync/background_sync_service_impl.h b/content/browser/background_sync/background_sync_service_impl.h index 8c0f6f5..91cfefe 100644 --- a/content/browser/background_sync/background_sync_service_impl.h +++ b/content/browser/background_sync/background_sync_service_impl.h
@@ -40,14 +40,15 @@ RegisterCallback callback) override; void DidResolveRegistration(blink::mojom::BackgroundSyncRegistrationInfoPtr registration_info) override; - void GetRegistrations(int64_t sw_registration_id, - GetRegistrationsCallback callback) override; + void GetOneShotSyncRegistrations( + int64_t sw_registration_id, + GetOneShotSyncRegistrationsCallback callback) override; void OnRegisterResult(RegisterCallback callback, BackgroundSyncStatus status, std::unique_ptr<BackgroundSyncRegistration> result); void OnGetRegistrationsResult( - GetRegistrationsCallback callback, + GetOneShotSyncRegistrationsCallback callback, BackgroundSyncStatus status, std::vector<std::unique_ptr<BackgroundSyncRegistration>> result);
diff --git a/content/browser/background_sync/background_sync_service_impl_unittest.cc b/content/browser/background_sync/background_sync_service_impl_unittest.cc index 73254d2..45f6a28 100644 --- a/content/browser/background_sync/background_sync_service_impl_unittest.cc +++ b/content/browser/background_sync/background_sync_service_impl_unittest.cc
@@ -205,8 +205,10 @@ } void GetRegistrations( - blink::mojom::BackgroundSyncService::GetRegistrationsCallback callback) { - service_impl_->GetRegistrations(sw_registration_id_, std::move(callback)); + blink::mojom::BackgroundSyncService::GetOneShotSyncRegistrationsCallback + callback) { + service_impl_->GetOneShotSyncRegistrations(sw_registration_id_, + std::move(callback)); base::RunLoop().RunUntilIdle(); }
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 54c922b..7d51895 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -113,6 +113,35 @@ constexpr gpu::SchedulingPriority kStreamPriority = content::kGpuStreamPriorityUI; +#if defined(USE_X11) +class HostDisplayClient : public viz::HostDisplayClient { + public: + explicit HostDisplayClient(ui::Compositor* compositor) + : viz::HostDisplayClient(compositor->widget()), compositor_(compositor) {} + ~HostDisplayClient() override = default; + + // viz::HostDisplayClient: + void DidCompleteSwapWithNewSize(const gfx::Size& size) override { + compositor_->OnCompleteSwapWithNewSize(size); + } + + private: + ui::Compositor* const compositor_; + + DISALLOW_COPY_AND_ASSIGN(HostDisplayClient); +}; +#else +class HostDisplayClient : public viz::HostDisplayClient { + public: + explicit HostDisplayClient(ui::Compositor* compositor) + : viz::HostDisplayClient(compositor->widget()) {} + ~HostDisplayClient() override = default; + + private: + DISALLOW_COPY_AND_ASSIGN(HostDisplayClient); +}; +#endif + } // namespace namespace content { @@ -476,8 +505,7 @@ server_shared_bitmap_manager_, viz::CreateRendererSettings(), compositor->frame_sink_id(), std::move(display_output_surface), std::move(scheduler), compositor->task_runner()); - data->display_client = - std::make_unique<viz::HostDisplayClient>(compositor->widget()); + data->display_client = std::make_unique<HostDisplayClient>(compositor.get()); GetFrameSinkManager()->RegisterBeginFrameSource(begin_frame_source, compositor->frame_sink_id()); // Note that we are careful not to destroy prior BeginFrameSource objects
diff --git a/content/browser/compositor/software_browser_compositor_output_surface.cc b/content/browser/compositor/software_browser_compositor_output_surface.cc index 22412d9..d48e93f 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface.cc +++ b/content/browser/compositor/software_browser_compositor_output_surface.cc
@@ -85,9 +85,14 @@ } void SoftwareBrowserCompositorOutputSurface::SwapBuffersCallback( - const std::vector<ui::LatencyInfo>& latency_info) { + const std::vector<ui::LatencyInfo>& latency_info, + const gfx::Size& pixel_size) { latency_tracker_.OnGpuSwapBuffersCompleted(latency_info); client_->DidReceiveSwapBuffersAck(); +#if defined(USE_X11) + if (needs_swap_size_notifications_) + client_->DidSwapWithSize(pixel_size); +#endif client_->DidReceivePresentationFeedback( gfx::PresentationFeedback(base::TimeTicks::Now(), refresh_interval_, 0u)); } @@ -124,4 +129,11 @@ return 0; } +#if defined(USE_X11) +void SoftwareBrowserCompositorOutputSurface::SetNeedsSwapSizeNotifications( + bool needs_swap_size_notifications) { + needs_swap_size_notifications_ = needs_swap_size_notifications; +} +#endif + } // namespace content
diff --git a/content/browser/compositor/software_browser_compositor_output_surface.h b/content/browser/compositor/software_browser_compositor_output_surface.h index 012ba86..9a838454 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface.h +++ b/content/browser/compositor/software_browser_compositor_output_surface.h
@@ -39,15 +39,25 @@ gfx::BufferFormat GetOverlayBufferFormat() const override; uint32_t GetFramebufferCopyTextureFormat() override; unsigned UpdateGpuFence() override; +#if defined(USE_X11) + void SetNeedsSwapSizeNotifications( + bool needs_swap_size_notifications) override; +#endif private: - void SwapBuffersCallback(const std::vector<ui::LatencyInfo>& latency_info); + void SwapBuffersCallback(const std::vector<ui::LatencyInfo>& latency_info, + const gfx::Size& pixel_size); void UpdateVSyncCallback(const base::TimeTicks timebase, const base::TimeDelta interval); viz::OutputSurfaceClient* client_ = nullptr; base::TimeDelta refresh_interval_; ui::LatencyTracker latency_tracker_; + +#if defined(USE_X11) + bool needs_swap_size_notifications_ = false; +#endif + base::WeakPtrFactory<SoftwareBrowserCompositorOutputSurface> weak_factory_; DISALLOW_COPY_AND_ASSIGN(SoftwareBrowserCompositorOutputSurface);
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index 8666087..bfbc2ea 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc
@@ -956,6 +956,11 @@ return count; } +bool DownloadManagerImpl::CanDownload( + download::DownloadUrlParameters* parameters) { + return true; +} + void DownloadManagerImpl::DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> params) { DownloadUrl(std::move(params), nullptr /* blob_data_handle */,
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h index 180871f..19639281 100644 --- a/content/browser/download/download_manager_impl.h +++ b/content/browser/download/download_manager_impl.h
@@ -86,11 +86,11 @@ url_loader_factory_getter, const download::DownloadUrlParameters::OnStartedCallback& on_started) override; - int RemoveDownloadsByURLAndTime( const base::Callback<bool(const GURL&)>& url_filter, base::Time remove_begin, base::Time remove_end) override; + bool CanDownload(download::DownloadUrlParameters* parameters) override; void DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> parameters) override; void DownloadUrl(std::unique_ptr<download::DownloadUrlParameters> params,
diff --git a/content/browser/renderer_host/overscroll_configuration.cc b/content/browser/renderer_host/overscroll_configuration.cc index 4b81ecff..3a10d62 100644 --- a/content/browser/renderer_host/overscroll_configuration.cc +++ b/content/browser/renderer_host/overscroll_configuration.cc
@@ -16,12 +16,6 @@ content::OverscrollConfig::PullToRefreshMode g_ptr_mode = content::OverscrollConfig::PullToRefreshMode::kDisabled; -const float kThresholdCompleteTouchpad = 0.3f; -const float kThresholdCompleteTouchscreen = 0.25f; - -const float kThresholdStartTouchpad = 60.f; -const float kThresholdStartTouchscreen = 50.f; - bool g_is_touchpad_overscroll_history_navigation_enabled_initialized = false; bool g_touchpad_overscroll_history_navigation_enabled = false; @@ -29,27 +23,19 @@ // overscroll if it is not completed yet. int g_max_inertial_events_before_overscroll_cancellation_in_ms = 300; -float GetStartThresholdMultiplier() { - base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); - if (!cmd->HasSwitch(switches::kOverscrollStartThreshold)) - return 1.f; - - std::string string_value = - cmd->GetSwitchValueASCII(switches::kOverscrollStartThreshold); - int percentage; - if (base::StringToInt(string_value, &percentage) && percentage > 0) - return percentage / 100.f; - - DLOG(WARNING) << "Failed to parse switch " - << switches::kOverscrollStartThreshold << ": " << string_value; - return 1.f; -} - } // namespace namespace content { // static +const float OverscrollConfig::kCompleteTouchpadThresholdPercent = 0.3f; +const float OverscrollConfig::kCompleteTouchscreenThresholdPercent = 0.25f; + +// static +const float OverscrollConfig::kStartTouchpadThresholdDips = 60.f; +const float OverscrollConfig::kStartTouchscreenThresholdDips = 50.f; + +// static OverscrollConfig::PullToRefreshMode OverscrollConfig::GetPullToRefreshMode() { if (g_is_ptr_mode_initialized) return g_ptr_mode; @@ -66,30 +52,6 @@ } // static -float OverscrollConfig::GetThreshold(Threshold threshold) { - switch (threshold) { - case Threshold::kCompleteTouchpad: - return kThresholdCompleteTouchpad; - - case Threshold::kCompleteTouchscreen: - return kThresholdCompleteTouchscreen; - - case Threshold::kStartTouchpad: - static const float threshold_start_touchpad = - GetStartThresholdMultiplier() * kThresholdStartTouchpad; - return threshold_start_touchpad; - - case Threshold::kStartTouchscreen: - static const float threshold_start_touchscreen = - GetStartThresholdMultiplier() * kThresholdStartTouchscreen; - return threshold_start_touchscreen; - } - - NOTREACHED(); - return -1.f; -} - -// static void OverscrollConfig::SetPullToRefreshMode(PullToRefreshMode mode) { g_ptr_mode = mode; g_is_ptr_mode_initialized = true;
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc index f1e3ec1..74446dc 100644 --- a/content/browser/renderer_host/overscroll_controller.cc +++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -320,10 +320,10 @@ ? overscroll_delta_x_ : overscroll_delta_y_; const float ratio = fabs(delta) / std::max(size.width(), size.height()); - const float threshold = OverscrollConfig::GetThreshold( + const float threshold = overscroll_source_ == OverscrollSource::TOUCHPAD - ? OverscrollConfig::Threshold::kCompleteTouchpad - : OverscrollConfig::Threshold::kCompleteTouchscreen); + ? OverscrollConfig::kCompleteTouchpadThresholdPercent + : OverscrollConfig::kCompleteTouchscreenThresholdPercent; return ratio >= threshold; } @@ -458,9 +458,9 @@ overscroll_delta_x_ += delta_x; overscroll_delta_y_ += delta_y; - const float start_threshold = OverscrollConfig::GetThreshold( - is_touchpad ? OverscrollConfig::Threshold::kStartTouchpad - : OverscrollConfig::Threshold::kStartTouchscreen); + const float start_threshold = + is_touchpad ? OverscrollConfig::kStartTouchpadThresholdDips + : OverscrollConfig::kStartTouchscreenThresholdDips; if (fabs(overscroll_delta_x_) <= start_threshold && fabs(overscroll_delta_y_) <= start_threshold) { SetOverscrollMode(OVERSCROLL_NONE, OverscrollSource::NONE);
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 27099b4..c8374dc3 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -355,9 +355,20 @@ if (!features::IsSurfaceSynchronizationEnabled()) return; + bool is_transparent = metadata.has_transparent_background; + SkColor root_background_color = metadata.root_background_color; + if (!using_browser_compositor_) { // DevTools ScreenCast support for Android WebView. last_devtools_frame_metadata_.emplace(metadata); + // Android WebView ignores transparent background. + is_transparent = false; + // Android WebView always uses a black background while fullscreen. + // This inadvertently happened in the past (see https://crbug.com/961223#c5) + // but has been the behavior for long enough that it's become standard. + // This ensures the behaviour is robust. + if (host()->delegate()->IsFullscreenForCurrentTab()) + root_background_color = SK_ColorBLACK; } bool is_mobile_optimized = IsMobileOptimizedFrame( @@ -413,9 +424,8 @@ metadata.top_controls_shown_ratio, metadata.bottom_controls_height, metadata.bottom_controls_shown_ratio); - SetContentBackgroundColor(metadata.has_transparent_background - ? SK_ColorTRANSPARENT - : metadata.root_background_color); + SetContentBackgroundColor(is_transparent ? SK_ColorTRANSPARENT + : root_background_color); if (overscroll_controller_) { overscroll_controller_->OnFrameMetadataUpdated( @@ -2062,6 +2072,13 @@ const viz::LocalSurfaceIdAllocation& RenderWidgetHostViewAndroid::GetLocalSurfaceIdAllocation() const { + // Don't return an local surface ID for webview unless we're using + // SurfaceSynchronization. + if (!using_browser_compositor_ && + !features::IsSurfaceSynchronizationEnabled()) { + return viz::ParentLocalSurfaceIdAllocator:: + InvalidLocalSurfaceIdAllocation(); + } return local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation(); }
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 3765d844..566575e7 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2441,7 +2441,7 @@ } void RenderWidgetHostViewAura::OnDidNavigateMainFrameToNewPage() { - window_->env()->gesture_recognizer()->CancelActiveTouches(window_); + aura::Env::GetInstance()->gesture_recognizer()->CancelActiveTouches(window_); } const viz::FrameSinkId& RenderWidgetHostViewAura::GetFrameSinkId() const {
diff --git a/content/browser/site_per_process_hit_test_browsertest.cc b/content/browser/site_per_process_hit_test_browsertest.cc index f12b54d..84ceaef 100644 --- a/content/browser/site_per_process_hit_test_browsertest.cc +++ b/content/browser/site_per_process_hit_test_browsertest.cc
@@ -2238,8 +2238,8 @@ blink::WebInputEvent::kGestureScrollEnd); #if defined(USE_AURA) - const float overscroll_threshold = OverscrollConfig::GetThreshold( - OverscrollConfig::Threshold::kStartTouchscreen); + const float overscroll_threshold = + OverscrollConfig::kStartTouchscreenThresholdDips; #elif defined(OS_ANDROID) const float overscroll_threshold = 0.f; #endif
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.cc b/content/browser/web_contents/aura/gesture_nav_simple.cc index 2bbebeb..01fa885 100644 --- a/content/browser/web_contents/aura/gesture_nav_simple.cc +++ b/content/browser/web_contents/aura/gesture_nav_simple.cc
@@ -653,16 +653,16 @@ UmaNavigationType::NAVIGATION_TYPE_COUNT); const bool is_touchpad = source == OverscrollSource::TOUCHPAD; - const float start_threshold = OverscrollConfig::GetThreshold( - is_touchpad ? OverscrollConfig::Threshold::kStartTouchpad - : OverscrollConfig::Threshold::kStartTouchscreen); + const float start_threshold = + is_touchpad ? OverscrollConfig::kStartTouchpadThresholdDips + : OverscrollConfig::kStartTouchscreenThresholdDips; const gfx::Size size = GetDisplaySize(); const int max_size = std::max(size.width(), size.height()); completion_threshold_ = - max_size * OverscrollConfig::GetThreshold( - is_touchpad - ? OverscrollConfig::Threshold::kCompleteTouchpad - : OverscrollConfig::Threshold::kCompleteTouchscreen) - + max_size * + (is_touchpad + ? OverscrollConfig::kCompleteTouchpadThresholdPercent + : OverscrollConfig::kCompleteTouchscreenThresholdPercent) - start_threshold; DCHECK_LE(0, completion_threshold_);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 0acd4b2c..5ddd9e7 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5549,9 +5549,13 @@ std::vector<WebContents*> WebContentsImpl::GetInnerWebContents() { std::vector<WebContents*> all_inner_contents; if (browser_plugin_embedder_) { - GetBrowserContext()->GetGuestManager()->ForEachGuest( - this, - base::BindRepeating(&GetInnerWebContentsHelper, &all_inner_contents)); + BrowserPluginGuestManager* guest_manager = + GetBrowserContext()->GetGuestManager(); + if (guest_manager) { + guest_manager->ForEachGuest( + this, + base::BindRepeating(&GetInnerWebContentsHelper, &all_inner_contents)); + } } const auto& inner_contents = node_.GetInnerWebContents(); all_inner_contents.insert(all_inner_contents.end(), inner_contents.begin(),
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 6565781a..05915fa 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -849,9 +849,8 @@ void WebContentsViewAura::CreateAuraWindow(aura::Window* context) { DCHECK(aura::Env::HasInstance()); DCHECK(!window_); - window_ = std::make_unique<aura::Window>( - this, aura::client::WINDOW_TYPE_CONTROL, - context ? context->env() : aura::Env::GetInstance()); + window_ = + std::make_unique<aura::Window>(this, aura::client::WINDOW_TYPE_CONTROL); window_->set_owned_by_parent(false); window_->SetName("WebContentsViewAura"); window_->Init(ui::LAYER_NOT_DRAWN);
diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc index 3e4cdcb9..2d5a518 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc
@@ -342,8 +342,7 @@ gesture_scroll_update.data.scroll_update.delta_units = blink::WebScrollGranularity::kScrollByPrecisePixel; gesture_scroll_update.data.scroll_update.delta_y = 0.f; - float start_threshold = OverscrollConfig::GetThreshold( - OverscrollConfig::Threshold::kStartTouchscreen); + float start_threshold = OverscrollConfig::kStartTouchscreenThresholdDips; gesture_scroll_update.data.scroll_update.delta_x = start_threshold + 1; GetRenderWidgetHost()->ForwardGestureEvent(gesture_scroll_update);
diff --git a/content/browser/webauth/authenticator_common.cc b/content/browser/webauth/authenticator_common.cc index 21eca3df..60a0dec 100644 --- a/content/browser/webauth/authenticator_common.cc +++ b/content/browser/webauth/authenticator_common.cc
@@ -1304,7 +1304,7 @@ break; case AuthenticatorRequestClientDelegate::InterestingFailureReason:: kKeyNotRegistered: - status = blink::mojom::AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED; + status = blink::mojom::AuthenticatorStatus::NOT_ALLOWED_ERROR; break; case AuthenticatorRequestClientDelegate::InterestingFailureReason::kTimeout: status = blink::mojom::AuthenticatorStatus::NOT_ALLOWED_ERROR;
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc index 8d292a1..dc973fc 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -728,7 +728,7 @@ SCOPED_TRACE(std::string(test_case.origin) + " " + std::string(test_case.claimed_authority)); - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, TryAuthenticationWithAppId(test_case.origin, test_case.claimed_authority)); } @@ -1055,7 +1055,7 @@ if (should_be_valid) { EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); } else { - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); } } @@ -1140,7 +1140,7 @@ // The virtual device will return an error because // |reject_silent_authentication_requests| is true and then it'll // immediately resolve the touch request. - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); } } @@ -1365,7 +1365,7 @@ authenticator->GetAssertion(GetTestPublicKeyCredentialRequestOptions(), callback_receiver.callback()); callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); // The user must have pressed the authenticator for the operation to // resolve. @@ -2476,8 +2476,7 @@ callback_receiver.callback()); callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); ASSERT_TRUE(failure_reason_receiver.was_called()); EXPECT_EQ(content::AuthenticatorRequestClientDelegate:: @@ -2633,9 +2632,8 @@ base::RunLoop().RunUntilIdle(); callback_receiver.WaitForCallback(); EXPECT_EQ(callback_receiver.status(), - has_allowed_credential - ? AuthenticatorStatus::SUCCESS - : AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED); + has_allowed_credential ? AuthenticatorStatus::SUCCESS + : AuthenticatorStatus::NOT_ALLOWED_ERROR); } } @@ -3054,7 +3052,7 @@ switch (expected[support_level][uv_level]) { case kFailure: - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); break; @@ -3241,7 +3239,7 @@ callback_receiver.WaitForCallback(); if (should_be_unrecognized) { - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); } else { EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status());
diff --git a/content/browser/webauth/webauth_browsertest.cc b/content/browser/webauth/webauth_browsertest.cc index 138f417d..3e147cfc 100644 --- a/content/browser/webauth/webauth_browsertest.cc +++ b/content/browser/webauth/webauth_browsertest.cc
@@ -75,7 +75,7 @@ "webauth: NotSupportedError: Required parameters missing in " "`options.publicKey`."; -constexpr char kTimeoutErrorMessage[] = +constexpr char kNotAllowedErrorMessage[] = "webauth: NotAllowedError: The operation either timed out or was not " "allowed. See: https://w3c.github.io/webauthn/#sec-assertion-privacy."; @@ -93,10 +93,6 @@ constexpr char kRelyingPartyRpIconUrlSecurityErrorMessage[] = "webauth: SecurityError: 'rp.icon' should be a secure URL"; -constexpr char kInvalidStateError[] = - "webauth: InvalidStateError: The user attempted to use an authenticator " - "that recognized none of the provided credentials."; - constexpr char kAbortErrorMessage[] = "webauth: AbortError: The user aborted a request."; @@ -814,7 +810,7 @@ ASSERT_TRUE(content::ExecuteScriptAndExtractString( shell()->web_contents()->GetMainFrame(), BuildCreateCallWithParameters(parameters), &result)); - ASSERT_EQ(kTimeoutErrorMessage, result); + ASSERT_EQ(kNotAllowedErrorMessage, result); } } @@ -852,7 +848,7 @@ shell()->web_contents()->GetMainFrame(), BuildCreateCallWithParameters(parameters), &result)); - ASSERT_EQ(kTimeoutErrorMessage, result); + ASSERT_EQ(kNotAllowedErrorMessage, result); } } @@ -871,7 +867,7 @@ shell()->web_contents()->GetMainFrame(), BuildCreateCallWithParameters(parameters), &result)); - ASSERT_EQ(kTimeoutErrorMessage, result); + ASSERT_EQ(kNotAllowedErrorMessage, result); } } // Tests that when navigator.credentials.create() is called with abort @@ -949,7 +945,7 @@ ASSERT_TRUE(content::ExecuteScriptAndExtractString( shell()->web_contents()->GetMainFrame(), BuildGetCallWithParameters(parameters), &result)); - ASSERT_EQ(kInvalidStateError, result); + ASSERT_EQ(kNotAllowedErrorMessage, result); } } @@ -968,7 +964,7 @@ } // Tests that when navigator.credentials.get() is called with abort -// signal's aborted flag not set, we get a kInvalidStateError, because the +// signal's aborted flag not set, we get a NOT_ALLOWED_ERROR, because the // virtual device does not have any registered credentials. IN_PROC_BROWSER_TEST_F(WebAuthJavascriptClientBrowserTest, GetPublicKeyCredentialWithAbortNotSet) { @@ -986,7 +982,7 @@ ASSERT_TRUE(content::ExecuteScriptAndExtractString( shell()->web_contents()->GetMainFrame(), script, &result)); - ASSERT_EQ(kInvalidStateError, result); + ASSERT_EQ(kNotAllowedErrorMessage, result); } } @@ -1206,7 +1202,7 @@ shell()->web_contents(), BuildCreateCallWithParameters(CreateParameters()), "webauth: "); ASSERT_TRUE(result); - ASSERT_EQ(kTimeoutErrorMessage, *result); + ASSERT_EQ(kNotAllowedErrorMessage, *result); } IN_PROC_BROWSER_TEST_F(WebAuthJavascriptClientBrowserTest, WinGetAssertion) { @@ -1228,7 +1224,7 @@ shell()->web_contents(), BuildGetCallWithParameters(GetParameters()), "webauth: "); ASSERT_TRUE(result); - ASSERT_EQ(kTimeoutErrorMessage, *result); + ASSERT_EQ(kNotAllowedErrorMessage, *result); } IN_PROC_BROWSER_TEST_F(WebAuthJavascriptClientBrowserTest, @@ -1244,7 +1240,7 @@ shell()->web_contents(), BuildGetCallWithParameters(GetParameters()), "webauth: "); ASSERT_TRUE(result); - ASSERT_EQ(kTimeoutErrorMessage, *result); + ASSERT_EQ(kNotAllowedErrorMessage, *result); } #endif @@ -1331,7 +1327,7 @@ authenticator()->GetAssertion(std::move(get_assertion_request_params), get_callback_receiver.callback()); get_callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED, + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, get_callback_receiver.status()); } }
diff --git a/content/public/browser/overscroll_configuration.h b/content/public/browser/overscroll_configuration.h index eff3297..c4262178 100644 --- a/content/public/browser/overscroll_configuration.h +++ b/content/public/browser/overscroll_configuration.h
@@ -25,27 +25,15 @@ kEnabledTouchschreen, }; - // Specifies an overscroll controller threshold. - enum class Threshold { - // Threshold to complete touchpad overscroll, in terms of the percentage of - // the display size. - kCompleteTouchpad, + // These are percentages of the display size. + static const float kCompleteTouchpadThresholdPercent; + static const float kCompleteTouchscreenThresholdPercent; - // Threshold to complete touchscreen overscroll, in terms of the percentage - // of the display size. - kCompleteTouchscreen, - - // Threshold to start touchpad overscroll, in DIPs. - kStartTouchpad, - - // Threshold to start touchscreen overscroll, in DIPs. - kStartTouchscreen, - }; + static const float kStartTouchpadThresholdDips; + static const float kStartTouchscreenThresholdDips; static PullToRefreshMode GetPullToRefreshMode(); - static float GetThreshold(Threshold threshold); - static bool TouchpadOverscrollHistoryNavigationEnabled(); static base::TimeDelta MaxInertialEventsBeforeOverscrollCancellation();
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 350b107..fb1f4ad 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -605,12 +605,6 @@ const char kOverridePluginPowerSaverForTesting[] = "override-plugin-power-saver-for-testing"; -// Controls the value of the threshold to start horizontal overscroll relative -// to the default value. -// E.g. set the value to '133' to have the overscroll start threshold be 133% -// of the default threshold. -const char kOverscrollStartThreshold[] = "overscroll-start-threshold"; - // Override the default value for the 'passive' field in javascript // addEventListener calls. Values are defined as: // 'documentonlytrue' to set the default be true only for document level nodes.
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 9f85d19..040a8ae 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -184,7 +184,6 @@ CONTENT_EXPORT extern const char kDisableAppContainer[]; CONTENT_EXPORT extern const char kNumRasterThreads[]; CONTENT_EXPORT extern const char kOverridePluginPowerSaverForTesting[]; -CONTENT_EXPORT extern const char kOverscrollStartThreshold[]; CONTENT_EXPORT extern const char kPassiveListenersDefault[]; CONTENT_EXPORT extern const char kPpapiBrokerProcess[]; CONTENT_EXPORT extern const char kPpapiFlashArgs[];
diff --git a/content/public/test/mock_download_manager.h b/content/public/test/mock_download_manager.h index f075360..6b9ba1dd 100644 --- a/content/public/test/mock_download_manager.h +++ b/content/public/test/mock_download_manager.h
@@ -173,6 +173,7 @@ MOCK_METHOD1(GetDownload, download::DownloadItem*(uint32_t id)); MOCK_METHOD1(GetDownloadByGuid, download::DownloadItem*(const std::string&)); MOCK_METHOD1(GetNextId, void(base::OnceCallback<void(uint32_t)>)); + MOCK_METHOD1(CanDownload, bool(download::DownloadUrlParameters*)); void OnHistoryQueryComplete( base::OnceClosure load_history_downloads_cb) override;
diff --git a/content/renderer/media/android/stream_texture_wrapper_impl.cc b/content/renderer/media/android/stream_texture_wrapper_impl.cc index 3319214..cf9ca17 100644 --- a/content/renderer/media/android/stream_texture_wrapper_impl.cc +++ b/content/renderer/media/android/stream_texture_wrapper_impl.cc
@@ -117,9 +117,9 @@ } void StreamTextureWrapperImpl::SetCurrentFrameInternal( - const scoped_refptr<media::VideoFrame>& video_frame) { + scoped_refptr<media::VideoFrame> video_frame) { base::AutoLock auto_lock(current_frame_lock_); - current_frame_ = video_frame; + current_frame_ = std::move(video_frame); } void StreamTextureWrapperImpl::UpdateTextureSize(const gfx::Size& new_size) {
diff --git a/content/renderer/media/android/stream_texture_wrapper_impl.h b/content/renderer/media/android/stream_texture_wrapper_impl.h index 80f96c7..a9bad7ee 100644 --- a/content/renderer/media/android/stream_texture_wrapper_impl.h +++ b/content/renderer/media/android/stream_texture_wrapper_impl.h
@@ -102,8 +102,7 @@ void ReallocateVideoFrame(const gfx::Size& natural_size); - void SetCurrentFrameInternal( - const scoped_refptr<media::VideoFrame>& video_frame); + void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame> video_frame); bool enable_texture_copy_;
diff --git a/content/renderer/media/stream/media_stream_audio_processor.cc b/content/renderer/media/stream/media_stream_audio_processor.cc index 6aeeafd..d2a130be 100644 --- a/content/renderer/media/stream/media_stream_audio_processor.cc +++ b/content/renderer/media/stream/media_stream_audio_processor.cc
@@ -48,7 +48,7 @@ namespace { using webrtc::AudioProcessing; -using webrtc::NoiseSuppression; +using NoiseSuppression = webrtc::AudioProcessing::Config::NoiseSuppression; constexpr int kAudioProcessingNumberOfChannels = 1; constexpr int kBuffersPerSecond = 100; // 10 ms per buffer. @@ -610,22 +610,6 @@ playout_data_source_->AddPlayoutSink(this); } - if (properties.EchoCancellationIsWebRtcProvided()) { - blink::EnableEchoCancellation(audio_processing_.get()); - } - - if (properties.goog_noise_suppression) - blink::EnableNoiseSuppression(audio_processing_.get(), - NoiseSuppression::kHigh); - - if (goog_typing_detection) { - // TODO(xians): Remove this |typing_detector_| after the typing suppression - // is enabled by default. - typing_detector_.reset(new webrtc::TypingDetection()); - blink::EnableTypingDetection(audio_processing_.get(), - typing_detector_.get()); - } - // TODO(saza): When Chrome uses AGC2, handle all JSON config via the // webrtc::AudioProcessing::Config, crbug.com/895814. base::Optional<double> pre_amplifier_fixed_gain_factor, @@ -660,6 +644,18 @@ } blink::ConfigPreAmplifier(&apm_config, pre_amplifier_fixed_gain_factor); + if (goog_typing_detection) { + // TODO(xians): Remove this |typing_detector_| after the typing suppression + // is enabled by default. + typing_detector_.reset(new webrtc::TypingDetection()); + blink::EnableTypingDetection(&apm_config, typing_detector_.get()); + } + if (properties.goog_noise_suppression) { + blink::EnableNoiseSuppression(&apm_config, NoiseSuppression::kHigh); + } + if (properties.EchoCancellationIsWebRtcProvided()) { + blink::EnableEchoCancellation(&apm_config); + } audio_processing_->ApplyConfig(apm_config); RecordProcessingState(AUDIO_PROCESSING_ENABLED);
diff --git a/content/renderer/media/stream/media_stream_video_renderer_sink.cc b/content/renderer/media/stream/media_stream_video_renderer_sink.cc index 729d8954..f474f66 100644 --- a/content/renderer/media/stream/media_stream_video_renderer_sink.cc +++ b/content/renderer/media/stream/media_stream_video_renderer_sink.cc
@@ -50,7 +50,7 @@ DCHECK(state_ == STARTED || state_ == PAUSED) << state_; } - void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame, + void OnVideoFrame(scoped_refptr<media::VideoFrame> frame, base::TimeTicks /*current_time*/) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); DCHECK(frame); @@ -73,7 +73,7 @@ } frame_size_ = frame->natural_size(); - repaint_cb_.Run(frame); + repaint_cb_.Run(std::move(frame)); } void RenderEndOfStream() {
diff --git a/content/renderer/media/stream/media_stream_video_track_unittest.cc b/content/renderer/media/stream/media_stream_video_track_unittest.cc index f84970a..0d0fda0e 100644 --- a/content/renderer/media/stream/media_stream_video_track_unittest.cc +++ b/content/renderer/media/stream/media_stream_video_track_unittest.cc
@@ -49,13 +49,13 @@ } void DeliverVideoFrameAndWaitForRenderer( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, MockMediaStreamVideoSink* sink) { base::RunLoop run_loop; base::Closure quit_closure = run_loop.QuitClosure(); EXPECT_CALL(*sink, OnVideoFrame()) .WillOnce(RunClosure(std::move(quit_closure))); - mock_source()->DeliverVideoFrame(frame); + mock_source()->DeliverVideoFrame(std::move(frame)); run_loop.Run(); } @@ -186,10 +186,9 @@ base::ThreadCheckerImpl thread_checker_; }; -void CheckThreadVideoFrameReceiver( - CheckThreadHelper* helper, - const scoped_refptr<media::VideoFrame>& frame, - base::TimeTicks estimated_capture_time) { +void CheckThreadVideoFrameReceiver(CheckThreadHelper* helper, + scoped_refptr<media::VideoFrame> frame, + base::TimeTicks estimated_capture_time) { // Do nothing. } @@ -361,16 +360,14 @@ blink::MediaStreamVideoTrack::GetVideoTrack(track); blink::WebMediaStreamTrack::Settings settings; - const scoped_refptr<media::VideoFrame>& frame1 = - media::VideoFrame::CreateBlackFrame(gfx::Size(600, 400)); - DeliverVideoFrameAndWaitForRenderer(frame1, &sink); + auto frame1 = media::VideoFrame::CreateBlackFrame(gfx::Size(600, 400)); + DeliverVideoFrameAndWaitForRenderer(std::move(frame1), &sink); native_track->GetSettings(settings); EXPECT_EQ(600, settings.width); EXPECT_EQ(400, settings.height); - const scoped_refptr<media::VideoFrame>& frame2 = - media::VideoFrame::CreateBlackFrame(gfx::Size(200, 300)); - DeliverVideoFrameAndWaitForRenderer(frame2, &sink); + auto frame2 = media::VideoFrame::CreateBlackFrame(gfx::Size(200, 300)); + DeliverVideoFrameAndWaitForRenderer(std::move(frame2), &sink); native_track->GetSettings(settings); EXPECT_EQ(200, settings.width); EXPECT_EQ(300, settings.height);
diff --git a/content/renderer/media/stream/mock_media_stream_video_sink.cc b/content/renderer/media/stream/mock_media_stream_video_sink.cc index 0646cbf..70d4f72 100644 --- a/content/renderer/media/stream/mock_media_stream_video_sink.cc +++ b/content/renderer/media/stream/mock_media_stream_video_sink.cc
@@ -28,12 +28,12 @@ } void MockMediaStreamVideoSink::DeliverVideoFrame( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time) { - last_frame_ = frame; ++number_of_frames_; format_ = frame->format(); frame_size_ = frame->natural_size(); + last_frame_ = std::move(frame); OnVideoFrame(); }
diff --git a/content/renderer/media/stream/mock_media_stream_video_sink.h b/content/renderer/media/stream/mock_media_stream_video_sink.h index 5f1b8a1b..5d336b2 100644 --- a/content/renderer/media/stream/mock_media_stream_video_sink.h +++ b/content/renderer/media/stream/mock_media_stream_video_sink.h
@@ -38,7 +38,7 @@ blink::WebMediaStreamSource::ReadyState state) override; void OnEnabledChanged(bool enabled) override; - // Triggered when OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame) + // Triggered when OnVideoFrame(scoped_refptr<media::VideoFrame> frame) // is called. MOCK_METHOD0(OnVideoFrame, void()); @@ -53,7 +53,7 @@ blink::WebMediaStreamSource::ReadyState state() const { return state_; } private: - void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame, + void DeliverVideoFrame(scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time); int number_of_frames_;
diff --git a/content/renderer/media/stream/mock_media_stream_video_source.cc b/content/renderer/media/stream/mock_media_stream_video_source.cc index 9e56768..09ab6a2 100644 --- a/content/renderer/media/stream/mock_media_stream_video_source.cc +++ b/content/renderer/media/stream/mock_media_stream_video_source.cc
@@ -90,11 +90,12 @@ } void MockMediaStreamVideoSource::DeliverVideoFrame( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { DCHECK(!is_stopped_for_restart_); DCHECK(!frame_callback_.is_null()); io_task_runner()->PostTask( - FROM_HERE, base::BindOnce(frame_callback_, frame, base::TimeTicks())); + FROM_HERE, + base::BindOnce(frame_callback_, std::move(frame), base::TimeTicks())); } void MockMediaStreamVideoSource::StopSourceForRestartImpl() {
diff --git a/content/renderer/media/stream/mock_media_stream_video_source.h b/content/renderer/media/stream/mock_media_stream_video_source.h index 47868e79..99bb3f6 100644 --- a/content/renderer/media/stream/mock_media_stream_video_source.h +++ b/content/renderer/media/stream/mock_media_stream_video_source.h
@@ -35,7 +35,7 @@ // Delivers |frame| to all registered tracks on the IO thread. Its up to the // call to make sure MockMediaStreamVideoSource is not destroyed before the // frame has been delivered. - void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame); + void DeliverVideoFrame(scoped_refptr<media::VideoFrame> frame); const media::VideoCaptureFormat& start_format() const { return format_; } int max_requested_height() const { return max_requested_height_; }
diff --git a/content/renderer/media/stream/webmediaplayer_ms.cc b/content/renderer/media/stream/webmediaplayer_ms.cc index 8602f4f..92d19cd9 100644 --- a/content/renderer/media/stream/webmediaplayer_ms.cc +++ b/content/renderer/media/stream/webmediaplayer_ms.cc
@@ -996,7 +996,7 @@ return false; return video_renderer_.CopyVideoFrameYUVDataToGLTexture( - provider, gl, video_frame.get(), target, texture, internal_format, format, + provider, gl, *video_frame, target, texture, internal_format, format, type, level, premultiply_alpha, flip_y); }
diff --git a/content/renderer/media/stream/webmediaplayer_ms_compositor.cc b/content/renderer/media/stream/webmediaplayer_ms_compositor.cc index 7b384bfd..0b4437a 100644 --- a/content/renderer/media/stream/webmediaplayer_ms_compositor.cc +++ b/content/renderer/media/stream/webmediaplayer_ms_compositor.cc
@@ -41,7 +41,7 @@ // This function copies |frame| to a new I420 or YV12A media::VideoFrame. scoped_refptr<media::VideoFrame> CopyFrame( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, media::PaintCanvasVideoRenderer* video_renderer) { scoped_refptr<media::VideoFrame> new_frame; if (frame->HasTextures()) { @@ -477,39 +477,40 @@ if (!frame || frame == current_frame_) return; + const base::TimeDelta timestamp = frame->timestamp(); SetCurrentFrame(std::move(frame)); const auto& end = timestamps_to_clock_times_.end(); const auto& begin = timestamps_to_clock_times_.begin(); auto iterator = begin; - while (iterator != end && iterator->first < frame->timestamp()) + while (iterator != end && iterator->first < timestamp) ++iterator; timestamps_to_clock_times_.erase(begin, iterator); } void WebMediaPlayerMSCompositor::RenderWithoutAlgorithm( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { DCHECK(io_task_runner_->BelongsToCurrentThread()); video_frame_compositor_task_runner_->PostTask( FROM_HERE, base::BindOnce( &WebMediaPlayerMSCompositor::RenderWithoutAlgorithmOnCompositor, this, - frame)); + std::move(frame))); } void WebMediaPlayerMSCompositor::RenderWithoutAlgorithmOnCompositor( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { DCHECK(video_frame_compositor_task_runner_->BelongsToCurrentThread()); { base::AutoLock auto_lock(current_frame_lock_); - SetCurrentFrame(frame); + SetCurrentFrame(std::move(frame)); } if (video_frame_provider_client_) video_frame_provider_client_->DidReceiveFrame(); } void WebMediaPlayerMSCompositor::SetCurrentFrame( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { DCHECK(video_frame_compositor_task_runner_->BelongsToCurrentThread()); current_frame_lock_.AssertAcquired(); TRACE_EVENT_INSTANT1("media", "WebMediaPlayerMSCompositor::SetCurrentFrame", @@ -528,12 +529,12 @@ video_frame_compositor_task_runner_->PostTask( FROM_HERE, base::BindOnce(&WebMediaPlayerMSCompositor::CheckForFrameChanges, this, - old_frame, frame)); + std::move(old_frame), std::move(frame))); } void WebMediaPlayerMSCompositor::CheckForFrameChanges( - const scoped_refptr<media::VideoFrame>& old_frame, - const scoped_refptr<media::VideoFrame>& new_frame) { + scoped_refptr<media::VideoFrame> old_frame, + scoped_refptr<media::VideoFrame> new_frame) { DCHECK(video_frame_compositor_task_runner_->BelongsToCurrentThread()); const bool new_frame_is_opaque = media::IsOpaque(new_frame->format());
diff --git a/content/renderer/media/stream/webmediaplayer_ms_compositor.h b/content/renderer/media/stream/webmediaplayer_ms_compositor.h index d7e2520..551e044 100644 --- a/content/renderer/media/stream/webmediaplayer_ms_compositor.h +++ b/content/renderer/media/stream/webmediaplayer_ms_compositor.h
@@ -139,16 +139,16 @@ // For algorithm disabled case only: call SetCurrentFrame() with the current // frame immediately. |video_frame_provider_client_| gets notified about the // new frame with a DidReceiveFrame() call. - void RenderWithoutAlgorithm(const scoped_refptr<media::VideoFrame>& frame); + void RenderWithoutAlgorithm(scoped_refptr<media::VideoFrame> frame); void RenderWithoutAlgorithmOnCompositor( - const scoped_refptr<media::VideoFrame>& frame); + scoped_refptr<media::VideoFrame> frame); // Update |current_frame_| and |dropped_frame_count_| - void SetCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); + void SetCurrentFrame(scoped_refptr<media::VideoFrame> frame); // Following the update to |current_frame_|, this will check for changes that // require updating video layer. - void CheckForFrameChanges(const scoped_refptr<media::VideoFrame>& old_frame, - const scoped_refptr<media::VideoFrame>& new_frame); + void CheckForFrameChanges(scoped_refptr<media::VideoFrame> old_frame, + scoped_refptr<media::VideoFrame> new_frame); void StartRenderingInternal(); void StopRenderingInternal();
diff --git a/content/renderer/media/stream/webmediaplayer_ms_unittest.cc b/content/renderer/media/stream/webmediaplayer_ms_unittest.cc index 6a58bcb7..ea2e9486 100644 --- a/content/renderer/media/stream/webmediaplayer_ms_unittest.cc +++ b/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
@@ -236,8 +236,7 @@ void InjectFrame(); // Methods for test use - void AddFrame(FrameType category, - const scoped_refptr<media::VideoFrame>& frame); + void AddFrame(FrameType category, scoped_refptr<media::VideoFrame> frame); bool started_; bool paused_; @@ -296,8 +295,8 @@ void MockMediaStreamVideoRenderer::AddFrame( FrameType category, - const scoped_refptr<media::VideoFrame>& frame) { - frames_.push_back(std::make_pair(category, frame)); + scoped_refptr<media::VideoFrame> frame) { + frames_.push_back(std::make_pair(category, std::move(frame))); } void MockMediaStreamVideoRenderer::QueueFrames(
diff --git a/content/renderer/media/video_capture/video_capture_impl_manager_unittest.cc b/content/renderer/media/video_capture/video_capture_impl_manager_unittest.cc index dc05a7f..39b48bc3 100644 --- a/content/renderer/media/video_capture/video_capture_impl_manager_unittest.cc +++ b/content/renderer/media/video_capture/video_capture_impl_manager_unittest.cc
@@ -187,7 +187,7 @@ } MOCK_METHOD2(OnFrameReady, - void(const scoped_refptr<media::VideoFrame>&, + void(scoped_refptr<media::VideoFrame>, base::TimeTicks estimated_capture_time)); MOCK_METHOD1(OnStarted, void(media::VideoCaptureSessionId id)); MOCK_METHOD1(OnStopped, void(media::VideoCaptureSessionId id));
diff --git a/content/renderer/media/video_capture/video_capture_impl_unittest.cc b/content/renderer/media/video_capture/video_capture_impl_unittest.cc index 720b2f5..016a43a2 100644 --- a/content/renderer/media/video_capture/video_capture_impl_unittest.cc +++ b/content/renderer/media/video_capture/video_capture_impl_unittest.cc
@@ -125,7 +125,7 @@ protected: // These four mocks are used to create callbacks for the different oeprations. MOCK_METHOD2(OnFrameReady, - void(const scoped_refptr<media::VideoFrame>&, base::TimeTicks)); + void(scoped_refptr<media::VideoFrame>, base::TimeTicks)); MOCK_METHOD1(OnStateUpdate, void(blink::VideoCaptureState)); MOCK_METHOD1(OnDeviceFormatsInUse, void(const media::VideoCaptureFormats&)); MOCK_METHOD1(OnDeviceSupportedFormats,
diff --git a/content/renderer/media/webrtc/media_stream_remote_video_source.cc b/content/renderer/media/webrtc/media_stream_remote_video_source.cc index 69f4850..245ebc2 100644 --- a/content/renderer/media/webrtc/media_stream_remote_video_source.cc +++ b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
@@ -43,8 +43,7 @@ // thread. void OnFrame(const webrtc::VideoFrame& frame) override; - void DoRenderFrameOnIOThread( - const scoped_refptr<media::VideoFrame>& video_frame); + void DoRenderFrameOnIOThread(scoped_refptr<media::VideoFrame> video_frame); private: scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; @@ -198,13 +197,12 @@ video_frame)); } -void MediaStreamRemoteVideoSource:: -RemoteVideoSourceDelegate::DoRenderFrameOnIOThread( - const scoped_refptr<media::VideoFrame>& video_frame) { +void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate:: + DoRenderFrameOnIOThread(scoped_refptr<media::VideoFrame> video_frame) { DCHECK(io_task_runner_->BelongsToCurrentThread()); TRACE_EVENT0("webrtc", "RemoteVideoSourceDelegate::DoRenderFrameOnIOThread"); // TODO(hclam): Give the estimated capture time. - frame_callback_.Run(video_frame, base::TimeTicks()); + frame_callback_.Run(std::move(video_frame), base::TimeTicks()); } MediaStreamRemoteVideoSource::MediaStreamRemoteVideoSource(
diff --git a/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc b/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc index cb4cee1b..09c5bc1 100644 --- a/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc +++ b/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc
@@ -91,14 +91,13 @@ // destroyed. void ReleaseSourceOnMainThread(); - void OnVideoFrameOnIO(const scoped_refptr<media::VideoFrame>& frame, + void OnVideoFrameOnIO(scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time); private: friend class base::RefCountedThreadSafe<WebRtcVideoSourceAdapter>; - void OnVideoFrameOnWorkerThread( - const scoped_refptr<media::VideoFrame>& frame); + void OnVideoFrameOnWorkerThread(scoped_refptr<media::VideoFrame> frame); virtual ~WebRtcVideoSourceAdapter(); @@ -188,7 +187,7 @@ } void MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::OnVideoFrameOnIO( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time) { DCHECK(io_thread_checker_.CalledOnValidThread()); render_task_runner_->PostTask( @@ -198,15 +197,15 @@ libjingle_worker_thread_->PostTask( FROM_HERE, base::BindOnce(&WebRtcVideoSourceAdapter::OnVideoFrameOnWorkerThread, - this, frame)); + this, std::move(frame))); } void MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter:: - OnVideoFrameOnWorkerThread(const scoped_refptr<media::VideoFrame>& frame) { + OnVideoFrameOnWorkerThread(scoped_refptr<media::VideoFrame> frame) { DCHECK(libjingle_worker_thread_->BelongsToCurrentThread()); base::AutoLock auto_lock(video_source_stop_lock_); if (video_source_) - video_source_->OnFrameCaptured(frame); + video_source_->OnFrameCaptured(std::move(frame)); } MediaStreamVideoWebRtcSink::MediaStreamVideoWebRtcSink(
diff --git a/content/renderer/media/webrtc/rtc_video_encoder.cc b/content/renderer/media/webrtc/rtc_video_encoder.cc index 5a97063..23fde82 100644 --- a/content/renderer/media/webrtc/rtc_video_encoder.cc +++ b/content/renderer/media/webrtc/rtc_video_encoder.cc
@@ -203,7 +203,7 @@ // Checks if the frame size is different than hardware accelerator // requirements. - bool RequiresSizeChange(const scoped_refptr<media::VideoFrame>& frame) const; + bool RequiresSizeChange(const media::VideoFrame& frame) const; // Return an encoded output buffer to WebRTC. void ReturnEncodedImage(const webrtc::EncodedImage& image, @@ -651,7 +651,7 @@ frame = static_cast<WebRtcVideoFrameAdapter*>( next_frame->video_frame_buffer().get()) ->getMediaVideoFrame(); - requires_copy = RequiresSizeChange(frame) || + requires_copy = RequiresSizeChange(*frame) || frame->storage_type() != media::VideoFrame::STORAGE_SHMEM; } else { requires_copy = true; @@ -748,9 +748,9 @@ } bool RTCVideoEncoder::Impl::RequiresSizeChange( - const scoped_refptr<media::VideoFrame>& frame) const { - return (frame->coded_size() != input_frame_coded_size_ || - frame->visible_rect() != gfx::Rect(input_visible_size_)); + const media::VideoFrame& frame) const { + return (frame.coded_size() != input_frame_coded_size_ || + frame.visible_rect() != gfx::Rect(input_visible_size_)); } void RTCVideoEncoder::Impl::RegisterEncodeCompleteCallback(
diff --git a/content/renderer/media/webrtc/rtc_video_encoder_unittest.cc b/content/renderer/media/webrtc/rtc_video_encoder_unittest.cc index 2128596..074fabcc 100644 --- a/content/renderer/media/webrtc/rtc_video_encoder_unittest.cc +++ b/content/renderer/media/webrtc/rtc_video_encoder_unittest.cc
@@ -163,7 +163,7 @@ kInputFrameFillU, kInputFrameFillV) == 0); } - void VerifyEncodedFrame(const scoped_refptr<media::VideoFrame>& frame, + void VerifyEncodedFrame(scoped_refptr<media::VideoFrame> frame, bool force_keyframe) { DVLOG(3) << __func__; EXPECT_EQ(kInputFrameWidth, frame->visible_rect().width()); @@ -176,7 +176,7 @@ frame->visible_data(media::VideoFrame::kVPlane)[0]); } - void ReturnFrameWithTimeStamp(const scoped_refptr<media::VideoFrame>& frame, + void ReturnFrameWithTimeStamp(scoped_refptr<media::VideoFrame> frame, bool force_keyframe) { client_->BitstreamBufferReady( 0, @@ -239,7 +239,7 @@ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_encoder_->InitEncode(&codec, 1, 12345)); EXPECT_CALL(*mock_vea_, Encode(_, _)) - .WillOnce(Invoke([this](const scoped_refptr<media::VideoFrame>&, bool) { + .WillOnce(Invoke([this](scoped_refptr<media::VideoFrame>, bool) { encoder_thread_.task_runner()->PostTask( FROM_HERE, base::BindOnce(
diff --git a/content/renderer/media/webrtc/webrtc_video_track_source.cc b/content/renderer/media/webrtc/webrtc_video_track_source.cc index 121d5380..b08a5062 100644 --- a/content/renderer/media/webrtc/webrtc_video_track_source.cc +++ b/content/renderer/media/webrtc/webrtc_video_track_source.cc
@@ -63,7 +63,7 @@ } void WebRtcVideoTrackSource::OnFrameCaptured( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); TRACE_EVENT0("media", "WebRtcVideoSource::OnFrameCaptured"); if (!(frame->IsMappable() && @@ -126,11 +126,11 @@ // Return |frame| directly if it is texture backed, because there is no // cropping support for texture yet. See http://crbug/503653. if (frame->HasTextures()) { - DeliverFrame(frame, - // The webrtc::VideoFrame::UpdateRect expected by WebRTC must - // be relative to the |visible_rect()|. We need to translate. - CropRectangle(accumulated_update_rect_, frame->visible_rect()), - translated_camera_time_us); + // The webrtc::VideoFrame::UpdateRect expected by WebRTC must + // be relative to the |visible_rect()|. We need to translate. + const auto cropped_rect = + CropRectangle(accumulated_update_rect_, frame->visible_rect()); + DeliverFrame(std::move(frame), cropped_rect, translated_camera_time_us); return; } @@ -166,19 +166,20 @@ // Attach shared ownership of the wrapped |frame| to the wrapping // |video_frame|. - video_frame->AddDestructionObserver(base::BindOnce( - base::DoNothing::Once<scoped_refptr<media::VideoFrame>>(), frame)); + video_frame->AddDestructionObserver( + base::BindOnce(base::DoNothing::Once<scoped_refptr<media::VideoFrame>>(), + std::move(frame))); // If no scaling is needed, return a wrapped version of |frame| directly. // The soft-applied cropping will be taken into account by the remainder // of the pipeline. if (video_frame->natural_size() == video_frame->visible_rect().size()) { - DeliverFrame( - video_frame, - // The webrtc::VideoFrame::UpdateRect expected by WebRTC must be - // relative to the |visible_rect()|. We need to translate. - CropRectangle(accumulated_update_rect_, video_frame->visible_rect()), - translated_camera_time_us); + // The webrtc::VideoFrame::UpdateRect expected by WebRTC must be + // relative to the |visible_rect()|. We need to translate. + const auto cropped_rect = + CropRectangle(accumulated_update_rect_, video_frame->visible_rect()); + DeliverFrame(std::move(video_frame), cropped_rect, + translated_camera_time_us); return; } @@ -189,7 +190,7 @@ scaled_frame_pool_.CreateFrame( has_alpha ? media::PIXEL_FORMAT_I420A : media::PIXEL_FORMAT_I420, adapted_size, gfx::Rect(adapted_size), adapted_size, - frame->timestamp()); + video_frame->timestamp()); libyuv::I420Scale( video_frame->visible_data(media::VideoFrame::kYPlane), video_frame->stride(media::VideoFrame::kYPlane), @@ -218,7 +219,7 @@ // When scaling is applied and any part of the frame has changed, we mark the // whole frame as changed. DeliverFrame( - scaled_frame, + std::move(scaled_frame), accumulated_update_rect_.IsEmpty() ? gfx::Rect() : gfx::Rect(0, 0, adapted_size.width(), adapted_size.height()),
diff --git a/content/renderer/media/webrtc/webrtc_video_track_source.h b/content/renderer/media/webrtc/webrtc_video_track_source.h index 3a869be..f18cb03 100644 --- a/content/renderer/media/webrtc/webrtc_video_track_source.h +++ b/content/renderer/media/webrtc/webrtc_video_track_source.h
@@ -43,7 +43,7 @@ bool remote() const override; bool is_screencast() const override; absl::optional<bool> needs_denoising() const override; - void OnFrameCaptured(const scoped_refptr<media::VideoFrame>& frame); + void OnFrameCaptured(scoped_refptr<media::VideoFrame> frame); using webrtc::VideoTrackSourceInterface::AddOrUpdateSink; using webrtc::VideoTrackSourceInterface::RemoveSink;
diff --git a/content/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc b/content/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc index 5ee4e51..35fe3508 100644 --- a/content/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc +++ b/content/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc
@@ -118,10 +118,10 @@ // Necessary callbacks and MOCK_METHODS for them. MOCK_METHOD2(DoOnDeliverFrame, - void(const scoped_refptr<media::VideoFrame>&, base::TimeTicks)); - void OnDeliverFrame(const scoped_refptr<media::VideoFrame>& video_frame, - base::TimeTicks estimated_capture_time) { - DoOnDeliverFrame(video_frame, estimated_capture_time); + void(scoped_refptr<media::VideoFrame>, base::TimeTicks)); + void OnDeliverFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks estimated_capture_time) { + DoOnDeliverFrame(std::move(video_frame), estimated_capture_time); } MOCK_METHOD1(DoOnRunning, void(bool));
diff --git a/content/renderer/media_recorder/media_recorder_handler.cc b/content/renderer/media_recorder/media_recorder_handler.cc index 3aecc41..31d9b8a 100644 --- a/content/renderer/media_recorder/media_recorder_handler.cc +++ b/content/renderer/media_recorder/media_recorder_handler.cc
@@ -562,7 +562,7 @@ } void MediaRecorderHandler::OnVideoFrameForTesting( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, const TimeTicks& timestamp) { for (const auto& recorder : video_recorders_) recorder->OnVideoFrameForTesting(frame, timestamp);
diff --git a/content/renderer/media_recorder/media_recorder_handler.h b/content/renderer/media_recorder/media_recorder_handler.h index f34a4c85..c820c0f 100644 --- a/content/renderer/media_recorder/media_recorder_handler.h +++ b/content/renderer/media_recorder/media_recorder_handler.h
@@ -87,7 +87,7 @@ // Updates |video_tracks_|,|audio_tracks_| and returns true if any changed. bool UpdateTracksAndCheckIfChanged(); - void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, + void OnVideoFrameForTesting(scoped_refptr<media::VideoFrame> frame, const base::TimeTicks& timestamp); void OnAudioBusForTesting(const media::AudioBus& audio_bus, const base::TimeTicks& timestamp);
diff --git a/content/renderer/media_recorder/media_recorder_handler_unittest.cc b/content/renderer/media_recorder/media_recorder_handler_unittest.cc index 2caec23..c5e244b4 100644 --- a/content/renderer/media_recorder/media_recorder_handler_unittest.cc +++ b/content/renderer/media_recorder/media_recorder_handler_unittest.cc
@@ -104,8 +104,8 @@ return !media_recorder_handler_->audio_recorders_.empty(); } - void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame) { - media_recorder_handler_->OnVideoFrameForTesting(frame, + void OnVideoFrameForTesting(scoped_refptr<media::VideoFrame> frame) { + media_recorder_handler_->OnVideoFrameForTesting(std::move(frame), base::TimeTicks::Now()); } void OnAudioBusForTesting(const media::AudioBus& audio_bus) {
diff --git a/content/renderer/media_recorder/video_track_recorder.cc b/content/renderer/media_recorder/video_track_recorder.cc index 423959a8..2894e773 100644 --- a/content/renderer/media_recorder/video_track_recorder.cc +++ b/content/renderer/media_recorder/video_track_recorder.cc
@@ -208,7 +208,7 @@ } void VideoTrackRecorder::Encoder::StartFrameEncode( - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, base::TimeTicks capture_timestamp) { // Cache the thread sending frames on first frame arrival. if (!origin_task_runner_.get()) @@ -233,7 +233,7 @@ if (video_frame->HasTextures()) { main_task_runner_->PostTask( FROM_HERE, base::BindOnce(&Encoder::RetrieveFrameOnMainThread, this, - video_frame, capture_timestamp)); + std::move(video_frame), capture_timestamp)); return; } @@ -250,9 +250,8 @@ wrapped_frame->AddDestructionObserver(media::BindToCurrentLoop( base::BindOnce(&VideoTrackRecorder::Counter::DecreaseCount, num_frames_in_encode_->GetWeakPtr()))); - wrapped_frame->AddDestructionObserver( - base::BindOnce([](const scoped_refptr<VideoFrame>& video_frame) {}, - std::move(video_frame))); + wrapped_frame->AddDestructionObserver(base::BindOnce( + [](scoped_refptr<VideoFrame> video_frame) {}, std::move(video_frame))); num_frames_in_encode_->IncreaseCount(); encoding_task_runner_->PostTask( @@ -261,7 +260,7 @@ } void VideoTrackRecorder::Encoder::RetrieveFrameOnMainThread( - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, base::TimeTicks capture_timestamp) { DCHECK(main_task_runner_->BelongsToCurrentThread()); @@ -456,7 +455,7 @@ } void VideoTrackRecorder::OnVideoFrameForTesting( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks timestamp) { DVLOG(3) << __func__; @@ -466,7 +465,7 @@ timestamp); } - encoder_->StartFrameEncode(frame, timestamp); + encoder_->StartFrameEncode(std::move(frame), timestamp); } void VideoTrackRecorder::InitializeEncoder( @@ -474,7 +473,7 @@ const OnEncodedVideoCB& on_encoded_video_callback, int32_t bits_per_second, bool allow_vea_encoder, - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks capture_time) { DVLOG(3) << __func__ << frame->visible_rect().size().ToString(); DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_);
diff --git a/content/renderer/media_recorder/video_track_recorder.h b/content/renderer/media_recorder/video_track_recorder.h index e2ef6e2..6e10eb16 100644 --- a/content/renderer/media_recorder/video_track_recorder.h +++ b/content/renderer/media_recorder/video_track_recorder.h
@@ -116,11 +116,10 @@ // encode the frame. If the |frame|'s data is not directly available (e.g. // it's a texture) then RetrieveFrameOnMainThread() is called, and if even // that fails, black frames are sent instead. - void StartFrameEncode(const scoped_refptr<media::VideoFrame>& frame, + void StartFrameEncode(scoped_refptr<media::VideoFrame> frame, base::TimeTicks capture_timestamp); - void RetrieveFrameOnMainThread( - const scoped_refptr<media::VideoFrame>& video_frame, - base::TimeTicks capture_timestamp); + void RetrieveFrameOnMainThread(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks capture_timestamp); static void OnFrameEncodeCompleted( const VideoTrackRecorder::OnEncodedVideoCB& on_encoded_video_cb, @@ -151,7 +150,7 @@ base::TimeTicks capture_timestamp) = 0; // Called when the frame reference is released after encode. - void FrameReleased(const scoped_refptr<media::VideoFrame>& frame); + void FrameReleased(scoped_refptr<media::VideoFrame> frame); // Used to shutdown properly on the same thread we were created. const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; @@ -241,15 +240,16 @@ void Pause(); void Resume(); - void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, + void OnVideoFrameForTesting(scoped_refptr<media::VideoFrame> frame, base::TimeTicks capture_time); + private: friend class VideoTrackRecorderTest; void InitializeEncoder(CodecId codec, const OnEncodedVideoCB& on_encoded_video_callback, int32_t bits_per_second, bool allow_vea_encoder, - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks capture_time); void OnError(); @@ -263,7 +263,7 @@ scoped_refptr<Encoder> encoder_; base::Callback<void(bool allow_vea_encoder, - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks capture_time)> initialize_encoder_callback_;
diff --git a/content/renderer/media_recorder/video_track_recorder_unittest.cc b/content/renderer/media_recorder/video_track_recorder_unittest.cc index ac3320c..8486a90 100644 --- a/content/renderer/media_recorder/video_track_recorder_unittest.cc +++ b/content/renderer/media_recorder/video_track_recorder_unittest.cc
@@ -125,11 +125,11 @@ is_key_frame); } - void Encode(const scoped_refptr<VideoFrame>& frame, - base::TimeTicks capture_time) { + void Encode(scoped_refptr<VideoFrame> frame, base::TimeTicks capture_time) { EXPECT_TRUE(blink::scheduler::GetSingleThreadTaskRunnerForTesting() ->BelongsToCurrentThread()); - video_track_recorder_->OnVideoFrameForTesting(frame, capture_time); + video_track_recorder_->OnVideoFrameForTesting(std::move(frame), + capture_time); } void OnError() { video_track_recorder_->OnError(); }
diff --git a/content/renderer/media_recorder/vpx_encoder.cc b/content/renderer/media_recorder/vpx_encoder.cc index b9be907..052d2977 100644 --- a/content/renderer/media_recorder/vpx_encoder.cc +++ b/content/renderer/media_recorder/vpx_encoder.cc
@@ -73,7 +73,7 @@ DCHECK(encoding_task_runner_->BelongsToCurrentThread()); const gfx::Size frame_size = frame->visible_rect().size(); - base::TimeDelta duration = EstimateFrameDuration(frame); + base::TimeDelta duration = EstimateFrameDuration(*frame); const media::WebmMuxer::VideoParameters video_params(frame); if (!IsInitialized(codec_config_) || @@ -285,14 +285,13 @@ return codec_config.g_timebase.den != 0; } -base::TimeDelta VpxEncoder::EstimateFrameDuration( - const scoped_refptr<VideoFrame>& frame) { +base::TimeDelta VpxEncoder::EstimateFrameDuration(const VideoFrame& frame) { DCHECK(encoding_task_runner_->BelongsToCurrentThread()); using base::TimeDelta; TimeDelta predicted_frame_duration; - if (!frame->metadata()->GetTimeDelta(VideoFrameMetadata::FRAME_DURATION, - &predicted_frame_duration) || + if (!frame.metadata()->GetTimeDelta(VideoFrameMetadata::FRAME_DURATION, + &predicted_frame_duration) || predicted_frame_duration <= TimeDelta()) { // The source of the video frame did not provide the frame duration. Use // the actual amount of time between the current and previous frame as a @@ -300,9 +299,9 @@ // TODO(mcasas): This duration estimation could lead to artifacts if the // cadence of the received stream is compromised (e.g. camera freeze, pause, // remote packet loss). Investigate using GetFrameRate() in this case. - predicted_frame_duration = frame->timestamp() - last_frame_timestamp_; + predicted_frame_duration = frame.timestamp() - last_frame_timestamp_; } - last_frame_timestamp_ = frame->timestamp(); + last_frame_timestamp_ = frame.timestamp(); // Make sure |predicted_frame_duration| is in a safe range of values. const TimeDelta kMaxFrameDuration = TimeDelta::FromSecondsD(1.0 / 8); const TimeDelta kMinFrameDuration = TimeDelta::FromMilliseconds(1);
diff --git a/content/renderer/media_recorder/vpx_encoder.h b/content/renderer/media_recorder/vpx_encoder.h index 888f34b..8b3445c 100644 --- a/content/renderer/media_recorder/vpx_encoder.h +++ b/content/renderer/media_recorder/vpx_encoder.h
@@ -62,8 +62,7 @@ bool IsInitialized(const vpx_codec_enc_cfg_t& codec_config) const; // Estimate the frame duration from |frame| and |last_frame_timestamp_|. - base::TimeDelta EstimateFrameDuration( - const scoped_refptr<media::VideoFrame>& frame); + base::TimeDelta EstimateFrameDuration(const media::VideoFrame& frame); // Force usage of VP9 for encoding, instead of VP8 which is the default. const bool use_vp9_;
diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.cc b/content/renderer/pepper/pepper_media_stream_video_track_host.cc index 62bafdb7..fecfa31 100644 --- a/content/renderer/pepper/pepper_media_stream_video_track_host.cc +++ b/content/renderer/pepper/pepper_media_stream_video_track_host.cc
@@ -92,33 +92,31 @@ return plugin != PP_VIDEOFRAME_FORMAT_UNKNOWN ? plugin : source; } -void ConvertFromMediaVideoFrame(const scoped_refptr<media::VideoFrame>& src, +void ConvertFromMediaVideoFrame(const media::VideoFrame& src, PP_VideoFrame_Format dst_format, const gfx::Size& dst_size, uint8_t* dst) { - CHECK(src->format() == media::PIXEL_FORMAT_YV12 || - src->format() == media::PIXEL_FORMAT_I420); + CHECK(src.format() == media::PIXEL_FORMAT_YV12 || + src.format() == media::PIXEL_FORMAT_I420); if (dst_format == PP_VIDEOFRAME_FORMAT_BGRA) { - if (src->visible_rect().size() == dst_size) { - libyuv::I420ToARGB(src->visible_data(VideoFrame::kYPlane), - src->stride(VideoFrame::kYPlane), - src->visible_data(VideoFrame::kUPlane), - src->stride(VideoFrame::kUPlane), - src->visible_data(VideoFrame::kVPlane), - src->stride(VideoFrame::kVPlane), - dst, - dst_size.width() * 4, - dst_size.width(), + if (src.visible_rect().size() == dst_size) { + libyuv::I420ToARGB(src.visible_data(VideoFrame::kYPlane), + src.stride(VideoFrame::kYPlane), + src.visible_data(VideoFrame::kUPlane), + src.stride(VideoFrame::kUPlane), + src.visible_data(VideoFrame::kVPlane), + src.stride(VideoFrame::kVPlane), dst, + dst_size.width() * 4, dst_size.width(), dst_size.height()); } else { libyuv::YUVToARGBScaleClip( - src->visible_data(VideoFrame::kYPlane), - src->stride(VideoFrame::kYPlane), - src->visible_data(VideoFrame::kUPlane), - src->stride(VideoFrame::kUPlane), - src->visible_data(VideoFrame::kVPlane), - src->stride(VideoFrame::kVPlane), libyuv::FOURCC_YV12, - src->visible_rect().width(), src->visible_rect().height(), dst, + src.visible_data(VideoFrame::kYPlane), + src.stride(VideoFrame::kYPlane), + src.visible_data(VideoFrame::kUPlane), + src.stride(VideoFrame::kUPlane), + src.visible_data(VideoFrame::kVPlane), + src.stride(VideoFrame::kVPlane), libyuv::FOURCC_YV12, + src.visible_rect().width(), src.visible_rect().height(), dst, dst_size.width() * 4, libyuv::FOURCC_ARGB, dst_size.width(), dst_size.height(), 0, 0, dst_size.width(), dst_size.height(), kFilterMode); @@ -134,39 +132,24 @@ const int plane_order = (dst_format == PP_VIDEOFRAME_FORMAT_YV12) ? 0 : 1; int dst_width = dst_size.width(); int dst_height = dst_size.height(); - libyuv::ScalePlane(src->visible_data(kPlanesOrder[plane_order][0]), - src->stride(kPlanesOrder[plane_order][0]), - src->visible_rect().width(), - src->visible_rect().height(), - dst, - dst_width, - dst_width, - dst_height, - kFilterMode); + libyuv::ScalePlane(src.visible_data(kPlanesOrder[plane_order][0]), + src.stride(kPlanesOrder[plane_order][0]), + src.visible_rect().width(), src.visible_rect().height(), + dst, dst_width, dst_width, dst_height, kFilterMode); dst += dst_width * dst_height; - const int src_halfwidth = (src->visible_rect().width() + 1) >> 1; - const int src_halfheight = (src->visible_rect().height() + 1) >> 1; + const int src_halfwidth = (src.visible_rect().width() + 1) >> 1; + const int src_halfheight = (src.visible_rect().height() + 1) >> 1; const int dst_halfwidth = (dst_width + 1) >> 1; const int dst_halfheight = (dst_height + 1) >> 1; - libyuv::ScalePlane(src->visible_data(kPlanesOrder[plane_order][1]), - src->stride(kPlanesOrder[plane_order][1]), - src_halfwidth, - src_halfheight, - dst, - dst_halfwidth, - dst_halfwidth, - dst_halfheight, - kFilterMode); + libyuv::ScalePlane(src.visible_data(kPlanesOrder[plane_order][1]), + src.stride(kPlanesOrder[plane_order][1]), src_halfwidth, + src_halfheight, dst, dst_halfwidth, dst_halfwidth, + dst_halfheight, kFilterMode); dst += dst_halfwidth * dst_halfheight; - libyuv::ScalePlane(src->visible_data(kPlanesOrder[plane_order][2]), - src->stride(kPlanesOrder[plane_order][2]), - src_halfwidth, - src_halfheight, - dst, - dst_halfwidth, - dst_halfwidth, - dst_halfheight, - kFilterMode); + libyuv::ScalePlane(src.visible_data(kPlanesOrder[plane_order][2]), + src.stride(kPlanesOrder[plane_order][2]), src_halfwidth, + src_halfheight, dst, dst_halfwidth, dst_halfwidth, + dst_halfheight, kFilterMode); } else { NOTREACHED(); } @@ -184,13 +167,13 @@ FrameDeliverer(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, const blink::VideoCaptureDeliverFrameCB& new_frame_callback); - void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame); + void DeliverVideoFrame(scoped_refptr<media::VideoFrame> frame); private: friend class base::RefCountedThreadSafe<FrameDeliverer>; virtual ~FrameDeliverer(); - void DeliverFrameOnIO(const scoped_refptr<media::VideoFrame>& frame); + void DeliverFrameOnIO(scoped_refptr<media::VideoFrame> frame); scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; blink::VideoCaptureDeliverFrameCB new_frame_callback_; @@ -208,18 +191,18 @@ } void PepperMediaStreamVideoTrackHost::FrameDeliverer::DeliverVideoFrame( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { io_task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&FrameDeliverer::DeliverFrameOnIO, this, frame)); + FROM_HERE, base::BindOnce(&FrameDeliverer::DeliverFrameOnIO, this, + std::move(frame))); } void PepperMediaStreamVideoTrackHost::FrameDeliverer::DeliverFrameOnIO( - const scoped_refptr<media::VideoFrame>& frame) { + scoped_refptr<media::VideoFrame> frame) { DCHECK(io_task_runner_->BelongsToCurrentThread()); // The time when this frame is generated is unknown so give a null value to // |estimated_capture_time|. - new_frame_callback_.Run(frame, base::TimeTicks()); + new_frame_callback_.Run(std::move(frame), base::TimeTicks()); } PepperMediaStreamVideoTrackHost::PepperMediaStreamVideoTrackHost( @@ -364,14 +347,14 @@ } void PepperMediaStreamVideoTrackHost::OnVideoFrame( - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, base::TimeTicks estimated_capture_time) { - DCHECK(video_frame.get()); + DCHECK(video_frame); // TODO(penghuang): Check |frame->end_of_stream()| and close the track. scoped_refptr<media::VideoFrame> frame = video_frame; // Drop alpha channel since we do not support it yet. if (frame->format() == media::PIXEL_FORMAT_I420A) - frame = media::WrapAsI420VideoFrame(video_frame); + frame = media::WrapAsI420VideoFrame(std::move(video_frame)); PP_VideoFrame_Format ppformat = ToPpapiFormat(frame->format()); if (ppformat == PP_VIDEOFRAME_FORMAT_UNKNOWN) return; @@ -403,7 +386,7 @@ buffer->size.width = size.width(); buffer->size.height = size.height(); buffer->data_size = frame_data_size_; - ConvertFromMediaVideoFrame(frame, ppformat, size, buffer->data); + ConvertFromMediaVideoFrame(*frame, ppformat, size, buffer->data); SendEnqueueBufferMessageToPlugin(index); }
diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.h b/content/renderer/pepper/pepper_media_stream_video_track_host.h index 60a1e4e..1a13dfc 100644 --- a/content/renderer/pepper/pepper_media_stream_video_track_host.h +++ b/content/renderer/pepper/pepper_media_stream_video_track_host.h
@@ -65,7 +65,7 @@ // Sends frame with |index| to |track_|. int32_t SendFrameToTrack(int32_t index); - void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame, + void OnVideoFrame(scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time); // ResourceHost overrides:
diff --git a/content/renderer/pepper/pepper_platform_video_capture.cc b/content/renderer/pepper/pepper_platform_video_capture.cc index 3d65ff7..ead6fc7 100644 --- a/content/renderer/pepper/pepper_platform_video_capture.cc +++ b/content/renderer/pepper/pepper_platform_video_capture.cc
@@ -138,10 +138,10 @@ } void PepperPlatformVideoCapture::OnFrameReady( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time) { if (handler_ && !stop_capture_cb_.is_null()) - handler_->OnFrameReady(frame); + handler_->OnFrameReady(*frame); } PepperMediaDeviceManager* PepperPlatformVideoCapture::GetMediaDeviceManager() {
diff --git a/content/renderer/pepper/pepper_platform_video_capture.h b/content/renderer/pepper/pepper_platform_video_capture.h index f21937dd..ca62be7b 100644 --- a/content/renderer/pepper/pepper_platform_video_capture.h +++ b/content/renderer/pepper/pepper_platform_video_capture.h
@@ -42,7 +42,7 @@ private: void OnDeviceOpened(int request_id, bool succeeded, const std::string& label); void OnStateUpdate(blink::VideoCaptureState state); - void OnFrameReady(const scoped_refptr<media::VideoFrame>& frame, + void OnFrameReady(scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time); // Can return NULL if the RenderFrame referenced by |render_frame_id_| has
diff --git a/content/renderer/pepper/pepper_video_capture_host.cc b/content/renderer/pepper/pepper_video_capture_host.cc index 248f8a2a..0a84c54 100644 --- a/content/renderer/pepper/pepper_video_capture_host.cc +++ b/content/renderer/pepper/pepper_video_capture_host.cc
@@ -120,16 +120,13 @@ static_cast<uint32_t>(PP_ERROR_FAILED))); } -void PepperVideoCaptureHost::OnFrameReady( - const scoped_refptr<media::VideoFrame>& frame) { - DCHECK(frame.get()); - - if (alloc_size_ != frame->visible_rect().size() || buffers_.empty()) { - alloc_size_ = frame->visible_rect().size(); +void PepperVideoCaptureHost::OnFrameReady(const media::VideoFrame& frame) { + if (alloc_size_ != frame.visible_rect().size() || buffers_.empty()) { + alloc_size_ = frame.visible_rect().size(); double frame_rate; int rounded_frame_rate; - if (frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, - &frame_rate)) + if (frame.metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, + &frame_rate)) rounded_frame_rate = static_cast<int>(frame_rate + 0.5 /* round */); else rounded_frame_rate = blink::MediaStreamVideoSource::kUnknownFrameRate; @@ -138,9 +135,9 @@ for (uint32_t i = 0; i < buffers_.size(); ++i) { if (!buffers_[i].in_use) { - DCHECK_EQ(frame->format(), media::PIXEL_FORMAT_I420); + DCHECK_EQ(frame.format(), media::PIXEL_FORMAT_I420); if (buffers_[i].buffer->size() < - media::VideoFrame::AllocationSize(frame->format(), alloc_size_)) { + media::VideoFrame::AllocationSize(frame.format(), alloc_size_)) { // TODO(ihf): handle size mismatches gracefully here. return; } @@ -148,12 +145,12 @@ static_assert(media::VideoFrame::kYPlane == 0, "y plane should be 0"); static_assert(media::VideoFrame::kUPlane == 1, "u plane should be 1"); static_assert(media::VideoFrame::kVPlane == 2, "v plane should be 2"); - for (size_t j = 0; j < media::VideoFrame::NumPlanes(frame->format()); + for (size_t j = 0; j < media::VideoFrame::NumPlanes(frame.format()); ++j) { - const uint8_t* src = frame->visible_data(j); - const size_t row_bytes = frame->row_bytes(j); - const size_t src_stride = frame->stride(j); - for (int k = 0; k < frame->rows(j); ++k) { + const uint8_t* src = frame.visible_data(j); + const size_t row_bytes = frame.row_bytes(j); + const size_t src_stride = frame.stride(j); + for (int k = 0; k < frame.rows(j); ++k) { memcpy(dst, src, row_bytes); dst += row_bytes; src += src_stride;
diff --git a/content/renderer/pepper/pepper_video_capture_host.h b/content/renderer/pepper/pepper_video_capture_host.h index 0efb69c..17e16c60 100644 --- a/content/renderer/pepper/pepper_video_capture_host.h +++ b/content/renderer/pepper/pepper_video_capture_host.h
@@ -64,7 +64,7 @@ void OnError(); // Called when a video frame is ready. - void OnFrameReady(const scoped_refptr<media::VideoFrame>& frame); + void OnFrameReady(const media::VideoFrame& frame); private: int32_t OnOpen(ppapi::host::HostMessageContext* context,
diff --git a/content/renderer/pepper/video_encoder_shim.cc b/content/renderer/pepper/video_encoder_shim.cc index 21b04b46..7474e00 100644 --- a/content/renderer/pepper/video_encoder_shim.cc +++ b/content/renderer/pepper/video_encoder_shim.cc
@@ -98,17 +98,15 @@ ~EncoderImpl(); void Initialize(const media::VideoEncodeAccelerator::Config& config); - void Encode(const scoped_refptr<media::VideoFrame>& frame, - bool force_keyframe); + void Encode(scoped_refptr<media::VideoFrame> frame, bool force_keyframe); void UseOutputBitstreamBuffer(media::BitstreamBuffer buffer, uint8_t* mem); void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate); void Stop(); private: struct PendingEncode { - PendingEncode(const scoped_refptr<media::VideoFrame>& frame, - bool force_keyframe) - : frame(frame), force_keyframe(force_keyframe) {} + PendingEncode(scoped_refptr<media::VideoFrame> frame, bool force_keyframe) + : frame(std::move(frame)), force_keyframe(force_keyframe) {} ~PendingEncode() {} scoped_refptr<media::VideoFrame> frame; @@ -238,9 +236,9 @@ } void VideoEncoderShim::EncoderImpl::Encode( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, bool force_keyframe) { - frames_.push_back(PendingEncode(frame, force_keyframe)); + frames_.push_back(PendingEncode(std::move(frame), force_keyframe)); DoEncode(); } @@ -417,14 +415,14 @@ return true; } -void VideoEncoderShim::Encode(const scoped_refptr<media::VideoFrame>& frame, +void VideoEncoderShim::Encode(scoped_refptr<media::VideoFrame> frame, bool force_keyframe) { DCHECK(RenderThreadImpl::current()); media_task_runner_->PostTask( FROM_HERE, base::BindOnce(&VideoEncoderShim::EncoderImpl::Encode, - base::Unretained(encoder_impl_.get()), frame, - force_keyframe)); + base::Unretained(encoder_impl_.get()), + std::move(frame), force_keyframe)); } void VideoEncoderShim::UseOutputBitstreamBuffer(media::BitstreamBuffer buffer) {
diff --git a/content/renderer/pepper/video_encoder_shim.h b/content/renderer/pepper/video_encoder_shim.h index 5d489b2e..6f717796 100644 --- a/content/renderer/pepper/video_encoder_shim.h +++ b/content/renderer/pepper/video_encoder_shim.h
@@ -41,7 +41,7 @@ override; bool Initialize(const media::VideoEncodeAccelerator::Config& config, media::VideoEncodeAccelerator::Client* client) override; - void Encode(const scoped_refptr<media::VideoFrame>& frame, + void Encode(scoped_refptr<media::VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(media::BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate,
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index 641c9db..136b863a 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc
@@ -578,7 +578,10 @@ EXPECT_FALSE(child_proxy_1->is_pinch_gesture_active_for_testing()); // Set the |is_pinch_gesture_active| flag. - view()->PageScaleFactorChanged(1.f, true); + cc::ApplyViewportChangesArgs args; + args.page_scale_delta = 1.f; + args.is_pinch_gesture_active = true; + view()->webview()->MainFrameWidget()->ApplyViewportChanges(args); EXPECT_TRUE(child_proxy_1->is_pinch_gesture_active_for_testing()); // Create a new remote child, and get its proxy. Swapping out will force @@ -594,7 +597,8 @@ EXPECT_TRUE(child_proxy_2->is_pinch_gesture_active_for_testing()); // Reset the flag, make sure both children respond. - view()->PageScaleFactorChanged(1.f, false); + args.is_pinch_gesture_active = false; + view()->webview()->MainFrameWidget()->ApplyViewportChanges(args); EXPECT_FALSE(child_proxy_1->is_pinch_gesture_active_for_testing()); EXPECT_FALSE(child_proxy_2->is_pinch_gesture_active_for_testing()); }
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 6a00f40..25ab2ac 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -2063,17 +2063,12 @@ maximum_percent)); } -void RenderViewImpl::PageScaleFactorChanged(float page_scale_factor, - bool is_pinch_gesture_active) { +void RenderViewImpl::PageScaleFactorChanged(float page_scale_factor) { if (!webview()) return; Send(new ViewHostMsg_PageScaleFactorChanged(GetRoutingID(), page_scale_factor)); - // TODO(wjmaclean): Merge this into RenderWidget's - // SetPageScaleFactorAndLimits(). - GetWidget()->PageScaleFactorChanged(page_scale_factor, - is_pinch_gesture_active); } void RenderViewImpl::PageImportanceSignalsChanged() {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 3a5d85b..561588c 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h
@@ -243,8 +243,7 @@ int HistoryBackListCount() override; int HistoryForwardListCount() override; void ZoomLimitsChanged(double minimum_level, double maximum_level) override; - void PageScaleFactorChanged(float page_scale_factor, - bool is_pinch_gesture_active) override; + void PageScaleFactorChanged(float page_scale_factor) override; void PageImportanceSignalsChanged() override; void DidAutoResize(const blink::WebSize& newSize) override; void DidFocus(blink::WebLocalFrame* calling_frame) override;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 6ff5893..5a4d20a 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -3306,11 +3306,35 @@ allow_gpu_raster); } -void RenderWidget::SetPageScaleFactorAndLimits(float page_scale_factor, - float minimum, - float maximum) { +void RenderWidget::SetPageScaleStateAndLimits(float page_scale_factor, + bool is_pinch_gesture_active, + float minimum, + float maximum) { layer_tree_view_->layer_tree_host()->SetPageScaleFactorAndLimits( page_scale_factor, minimum, maximum); + + // Only continue if this is a mainframe, or something's actually changed. + if (!delegate() || + (page_scale_factor == page_scale_factor_from_mainframe_ && + is_pinch_gesture_active == is_pinch_gesture_active_from_mainframe_)) { + return; + } + + // The page scale is controlled by the WebView for the local main frame of + // the Page. So this is called from blink by for the RenderWidget of that + // local main frame. We forward the value on to each child RenderWidget (each + // of which will be via proxy child frame). These will each in turn forward + // the message to their child RenderWidgets (through their proxy child + // frames). + DCHECK(!is_frozen_); + + for (auto& observer : render_frame_proxies_) { + observer.OnPageScaleFactorChanged(page_scale_factor, + is_pinch_gesture_active); + } + // Store the value to give to any new RenderFrameProxy that is registered. + page_scale_factor_from_mainframe_ = page_scale_factor; + is_pinch_gesture_active_from_mainframe_ = is_pinch_gesture_active; } void RenderWidget::StartPageScaleAnimation(const gfx::Vector2d& target_offset, @@ -3590,26 +3614,6 @@ layer_tree_view_->IsSurfaceSynchronizationEnabled(); } -void RenderWidget::PageScaleFactorChanged(float page_scale_factor, - bool is_pinch_gesture_active) { - // The page scale is controlled by the WebView for the local main frame of - // the Page. So this is called from blink by for the RenderWidget of that - // local main frame. We forward the value on to each child RenderWidget (each - // of which will be via proxy child frame). These will each in turn forward - // the message to their child RenderWidgets (through their proxy child - // frames). - DCHECK(!is_frozen_); - DCHECK(delegate()); - - for (auto& observer : render_frame_proxies_) { - observer.OnPageScaleFactorChanged(page_scale_factor, - is_pinch_gesture_active); - } - // Store the value to give to any new RenderFrameProxy that is registered. - page_scale_factor_from_mainframe_ = page_scale_factor; - is_pinch_gesture_active_from_mainframe_ = is_pinch_gesture_active; -} - void RenderWidget::UseSynchronousResizeModeForTesting(bool enable) { synchronous_resize_mode_for_testing_ = enable; }
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index e995071..2c91755 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h
@@ -445,9 +445,10 @@ bool down) override; void FallbackCursorModeSetCursorVisibility(bool visible) override; void SetAllowGpuRasterization(bool allow_gpu_raster) override; - void SetPageScaleFactorAndLimits(float page_scale_factor, - float minimum, - float maximum) override; + void SetPageScaleStateAndLimits(float page_scale_factor, + bool is_pinch_gesture_active, + float minimum, + float maximum) override; void StartPageScaleAnimation(const gfx::Vector2d& destination, bool use_anchor, float new_page_scale, @@ -624,9 +625,6 @@ bool IsSurfaceSynchronizationEnabled() const; - void PageScaleFactorChanged(float page_scale_factor, - bool is_pinch_gesture_active); - void UseSynchronousResizeModeForTesting(bool enable); void SetDeviceScaleFactorForTesting(float factor); void SetDeviceColorSpaceForTesting(const gfx::ColorSpace& color_space);
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc index 8722756f..42ba9c95 100644 --- a/content/shell/test_runner/test_runner.cc +++ b/content/shell/test_runner/test_runner.cc
@@ -178,7 +178,6 @@ void DumpPermissionClientCallbacks(); void DumpPingLoaderCallbacks(); void DumpResourceLoadCallbacks(); - void DumpResourceResponseMIMETypes(); void DumpSelectionRect(); void DumpSpellCheckCallbacks(); void DumpTitleChanges(); @@ -440,8 +439,6 @@ &TestRunnerBindings::DumpPingLoaderCallbacks) .SetMethod("dumpResourceLoadCallbacks", &TestRunnerBindings::DumpResourceLoadCallbacks) - .SetMethod("dumpResourceResponseMIMETypes", - &TestRunnerBindings::DumpResourceResponseMIMETypes) .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) .SetMethod("dumpSpellCheckCallbacks", &TestRunnerBindings::DumpSpellCheckCallbacks) @@ -1062,11 +1059,6 @@ runner_->DumpResourceLoadCallbacks(); } -void TestRunnerBindings::DumpResourceResponseMIMETypes() { - if (runner_) - runner_->DumpResourceResponseMIMETypes(); -} - void TestRunnerBindings::SetImagesAllowed(bool allowed) { if (runner_) runner_->SetImagesAllowed(allowed); @@ -1776,11 +1768,6 @@ web_test_runtime_flags_.dump_resource_load_callbacks(); } -bool TestRunner::shouldDumpResourceResponseMIMETypes() const { - return test_is_running_ && - web_test_runtime_flags_.dump_resource_response_mime_types(); -} - blink::WebContentSettingsClient* TestRunner::GetWebContentSettings() const { return mock_content_settings_client_.get(); } @@ -2320,11 +2307,6 @@ OnWebTestRuntimeFlagsChanged(); } -void TestRunner::DumpResourceResponseMIMETypes() { - web_test_runtime_flags_.set_dump_resource_response_mime_types(true); - OnWebTestRuntimeFlagsChanged(); -} - void TestRunner::SetImagesAllowed(bool allowed) { web_test_runtime_flags_.set_images_allowed(allowed); OnWebTestRuntimeFlagsChanged();
diff --git a/content/shell/test_runner/test_runner.h b/content/shell/test_runner/test_runner.h index fb9655b..48e1cb4a 100644 --- a/content/shell/test_runner/test_runner.h +++ b/content/shell/test_runner/test_runner.h
@@ -124,7 +124,6 @@ bool shouldDumpCreateView() const; bool canOpenWindows() const; bool shouldDumpResourceLoadCallbacks() const; - bool shouldDumpResourceResponseMIMETypes() const; bool shouldDumpSpellCheckCallbacks() const; bool shouldWaitUntilExternalURLLoad() const; const std::set<std::string>* httpHeadersToClear() const;
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc index f3390b7..f93e889 100644 --- a/content/shell/test_runner/web_frame_test_client.cc +++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -61,20 +61,6 @@ return url.substr(pos + 1); } -void PrintResponseDescription(WebTestDelegate* delegate, - const blink::WebURLResponse& response) { - if (response.IsNull()) { - delegate->PrintMessage("(null)"); - return; - } - delegate->PrintMessage( - base::StringPrintf("<NSURLResponse %s, http status code %d>", - DescriptionSuitableForTestResult( - response.CurrentRequestUrl().GetString().Utf8()) - .c_str(), - response.HttpStatusCode())); -} - void BlockRequest(blink::WebURLRequest& request) { request.SetUrl(GURL("255.255.255.255")); } @@ -464,28 +450,6 @@ test_runner()->is_web_platform_tests_mode())); } -void WebFrameTestClient::DidReceiveResponse( - const blink::WebURLResponse& response) { - if (test_runner()->shouldDumpResourceLoadCallbacks()) { - delegate_->PrintMessage(DescriptionSuitableForTestResult( - GURL(response.CurrentRequestUrl()).possibly_invalid_spec())); - delegate_->PrintMessage(" - didReceiveResponse "); - PrintResponseDescription(delegate_, response); - delegate_->PrintMessage("\n"); - } - if (test_runner()->shouldDumpResourceResponseMIMETypes()) { - GURL url = response.CurrentRequestUrl(); - blink::WebString mime_type = response.MimeType(); - delegate_->PrintMessage(url.ExtractFileName()); - delegate_->PrintMessage(" has MIME type "); - // Simulate NSURLResponse's mapping of empty/unknown MIME types to - // application/octet-stream - delegate_->PrintMessage(mime_type.IsEmpty() ? "application/octet-stream" - : mime_type.Utf8().data()); - delegate_->PrintMessage("\n"); - } -} - void WebFrameTestClient::DidAddMessageToConsole( const blink::WebConsoleMessage& message, const blink::WebString& source_name,
diff --git a/content/shell/test_runner/web_frame_test_client.h b/content/shell/test_runner/web_frame_test_client.h index 509f0bd..e5071b3 100644 --- a/content/shell/test_runner/web_frame_test_client.h +++ b/content/shell/test_runner/web_frame_test_client.h
@@ -70,7 +70,6 @@ void DidStopLoading() override; void DidDispatchPingLoader(const blink::WebURL& url) override; void WillSendRequest(blink::WebURLRequest& request) override; - void DidReceiveResponse(const blink::WebURLResponse& response) override; void CheckIfAudioSinkExistsAndIsAuthorized( const blink::WebString& sink_id, blink::WebSetSinkIdCompleteCallback completion_callback) override;
diff --git a/content/shell/test_runner/web_frame_test_proxy.cc b/content/shell/test_runner/web_frame_test_proxy.cc index 9efceb0..1cca8e2 100644 --- a/content/shell/test_runner/web_frame_test_proxy.cc +++ b/content/shell/test_runner/web_frame_test_proxy.cc
@@ -250,12 +250,6 @@ test_client_->WillSendRequest(request); } -void WebFrameTestProxy::DidReceiveResponse( - const blink::WebURLResponse& response) { - test_client_->DidReceiveResponse(response); - RenderFrameImpl::DidReceiveResponse(response); -} - void WebFrameTestProxy::BeginNavigation( std::unique_ptr<blink::WebNavigationInfo> info) { if (test_client_->ShouldContinueNavigation(info.get()))
diff --git a/content/shell/test_runner/web_frame_test_proxy.h b/content/shell/test_runner/web_frame_test_proxy.h index 765525e..13eeb9e 100644 --- a/content/shell/test_runner/web_frame_test_proxy.h +++ b/content/shell/test_runner/web_frame_test_proxy.h
@@ -71,7 +71,6 @@ const blink::WebContextMenuData& context_menu_data) override; void DidDispatchPingLoader(const blink::WebURL& url) override; void WillSendRequest(blink::WebURLRequest& request) override; - void DidReceiveResponse(const blink::WebURLResponse& response) override; void BeginNavigation(std::unique_ptr<blink::WebNavigationInfo> info) override; void PostAccessibilityEvent(const blink::WebAXObject& object, ax::mojom::Event event) override;
diff --git a/content/shell/test_runner/web_test_runtime_flags.cc b/content/shell/test_runner/web_test_runtime_flags.cc index b864bb1..49ddb9b 100644 --- a/content/shell/test_runner/web_test_runtime_flags.cc +++ b/content/shell/test_runner/web_test_runtime_flags.cc
@@ -45,7 +45,6 @@ set_dump_ping_loader_callbacks(false); set_dump_user_gesture_in_frame_load_callbacks(false); set_dump_resource_load_callbacks(false); - set_dump_resource_response_mime_types(false); set_dump_navigation_policy(false); set_dump_title_changes(false);
diff --git a/content/shell/test_runner/web_test_runtime_flags.h b/content/shell/test_runner/web_test_runtime_flags.h index 046044f..4dbf409e 100644 --- a/content/shell/test_runner/web_test_runtime_flags.h +++ b/content/shell/test_runner/web_test_runtime_flags.h
@@ -132,10 +132,6 @@ // load callback. DEFINE_BOOL_WEB_TEST_RUNTIME_FLAG(dump_resource_load_callbacks) - // If true, the test runner will output the MIME type for each resource that - // was loaded. - DEFINE_BOOL_WEB_TEST_RUNTIME_FLAG(dump_resource_response_mime_types) - // If true, content_shell will dump the default navigation policy passed to // WebLocalFrameClient::decidePolicyForNavigation. DEFINE_BOOL_WEB_TEST_RUNTIME_FLAG(dump_navigation_policy)
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index 72bd1e7..2c2cff8 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -251,7 +251,7 @@ # Passthrough command decoder / Windows / OpenGL / Intel # This case causes no-over-optimization-on-uniform-array fail. crbug.com/884210 [ opengl win passthrough intel ] conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html [ Skip ] -crbug.com/854100 [ opengl win passthrough intel ] conformance/glsl/variables/gl-pointcoord.html [ RetryOnFailure ] +crbug.com/854100 [ opengl win passthrough intel ] conformance/glsl/variables/gl-pointcoord.html [ Failure ] crbug.com/angleproject/2760 [ opengl win passthrough intel ] conformance2/renderbuffers/multisampled-depth-renderbuffer-initialization.html [ Failure ] crbug.com/912579 [ opengl win passthrough intel ] conformance2/rendering/out-of-bounds-index-buffers-after-copying.html [ RetryOnFailure ] crbug.com/602688 [ opengl win passthrough intel ] conformance/glsl/constructors/glsl-construct-mat2.html [ Failure ] @@ -261,6 +261,8 @@ crbug.com/602688 [ opengl win passthrough intel ] conformance2/glsl3/vector-dynamic-indexing.html [ Failure ] crbug.com/angleproject/2880 [ opengl win passthrough intel ] deqp/functional/gles3/shaderbuiltinvar.html [ Failure ] crbug.com/957631 [ opengl win passthrough intel ] conformance2/rendering/element-index-uint.html [ Failure ] +crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_linear_greater.html [ RetryOnFailure ] +crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html [ RetryOnFailure ] crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html [ RetryOnFailure ] crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html [ RetryOnFailure ] crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_linear_not_equal.html [ RetryOnFailure ] @@ -268,6 +270,7 @@ crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_nearest_greater.html [ RetryOnFailure ] crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html [ RetryOnFailure ] crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html [ RetryOnFailure ] +crbug.com/963450 [ opengl win passthrough intel ] deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html [ RetryOnFailure ] # Passthrough command decoder / Linux / OpenGL / NVIDIA crbug.com/773861 [ opengl linux passthrough nvidia ] conformance/textures/image_bitmap_from_video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html [ Failure ]
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_browsertest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_browsertest.cc index 1391980..6b70fc5 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_browsertest.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_browsertest.cc
@@ -152,6 +152,27 @@ int basic_count_ = 0; }; +// TODO(mcnee): These tests are BrowserPlugin specific. Once +// MimeHandlerViewGuest is no longer based on BrowserPlugin, remove these tests. +// (See https://crbug.com/533069 and https://crbug.com/659750). These category +// of tests are solely testing BrowserPlugin features. +class MimeHandlerViewBrowserPluginSpecificTest : public MimeHandlerViewTest { + public: + MimeHandlerViewBrowserPluginSpecificTest() {} + + ~MimeHandlerViewBrowserPluginSpecificTest() override {} + + void SetUpCommandLine(base::CommandLine* cl) override { + MimeHandlerViewTest::SetUpCommandLine(cl); + scoped_feature_list_.InitAndDisableFeature( + features::kMimeHandlerViewInCrossProcessFrame); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; + DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewBrowserPluginSpecificTest); +}; + // The parametric version of the test class which runs the test both on // BrowserPlugin-based and cross-process-frame-based MimeHandlerView // implementation. All current browser tests should eventually be moved to this @@ -432,7 +453,8 @@ RunTest("test_embedded_data_url_long.html"); } -IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, ResizeBeforeAttach) { +IN_PROC_BROWSER_TEST_F(MimeHandlerViewBrowserPluginSpecificTest, + ResizeBeforeAttach) { // Delay the creation of the guest's WebContents in order to delay the guest's // attachment to the embedder. This will allow us to resize the <object> tag // after the guest is created, but before it is attached in @@ -511,27 +533,6 @@ before_unload_dialog->OnAccept(base::string16(), false); } -// TODO(mcnee): These tests are BrowserPlugin specific. Once -// MimeHandlerViewGuest is no longer based on BrowserPlugin, remove these tests. -// (See https://crbug.com/533069 and https://crbug.com/659750). These category -// of tests are solely testing BrowserPlugin features. -class MimeHandlerViewBrowserPluginSpecificTest : public MimeHandlerViewTest { - public: - MimeHandlerViewBrowserPluginSpecificTest() {} - - ~MimeHandlerViewBrowserPluginSpecificTest() override {} - - void SetUpCommandLine(base::CommandLine* cl) override { - MimeHandlerViewTest::SetUpCommandLine(cl); - scoped_feature_list_.InitAndDisableFeature( - features::kMimeHandlerViewInCrossProcessFrame); - } - - private: - base::test::ScopedFeatureList scoped_feature_list_; - DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewBrowserPluginSpecificTest); -}; - // This test verifies that when BrowserPlugin-based guest has touch handlers, // the embedder knows about it. IN_PROC_BROWSER_TEST_F(MimeHandlerViewBrowserPluginSpecificTest,
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.cc b/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.cc index ad69747..d78323d 100644 --- a/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.cc +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.cc
@@ -60,10 +60,10 @@ } void WiFiDisplayMediaPipeline::InsertRawVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, base::TimeTicks reference_time) { DCHECK(video_encoder_); - video_encoder_->InsertRawVideoFrame(video_frame, reference_time); + video_encoder_->InsertRawVideoFrame(std::move(video_frame), reference_time); } void WiFiDisplayMediaPipeline::RequestIDRPicture() {
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.h b/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.h index 5caac63..2fbaecf6 100644 --- a/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.h +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_media_pipeline.h
@@ -48,9 +48,8 @@ // Note: to be called only once. void Initialize(const InitCompletionCallback& callback); - void InsertRawVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, - base::TimeTicks reference_time); + void InsertRawVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks reference_time); void RequestIDRPicture();
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.cc b/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.cc index 5980398..fc278e2 100644 --- a/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.cc +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.cc
@@ -81,14 +81,14 @@ } void WiFiDisplayVideoEncoder::InsertRawVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, base::TimeTicks reference_time) { DCHECK(client_thread_checker_.CalledOnValidThread()); DCHECK(!encoded_callback_.is_null()); media_task_runner_->PostTask( FROM_HERE, base::BindOnce(&WiFiDisplayVideoEncoder::InsertFrameOnMediaThread, this, - video_frame, reference_time, send_idr_)); + std::move(video_frame), reference_time, send_idr_)); send_idr_ = false; }
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.h b/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.h index 1ad49ab..d1fe0c7 100644 --- a/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.h +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_video_encoder.h
@@ -72,7 +72,7 @@ // Encodes the given raw frame. The resulting encoded frame is passed // as an |encoded_callback|'s argument which is set via 'SetCallbacks' // method. - void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, + void InsertRawVideoFrame(scoped_refptr<media::VideoFrame> video_frame, base::TimeTicks reference_time); // Requests the next encoded frame to be an instantaneous decoding refresh
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index 85e39b5..39babe1 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -594,7 +594,6 @@ } - (void)dealloc { - net::RequestTracker::SetRequestTrackerFactory(nullptr); [NSObject cancelPreviousPerformRequestsWithTarget:self]; }
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index 73461ca..47428dc 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -789,6 +789,12 @@ <message name="IDS_IOS_ICON_SEARCH" desc="Accessibility label for the search icon [iOS only]."> Search </message> + <message name="IDS_IOS_INFOBAR_BANNER_DISMISS_HINT" desc="Accessibility hint that indicates the user that can dismiss the Infobar Banner. [Length:Unlimited]"> + Dismiss + </message> + <message name="IDS_IOS_INFOBAR_BANNER_OPTIONS_HINT" desc="Accessibility hint that indicates the user that can get more options for the Infobar banner. [Length:Unlimited]"> + More Options + </message> <message name="IDS_IOS_INFOBAR_BADGES_PASSWORD_HINT" desc="The iOS infobar badge item for saving password credentials [Length:Unlimited]"> Options to Save Password </message>
diff --git a/ios/chrome/browser/metrics/ukm_egtest.mm b/ios/chrome/browser/metrics/ukm_egtest.mm index 96309d2..1edcd82 100644 --- a/ios/chrome/browser/metrics/ukm_egtest.mm +++ b/ios/chrome/browser/metrics/ukm_egtest.mm
@@ -21,7 +21,6 @@ #include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/app/chrome_test_util.h" -#import "ios/chrome/test/app/sync_test_util.h" #import "ios/chrome/test/app/tab_test_util.h" #import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" @@ -44,7 +43,6 @@ using chrome_test_util::ClearBrowsingDataView; using chrome_test_util::GetIncognitoTabCount; using chrome_test_util::IsIncognitoMode; -using chrome_test_util::IsSyncInitialized; using chrome_test_util::SettingsAccountButton; using chrome_test_util::SettingsDoneButton; using chrome_test_util::SettingsMenuPrivacyButton; @@ -99,15 +97,6 @@ // Constant for timeout while waiting for asynchronous sync and UKM operations. const NSTimeInterval kSyncUKMOperationsTimeout = 10.0; -void AssertSyncInitialized(bool is_initialized) { - ConditionBlock condition = ^{ - return IsSyncInitialized() == is_initialized; - }; - GREYAssert(base::test::ios::WaitUntilConditionOrTimeout( - kSyncUKMOperationsTimeout, condition), - @"Failed to assert whether Sync was initialized or not."); -} - void AssertUKMEnabled(bool is_enabled) { ConditionBlock condition = ^{ return metrics::UkmEGTestHelper::ukm_enabled() == is_enabled; @@ -227,12 +216,16 @@ - (void)setUp { [super setUp]; - AssertSyncInitialized(false); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:NO + syncTimeout:kSyncUKMOperationsTimeout]); AssertUKMEnabled(false); // Enable sync. [SigninEarlGreyUI signinWithIdentity:[SigninEarlGreyUtils fakeIdentity1]]; - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncUKMOperationsTimeout]); // Grant metrics consent and update MetricsServicesManager. GREYAssert(!g_metrics_enabled, @"Unpaired set/reset of user consent."); @@ -245,7 +238,9 @@ } - (void)tearDown { - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncUKMOperationsTimeout]); AssertUKMEnabled(true); // Revoke metrics consent and update MetricsServicesManager. @@ -259,8 +254,10 @@ // Disable sync. SignOut(); - AssertSyncInitialized(false); - chrome_test_util::ClearSyncServerData(); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:NO + syncTimeout:kSyncUKMOperationsTimeout]); + [ChromeEarlGrey clearSyncServerData]; [super tearDown]; } @@ -431,7 +428,7 @@ // Reset sync back to original state. SignOut(); - chrome_test_util::ClearSyncServerData(); + [ChromeEarlGrey clearSyncServerData]; [SigninEarlGreyUI signinWithIdentity:[SigninEarlGreyUtils fakeIdentity1]]; AssertUKMEnabled(true); }
diff --git a/ios/chrome/browser/ntp_tiles/ntp_tiles_egtest.mm b/ios/chrome/browser/ntp_tiles/ntp_tiles_egtest.mm index 809773b..2304989 100644 --- a/ios/chrome/browser/ntp_tiles/ntp_tiles_egtest.mm +++ b/ios/chrome/browser/ntp_tiles/ntp_tiles_egtest.mm
@@ -35,7 +35,7 @@ @implementation NTPTilesTest - (void)tearDown { - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [super tearDown]; } @@ -49,7 +49,7 @@ web::test::SetUpSimpleHttpServer(responses); // Clear history and verify that the tile does not exist. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey openNewTab]); [[EarlGrey selectElementWithMatcher: @@ -93,7 +93,7 @@ web::test::SetUpHttpServer(std::move(provider)); // Clear history and verify that the tile does not exist. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey openNewTab]); [[EarlGrey selectElementWithMatcher: chrome_test_util::StaticTextWithAccessibilityLabel(@"title2")]
diff --git a/ios/chrome/browser/prerender/prerender_egtest.mm b/ios/chrome/browser/prerender/prerender_egtest.mm index 09f00b5..2b95210 100644 --- a/ios/chrome/browser/prerender/prerender_egtest.mm +++ b/ios/chrome/browser/prerender/prerender_egtest.mm
@@ -61,7 +61,7 @@ @"Disabled for iPad due to alternate letters educational screen."); } - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; // Set server up. self.testServer->RegisterRequestHandler( base::BindRepeating(&StandardResponse));
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index d5a0370..727a0c38 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -745,10 +745,10 @@ // -------------------------- // Whether the given tab's URL is an application specific URL. - (BOOL)isTabNativePage:(Tab*)tab; -// Add all delegates to the provided |tab|. -- (void)installDelegatesForTab:(Tab*)tab; -// Remove delegates from the provided |tab|. -- (void)uninstallDelegatesForTab:(Tab*)tab; +// Add all delegates to the provided |webState|. +- (void)installDelegatesForWebState:(web::WebState*)webState; +// Remove delegates from the provided |webState|. +- (void)uninstallDelegatesForWebState:(web::WebState*)webState; // Called when a |webState| is selected in the WebStateList. Make any required // view changes. The notification will not be sent when the |webState| is // already the selected WebState. |notifyToolbar| indicates whether the toolbar @@ -1432,8 +1432,9 @@ // Uninstall delegates so that any delegate callbacks triggered by subsequent // WebStateDestroyed() signals are not handled. - for (NSUInteger index = 0; index < self.tabModel.count; ++index) - [self uninstallDelegatesForTab:[self.tabModel tabAtIndex:index]]; + WebStateList* webStateList = self.tabModel.webStateList; + for (int index = 0; index < webStateList->count(); ++index) + [self uninstallDelegatesForWebState:webStateList->GetWebStateAt(index)]; // Disconnect child coordinators. [_activityServiceCoordinator disconnect]; @@ -1933,9 +1934,9 @@ UrlLoadingNotifierFactory::GetForBrowserState(_browserState); urlLoadingNotifier->AddObserver(_URLLoadingObserverBridge.get()); - NSUInteger count = self.tabModel.count; - for (NSUInteger index = 0; index < count; ++index) - [self installDelegatesForTab:[self.tabModel tabAtIndex:index]]; + WebStateList* webStateList = self.tabModel.webStateList; + for (int index = 0; index < webStateList->count(); ++index) + [self installDelegatesForWebState:webStateList->GetWebStateAt(index)]; self.imageSaver = [[ImageSaver alloc] initWithBaseViewController:self]; self.imageCopier = [[ImageCopier alloc] initWithBaseViewController:self]; @@ -2715,48 +2716,51 @@ return web::GetWebClient()->IsAppSpecificURL(visibleItem->GetURL()); } -- (void)installDelegatesForTab:(Tab*)tab { - // Unregistration happens when the Tab is removed from the TabModel. - DCHECK_NE(tab.webState->GetDelegate(), _webStateDelegate.get()); +- (void)installDelegatesForWebState:(web::WebState*)webState { + // Unregistration happens when the WebState is removed from the WebStateList. + DCHECK_NE(webState->GetDelegate(), _webStateDelegate.get()); // There should be no pre-rendered Tabs in TabModel. PrerenderService* prerenderService = PrerenderServiceFactory::GetForBrowserState(_browserState); DCHECK(!prerenderService || - !prerenderService->IsWebStatePrerendered(tab.webState)); + !prerenderService->IsWebStatePrerendered(webState)); - SnapshotTabHelper::FromWebState(tab.webState)->SetDelegate(self); + SnapshotTabHelper::FromWebState(webState)->SetDelegate(self); // TODO(crbug.com/777557): do not pass the dispatcher to PasswordTabHelper. if (PasswordTabHelper* passwordTabHelper = - PasswordTabHelper::FromWebState(tab.webState)) { + PasswordTabHelper::FromWebState(webState)) { passwordTabHelper->SetBaseViewController(self); passwordTabHelper->SetDispatcher(self.dispatcher); passwordTabHelper->SetPasswordControllerDelegate(self); } if (!IsIPadIdiom()) { - OverscrollActionsTabHelper::FromWebState(tab.webState)->SetDelegate(self); + OverscrollActionsTabHelper::FromWebState(webState)->SetDelegate(self); } + + // TODO(crbug.com/960950): Remove this once webController is moved out of tab. + Tab* tab = LegacyTabHelper::GetTabForWebState(webState); + // Install the proper CRWWebController delegates. tab.webController.nativeProvider = self; tab.webController.swipeRecognizerProvider = self.sideSwipeController; tab.webState->SetDelegate(_webStateDelegate.get()); - SadTabTabHelper::FromWebState(tab.webState)->SetDelegate(_sadTabCoordinator); - NetExportTabHelper::CreateForWebState(tab.webState, self); - CaptivePortalDetectorTabHelper::CreateForWebState(tab.webState, self); + SadTabTabHelper::FromWebState(webState)->SetDelegate(_sadTabCoordinator); + NetExportTabHelper::CreateForWebState(webState, self); + CaptivePortalDetectorTabHelper::CreateForWebState(webState, self); if (reading_list::IsOfflinePageWithoutNativeContentEnabled()) { OfflinePageTabHelper::CreateForWebState( - tab.webState, - ReadingListModelFactory::GetForBrowserState(_browserState)); + webState, ReadingListModelFactory::GetForBrowserState(_browserState)); } // DownloadManagerTabHelper cannot function without delegate. DCHECK(_downloadManagerCoordinator); - DownloadManagerTabHelper::CreateForWebState(tab.webState, + DownloadManagerTabHelper::CreateForWebState(webState, _downloadManagerCoordinator); - NewTabPageTabHelper::CreateForWebState(tab.webState, self); + NewTabPageTabHelper::CreateForWebState(webState, self); // The language detection helper accepts a callback from the translate // client, so must be created after it. @@ -2764,42 +2768,46 @@ // (this only comes up in unit tests), so check for that and bypass the // init of the translation helpers if needed. // TODO(crbug.com/785238): Remove the need for this check. - if (tab.webState->GetJSInjectionReceiver()) { + if (webState->GetJSInjectionReceiver()) { language::IOSLanguageDetectionTabHelper::CreateForWebState( - tab.webState, + webState, UrlLanguageHistogramFactory::GetForBrowserState(self.browserState)); - ChromeIOSTranslateClient::CreateForWebState(tab.webState); + ChromeIOSTranslateClient::CreateForWebState(webState); } if (AccountConsistencyService* accountConsistencyService = ios::AccountConsistencyServiceFactory::GetForBrowserState( self.browserState)) { - accountConsistencyService->SetWebStateHandler(tab.webState, self); + accountConsistencyService->SetWebStateHandler(webState, self); } } -- (void)uninstallDelegatesForTab:(Tab*)tab { - DCHECK_EQ(tab.webState->GetDelegate(), _webStateDelegate.get()); +- (void)uninstallDelegatesForWebState:(web::WebState*)webState { + DCHECK_EQ(webState->GetDelegate(), _webStateDelegate.get()); // TODO(crbug.com/777557): do not pass the dispatcher to PasswordTabHelper. if (PasswordTabHelper* passwordTabHelper = - PasswordTabHelper::FromWebState(tab.webState)) { + PasswordTabHelper::FromWebState(webState)) { passwordTabHelper->SetDispatcher(nil); } if (!IsIPadIdiom()) { - OverscrollActionsTabHelper::FromWebState(tab.webState)->SetDelegate(nil); + OverscrollActionsTabHelper::FromWebState(webState)->SetDelegate(nil); } + + // TODO(crbug.com/960950): Remove this once webController is moved out of tab. + Tab* tab = LegacyTabHelper::GetTabForWebState(webState); + tab.webController.nativeProvider = nil; tab.webController.swipeRecognizerProvider = nil; - tab.webState->SetDelegate(nullptr); + webState->SetDelegate(nullptr); if (AccountConsistencyService* accountConsistencyService = ios::AccountConsistencyServiceFactory::GetForBrowserState( self.browserState)) { - accountConsistencyService->RemoveWebStateHandler(tab.webState); + accountConsistencyService->RemoveWebStateHandler(webState); } - SnapshotTabHelper::FromWebState(tab.webState)->SetDelegate(nil); + SnapshotTabHelper::FromWebState(webState)->SetDelegate(nil); } - (void)webStateSelected:(web::WebState*)webState @@ -4355,6 +4363,27 @@ [self webStateSelected:newWebState notifyToolbar:YES]; } +// A WebState has been removed, remove its views from display if necessary. +- (void)webStateList:(WebStateList*)webStateList + didDetachWebState:(web::WebState*)webState + atIndex:(int)atIndex { + webState->WasHidden(); + webState->SetKeepRenderProcessAlive(false); + + [self uninstallDelegatesForWebState:webState]; + + // Cancel dialogs for |webState|. + [self.dialogPresenter cancelDialogForWebState:webState]; + + // Ignore changes while the tab grid is visible (or while suspended). + // The display will be refreshed when this view becomes active again. + if (!self.visible || !self.webUsageEnabled) + return; + + // Remove the find bar for now. + [self hideFindBarWithAnimation:NO]; +} + - (void)webStateList:(WebStateList*)webStateList willDetachWebState:(web::WebState*)webState atIndex:(int)atIndex { @@ -4379,7 +4408,7 @@ atIndex:(NSUInteger)modelIndex inForeground:(BOOL)fg { DCHECK(tab); - [self installDelegatesForTab:tab]; + [self installDelegatesForWebState:tab.webState]; if (fg) { [_paymentRequestManager setActiveWebState:tab.webState]; @@ -4467,8 +4496,8 @@ didReplaceTab:(Tab*)oldTab withTab:(Tab*)newTab atIndex:(NSUInteger)index { - [self uninstallDelegatesForTab:oldTab]; - [self installDelegatesForTab:newTab]; + [self uninstallDelegatesForWebState:oldTab.webState]; + [self installDelegatesForWebState:newTab.webState]; // Add |newTab|'s view to the hierarchy if it's the current Tab. if (self.active && model.currentTab == newTab) @@ -4478,27 +4507,6 @@ [_paymentRequestManager setActiveWebState:newTab.webState]; } -// A tab has been removed, remove its views from display if necessary. -- (void)tabModel:(TabModel*)model - didRemoveTab:(Tab*)tab - atIndex:(NSUInteger)index { - tab.webState->WasHidden(); - tab.webState->SetKeepRenderProcessAlive(false); - - [self uninstallDelegatesForTab:tab]; - - // Cancel dialogs for |tab|'s WebState. - [self.dialogPresenter cancelDialogForWebState:tab.webState]; - - // Ignore changes while the tab stack view is visible (or while suspended). - // The display will be refreshed when this view becomes active again. - if (!self.visible || !self.webUsageEnabled) - return; - - // Remove the find bar for now. - [self hideFindBarWithAnimation:NO]; -} - #pragma mark - TabModelObserver helpers (new tab animations) - (void)animateNewTab:(Tab*)tab
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm index 23831e3..7605730 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm
@@ -184,7 +184,7 @@ - (void)tearDown { self.provider->FireCategoryStatusChanged( self.category, CategoryStatus::ALL_SUGGESTIONS_EXPLICITLY_DISABLED); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [super tearDown]; } @@ -490,7 +490,7 @@ NSString* pageTitle = base::SysUTF8ToNSString(kPageTitle); // Clear history and verify that the tile does not exist. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey loadURL:pageURL]); CHROME_EG_ASSERT_NO_ERROR( [ChromeEarlGrey waitForWebViewContainingText:kPageLoadedString]);
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm index e78c997..5e7fd08 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
@@ -722,7 +722,7 @@ const GURL pageURL = self.testServer->GetURL(kPageURL); // Clear history to ensure the tile will be shown. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey loadURL:pageURL]); CHROME_EG_ASSERT_NO_ERROR( [ChromeEarlGrey waitForWebViewContainingText:kPageLoadedString]);
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm index 7ebee1d..28f3813e 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm
@@ -96,7 +96,7 @@ "http://ios/testing/data/http_server_files/two_pages.pdf"); CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey loadURL:URL]); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; // Initial y scroll positions are set to make room for the toolbar. // TODO(crbug.com/618887) Replace use of specific values when API which @@ -137,12 +137,12 @@ selectElementWithMatcher:WebViewScrollView( chrome_test_util::GetCurrentWebState())] performAction:grey_swipeFastInDirection(kGREYDirectionDown)]; - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; // Test that the toolbar is still visible even after attempting to hide it // on swipe up. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; // Reenable synchronization. if (@available(iOS 12, *)) { @@ -171,18 +171,18 @@ // Test that the toolbar is hidden after a user swipes up. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Test that the toolbar is visible after a user swipes down. [[EarlGrey selectElementWithMatcher:WebViewScrollView( chrome_test_util::GetCurrentWebState())] performAction:grey_swipeFastInDirection(kGREYDirectionDown)]; - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; // Test that the toolbar is hidden after a user swipes up. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; } // Tests that link clicks from a chrome:// to chrome:// link result in the @@ -227,12 +227,12 @@ // Scroll to hide the UI. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Test that the toolbar is visible when moving from one chrome:// link to // another chrome:// link. GREYAssert(TapWebViewElementWithId("version"), @"Failed to tap \"version\""); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } // Tests hiding and showing of the header with a user scroll on a long page. @@ -245,16 +245,16 @@ web::test::SetUpSimpleHttpServer(responses); CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey loadURL:URL]); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; // Simulate a user scroll down. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Simulate a user scroll up. [[EarlGrey selectElementWithMatcher:WebViewScrollView( chrome_test_util::GetCurrentWebState())] performAction:grey_swipeFastInDirection(kGREYDirectionDown)]; - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } // Tests that reloading of a page shows the header even if it was not shown @@ -276,12 +276,12 @@ // Hide the toolbar. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; GREYAssert(TapWebViewElementWithId("link"), @"Failed to tap \"link\""); // Main test is here: Make sure the header is still visible! - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } // Test to make sure the header is shown when a Tab opened by the current Tab is @@ -319,7 +319,7 @@ // Hide the toolbar. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Open new window. GREYAssert(TapWebViewElementWithId("link1"), @"Failed to tap \"link1\""); @@ -333,7 +333,7 @@ // Hide the toolbar. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Close the tab by tapping link2. NSError* error = nil; @@ -354,7 +354,7 @@ // Make sure the toolbar is on the screen. CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey waitForMainTabCount:1]); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } // Tests that the header is shown when a regular page (non-native page) is @@ -385,7 +385,7 @@ [ChromeEarlGrey waitForWebViewContainingText:"link1"]); // Dismiss the toolbar. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Navigate to the other page. GREYAssert(TapWebViewElementWithId("link1"), @"Failed to tap \"link1\""); @@ -393,17 +393,17 @@ [ChromeEarlGrey waitForWebViewContainingText:"link2"]); // Make sure toolbar is shown since a new load has started. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; // Dismiss the toolbar. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Go back. GREYAssert(TapWebViewElementWithId("link2"), @"Failed to tap \"link2\""); // Make sure the toolbar has loaded now that a new page has loaded. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } // Tests that the header is shown when a native page is loaded from a page where @@ -426,13 +426,13 @@ // Dismiss the toolbar. HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; // Go back to NTP, which is a native view. GREYAssert(TapWebViewElementWithId("link"), @"Failed to tap \"link\""); // Make sure the toolbar is visible now that a new page has loaded. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } // Tests that the header is shown when loading an error page in a native view @@ -453,11 +453,11 @@ CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey loadURL:URL]); HideToolbarUsingUI(); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:NO]); + [ChromeEarlGreyUI waitForToolbarVisible:NO]; GREYAssert(TapWebViewElementWithId("link"), @"Failed to tap \"link\""); AssertURLIs(ErrorPageResponseProvider::GetDnsFailureUrl()); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; } @end
diff --git a/ios/chrome/browser/ui/history/history_ui_egtest.mm b/ios/chrome/browser/ui/history/history_ui_egtest.mm index f8db91be..a286b48f 100644 --- a/ios/chrome/browser/ui/history/history_ui_egtest.mm +++ b/ios/chrome/browser/ui/history/history_ui_egtest.mm
@@ -149,7 +149,7 @@ _URL1 = web::test::HttpServer::MakeUrl(kURL1); _URL2 = web::test::HttpServer::MakeUrl(kURL2); _URL3 = web::test::HttpServer::MakeUrl(kURL3); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; // Some tests rely on a clean state for the "Clear Browsing Data" settings // screen. [self resetBrowsingDataPrefs];
diff --git a/ios/chrome/browser/ui/infobars/banners/BUILD.gn b/ios/chrome/browser/ui/infobars/banners/BUILD.gn index c4fcb57..55938ac 100644 --- a/ios/chrome/browser/ui/infobars/banners/BUILD.gn +++ b/ios/chrome/browser/ui/infobars/banners/BUILD.gn
@@ -12,8 +12,10 @@ deps = [ ":public", "//base", + "//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/browser/infobars:public", "//ios/chrome/browser/ui/util", + "//ui/base", ] }
diff --git a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h index 82a941f..088b1816 100644 --- a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h +++ b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h
@@ -38,6 +38,10 @@ // The button text displayed by this InfobarBanner. @property(nonatomic, copy) NSString* buttonText; +// Optional A11y label. If set it will be used as the Banner A11y label instead +// of the default combination of Title and Subtitle texts. +@property(nonatomic, copy) NSString* optionalAccessibilityLabel; + // - If no interaction is occuring, the InfobarBanner will be dismissed. // - If there's some interaction occuring the InfobarBanner will be dismissed // once this interaction ends.
diff --git a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm index e9cdfbe..a444db3 100644 --- a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm +++ b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm
@@ -8,6 +8,8 @@ #import "ios/chrome/browser/ui/infobars/banners/infobar_banner_constants.h" #import "ios/chrome/browser/ui/infobars/banners/infobar_banner_delegate.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -357,13 +359,16 @@ selector:@selector(acceptInfobar)]; UIAccessibilityCustomAction* dismissAction = - [[UIAccessibilityCustomAction alloc] initWithName:@"Dismiss" - target:self - selector:@selector(dismiss)]; + [[UIAccessibilityCustomAction alloc] + initWithName:l10n_util::GetNSString( + IDS_IOS_INFOBAR_BANNER_DISMISS_HINT) + target:self + selector:@selector(dismiss)]; UIAccessibilityCustomAction* expandAction = [[UIAccessibilityCustomAction alloc] - initWithName:@"More options" + initWithName:l10n_util::GetNSString( + IDS_IOS_INFOBAR_BANNER_OPTIONS_HINT) target:self selector:@selector(presentInfobarModal)]; @@ -387,6 +392,8 @@ } - (NSString*)accessibilityLabel { + if ([self.optionalAccessibilityLabel length]) + return self.optionalAccessibilityLabel; NSString* accessibilityLabel = self.titleText; if ([self.subTitleText length]) { accessibilityLabel =
diff --git a/ios/chrome/browser/ui/infobars/coordinators/BUILD.gn b/ios/chrome/browser/ui/infobars/coordinators/BUILD.gn index 079f018..8aa5501 100644 --- a/ios/chrome/browser/ui/infobars/coordinators/BUILD.gn +++ b/ios/chrome/browser/ui/infobars/coordinators/BUILD.gn
@@ -16,6 +16,7 @@ deps = [ "//base", "//components/infobars/core", + "//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/browser/infobars:public", "//ios/chrome/browser/infobars:public", "//ios/chrome/browser/passwords:infobar_delegates", @@ -30,5 +31,6 @@ "//ios/chrome/browser/ui/infobars/presentation", "//ios/chrome/browser/ui/table_view", "//ios/chrome/browser/ui/util", + "//ui/base", ] }
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm b/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm index 8e54818..9534fe3 100644 --- a/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm +++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm
@@ -15,6 +15,8 @@ #import "ios/chrome/browser/ui/infobars/infobar_container.h" #import "ios/chrome/browser/ui/infobars/modals/infobar_password_modal_delegate.h" #import "ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -79,6 +81,11 @@ ConfirmInfoBarDelegate::BUTTON_OK)); self.bannerViewController.iconImage = [UIImage imageNamed:@"infobar_passwords_icon"]; + NSString* hiddenPasswordText = + l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_HIDDEN_LABEL); + self.bannerViewController.optionalAccessibilityLabel = [NSString + stringWithFormat:@"%@,%@, %@", self.bannerViewController.titleText, + username, hiddenPasswordText]; } }
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_egtest.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_egtest.mm index 6aff2728..ff2181a 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_egtest.mm +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_egtest.mm
@@ -104,7 +104,7 @@ base::BindRepeating(&StandardResponse)); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start."); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; } // Tests that tapping the switch to open tab button, switch to the open tab,
diff --git a/ios/chrome/browser/ui/omnibox/popup/shortcuts/shortcuts_egtest.mm b/ios/chrome/browser/ui/omnibox/popup/shortcuts/shortcuts_egtest.mm index daad6e2a..b082c97 100644 --- a/ios/chrome/browser/ui/omnibox/popup/shortcuts/shortcuts_egtest.mm +++ b/ios/chrome/browser/ui/omnibox/popup/shortcuts/shortcuts_egtest.mm
@@ -83,7 +83,7 @@ base::BindRepeating(&StandardResponse)); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start."); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [self prepareMostVisitedTiles]; // Clear pasteboard [[UIPasteboard generalPasteboard] setItems:@[]];
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm index 520108b..fe2933c 100644 --- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm +++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm
@@ -84,7 +84,7 @@ @implementation RecentTabsTestCase - (void)setUp { - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [super setUp]; web::test::SetUpSimpleHttpServer(std::map<GURL, std::string>{{ web::test::HttpServer::MakeUrl(kURLOfTestPage),
diff --git a/ios/chrome/browser/ui/settings/BUILD.gn b/ios/chrome/browser/ui/settings/BUILD.gn index a55fd1f1..f95dd53 100644 --- a/ios/chrome/browser/ui/settings/BUILD.gn +++ b/ios/chrome/browser/ui/settings/BUILD.gn
@@ -56,6 +56,11 @@ "import_data_table_view_controller.mm", "language_details_table_view_controller.h", "language_details_table_view_controller.mm", + "language_settings_commands.h", + "language_settings_consumer.h", + "language_settings_data_source.h", + "language_settings_mediator.h", + "language_settings_mediator.mm", "language_settings_table_view_controller.h", "language_settings_table_view_controller.mm", "material_cell_catalog_view_controller.h",
diff --git a/ios/chrome/browser/ui/settings/cells/language_item.h b/ios/chrome/browser/ui/settings/cells/language_item.h index 1bb3b790..a497492 100644 --- a/ios/chrome/browser/ui/settings/cells/language_item.h +++ b/ios/chrome/browser/ui/settings/cells/language_item.h
@@ -7,15 +7,28 @@ #import "ios/chrome/browser/ui/table_view/cells/table_view_multi_detail_text_item.h" +#include <string> + // Contains the model data for a language in the Language Settings page. @interface LanguageItem : TableViewMultiDetailTextItem // The language code for this language. @property(nonatomic, assign) std::string languageCode; +// The language code for this language used by the Translate server. +@property(nonatomic, assign) std::string canonicalLanguageCode; + // Whether the language is Translate-blocked. @property(nonatomic, getter=isBlocked) BOOL blocked; +// Whether the language is supported by the Translate server. +@property(nonatomic) BOOL supportsTranslate; + +// Whether Translate can be offered for the language (it can be unblocked). This +// must be false if |supportsTranslate| is false. It can however be false for +// other reasons such as the language being the last Translate-blocked language. +@property(nonatomic) BOOL canOfferTranslate; + @end #endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_LANGUAGE_ITEM_H_
diff --git a/ios/chrome/browser/ui/settings/language_details_table_view_controller.h b/ios/chrome/browser/ui/settings/language_details_table_view_controller.h index 9cfe058..64d5388 100644 --- a/ios/chrome/browser/ui/settings/language_details_table_view_controller.h +++ b/ios/chrome/browser/ui/settings/language_details_table_view_controller.h
@@ -5,10 +5,15 @@ #ifndef IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_DETAILS_TABLE_VIEW_CONTROLLER_H_ #define IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_DETAILS_TABLE_VIEW_CONTROLLER_H_ +#include <string> + #import "ios/chrome/browser/ui/settings/settings_root_table_view_controller.h" @class LanguageDetailsTableViewController; +@class LanguageItem; +// Protocol used by LanguageDetailsTableViewController to communicate to its +// delegate. @protocol LanguageDetailsTableViewControllerDelegate // Informs the delegate that user selected whether or not to offer Translate for @@ -16,28 +21,25 @@ - (void)languageDetailsTableViewController: (LanguageDetailsTableViewController*)tableViewController didSelectOfferTranslate:(BOOL)offerTranslate - languageCode:(NSString*)languageCode; + languageCode:(const std::string&)languageCode; @end -// Controller for the UI that allows the user to change the settings for a given -// language, i.e., to choose whether or not Translate should be offered for it. +// Controller for the UI that allows the user to choose whether or not Translate +// should be offered for a given language. @interface LanguageDetailsTableViewController : SettingsRootTableViewController -// The designated initializer. -- (instancetype)initWithLanguageCode:(NSString*)languageCode - languageName:(NSString*)languageName - blocked:(BOOL)blocked - canOfferTranslate:(BOOL)canOfferTranslate - NS_DESIGNATED_INITIALIZER; +// The designated initializer. |languageItem| and |delegate| must not be nil. +// |delegate| will not be retained. +- (instancetype)initWithLanguageItem:(LanguageItem*)languageItem + delegate: + (id<LanguageDetailsTableViewControllerDelegate>) + delegate NS_DESIGNATED_INITIALIZER; - (instancetype)initWithTableViewStyle:(UITableViewStyle)style appBarStyle: (ChromeTableViewControllerStyle)appBarStyle NS_UNAVAILABLE; -@property(nonatomic, weak) id<LanguageDetailsTableViewControllerDelegate> - delegate; - @end #endif // IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_DETAILS_TABLE_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/settings/language_details_table_view_controller.mm b/ios/chrome/browser/ui/settings/language_details_table_view_controller.mm index 9d97874..5b0f2eb1 100644 --- a/ios/chrome/browser/ui/settings/language_details_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/language_details_table_view_controller.mm
@@ -5,7 +5,9 @@ #import "ios/chrome/browser/ui/settings/language_details_table_view_controller.h" #include "base/feature_list.h" +#import "ios/chrome/browser/ui/settings/cells/language_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h" +#import "ios/chrome/browser/ui/settings/language_settings_data_source.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h" #include "ios/chrome/browser/ui/ui_feature_flags.h" @@ -35,36 +37,31 @@ @interface LanguageDetailsTableViewController () -// The language code for the given language. -@property(nonatomic, copy) NSString* languageCode; +// The model data passed to this instance. +@property(nonatomic, strong) LanguageItem* languageItem; -// The name of the given language. -@property(nonatomic, copy) NSString* languageName; - -// Whether the language is Translate-blocked. -@property(nonatomic, getter=isBlocked) BOOL blocked; - -// Whether Translate can be offered for the language, i.e., it can be unblocked. -@property(nonatomic) BOOL canOfferTranslate; +// The delegate passed to this instance. +@property(nonatomic, weak) id<LanguageDetailsTableViewControllerDelegate> + delegate; @end @implementation LanguageDetailsTableViewController -- (instancetype)initWithLanguageCode:(NSString*)languageCode - languageName:(NSString*)languageName - blocked:(BOOL)blocked - canOfferTranslate:(BOOL)canOfferTranslate { +- (instancetype)initWithLanguageItem:(LanguageItem*)languageItem + delegate: + (id<LanguageDetailsTableViewControllerDelegate>) + delegate { + DCHECK(languageItem); + DCHECK(delegate); UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh) ? UITableViewStylePlain : UITableViewStyleGrouped; self = [super initWithTableViewStyle:style appBarStyle:ChromeTableViewControllerStyleNoAppBar]; if (self) { - _languageCode = [languageCode copy]; - _languageName = [languageName copy]; - _blocked = blocked; - _canOfferTranslate = canOfferTranslate; + _languageItem = languageItem; + _delegate = delegate; } return self; } @@ -74,7 +71,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.title = self.languageName; + self.title = self.languageItem.text; self.shouldHideDoneButton = YES; self.tableView.accessibilityIdentifier = kLanguageDetailsTableViewAccessibilityIdentifier; @@ -96,7 +93,7 @@ neverTranslateItem.text = l10n_util::GetNSString(IDS_IOS_LANGUAGE_SETTINGS_NEVER_TRANSLATE_TITLE); neverTranslateItem.accessibilityTraits |= UIAccessibilityTraitButton; - neverTranslateItem.accessoryType = self.isBlocked + neverTranslateItem.accessoryType = self.languageItem.isBlocked ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; [model addItem:neverTranslateItem @@ -108,10 +105,10 @@ offerTranslateItem.text = l10n_util::GetNSString( IDS_IOS_LANGUAGE_SETTINGS_OFFER_TO_TRANSLATE_TITLE); offerTranslateItem.accessibilityTraits |= UIAccessibilityTraitButton; - offerTranslateItem.accessoryType = self.isBlocked + offerTranslateItem.accessoryType = self.languageItem.isBlocked ? UITableViewCellAccessoryNone : UITableViewCellAccessoryCheckmark; - if (!self.canOfferTranslate) { + if (!self.languageItem.canOfferTranslate) { offerTranslateItem.enabled = NO; offerTranslateItem.textColor = UIColorFromRGB(kSettingsCellsDetailTextColor); @@ -128,7 +125,7 @@ [self.delegate languageDetailsTableViewController:self didSelectOfferTranslate:(type == ItemTypeOfferTranslate) - languageCode:self.languageCode]; + languageCode:self.languageItem.languageCode]; } @end
diff --git a/ios/chrome/browser/ui/settings/language_settings_commands.h b/ios/chrome/browser/ui/settings/language_settings_commands.h new file mode 100644 index 0000000..b5c2f4dd9 --- /dev/null +++ b/ios/chrome/browser/ui/settings/language_settings_commands.h
@@ -0,0 +1,38 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_COMMANDS_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_COMMANDS_H_ + +#include <Foundation/Foundation.h> + +#include <string> + +// Commands issued to a model backing the language settings page. +@protocol LanguageSettingsCommands + +// Informs the receiver to enable or disable Translate. +- (void)setTranslateEnabled:(BOOL)enabled; + +// Informs the receiver to move the language with the given code up or down in +// the list of accept languages with the given offset. +- (void)moveLanguage:(const std::string&)languageCode + downward:(BOOL)downward + withOffset:(NSUInteger)offset; + +// Informs the receiver to remove the language with the given code from the list +// of accept languages. +- (void)removeLanguage:(const std::string&)languageCode; + +// Informs the receiver to block the language with the given code preventing it +// from being translated. +- (void)blockLanguage:(const std::string&)languageCode; + +// Informs the receiver to unblock the language with the given code allowing +// it to be translated. +- (void)unblockLanguage:(const std::string&)languageCode; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_COMMANDS_H_
diff --git a/ios/chrome/browser/ui/settings/language_settings_consumer.h b/ios/chrome/browser/ui/settings/language_settings_consumer.h new file mode 100644 index 0000000..39af237 --- /dev/null +++ b/ios/chrome/browser/ui/settings/language_settings_consumer.h
@@ -0,0 +1,24 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_CONSUMER_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_CONSUMER_H_ + +#include <Foundation/Foundation.h> + +#include <string> + +// The consumer protocol for the LanguageSettingsDataSource. +@protocol LanguageSettingsConsumer + +// Called when the value of prefs::kOfferTranslateEnabled changes to |enabled|. +- (void)translateEnabled:(BOOL)enabled; + +// Called when the value of language::prefs::kAcceptLanguages or +// language::prefs::kFluentLanguages change. +- (void)languagePrefsChanged; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_CONSUMER_H_
diff --git a/ios/chrome/browser/ui/settings/language_settings_data_source.h b/ios/chrome/browser/ui/settings/language_settings_data_source.h new file mode 100644 index 0000000..cb56a038 --- /dev/null +++ b/ios/chrome/browser/ui/settings/language_settings_data_source.h
@@ -0,0 +1,32 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_DATA_SOURCE_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_DATA_SOURCE_H_ + +#include <Foundation/Foundation.h> + +#include <string> + +@class LanguageItem; +@protocol LanguageSettingsConsumer; + +// The data source protocol for the Language Settings page. +@protocol LanguageSettingsDataSource + +// Returns the accept languages list ordered according to the user prefs. +- (NSArray<LanguageItem*>*)acceptLanguagesItems; + +// Returns whether or not Translate is enabled. +- (BOOL)translateEnabled; + +// Returns the target language code with the Translate server format +- (std::string)targetLanguageCode; + +// The consumer for this protocol. +@property(nonatomic, weak) id<LanguageSettingsConsumer> consumer; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_DATA_SOURCE_H_
diff --git a/ios/chrome/browser/ui/settings/language_settings_mediator.h b/ios/chrome/browser/ui/settings/language_settings_mediator.h new file mode 100644 index 0000000..6fa53a09 --- /dev/null +++ b/ios/chrome/browser/ui/settings/language_settings_mediator.h
@@ -0,0 +1,28 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_MEDIATOR_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_MEDIATOR_H_ + +#include <Foundation/Foundation.h> + +#import "ios/chrome/browser/ui/settings/language_settings_commands.h" +#import "ios/chrome/browser/ui/settings/language_settings_data_source.h" +#import "ios/chrome/browser/ui/settings/language_settings_table_view_controller.h" + +namespace ios { +class ChromeBrowserState; +} // namespace ios + +@interface LanguageSettingsMediator + : NSObject <LanguageSettingsDataSource, LanguageSettingsCommands> + +// The designated initializer. |browserState| must not be nil. +- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState + NS_DESIGNATED_INITIALIZER; +- (instancetype)init NS_UNAVAILABLE; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_MEDIATOR_H_
diff --git a/ios/chrome/browser/ui/settings/language_settings_mediator.mm b/ios/chrome/browser/ui/settings/language_settings_mediator.mm new file mode 100644 index 0000000..d7c8fd4b --- /dev/null +++ b/ios/chrome/browser/ui/settings/language_settings_mediator.mm
@@ -0,0 +1,226 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/settings/language_settings_mediator.h" + +#include <memory> + +#include "base/logging.h" +#include "base/mac/foundation_util.h" +#include "base/strings/sys_string_conversions.h" +#include "components/language/core/browser/language_model_manager.h" +#include "components/language/core/browser/pref_names.h" +#include "components/language/core/common/language_util.h" +#include "components/prefs/ios/pref_observer_bridge.h" +#include "components/prefs/pref_change_registrar.h" +#include "components/prefs/pref_service.h" +#include "components/translate/core/browser/translate_pref_names.h" +#include "components/translate/core/browser/translate_prefs.h" +#include "ios/chrome/browser/application_context.h" +#include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#include "ios/chrome/browser/language/language_model_manager_factory.h" +#include "ios/chrome/browser/translate/chrome_ios_translate_client.h" +#include "ios/chrome/browser/translate/translate_service_ios.h" +#import "ios/chrome/browser/ui/settings/cells/language_item.h" +#import "ios/chrome/browser/ui/settings/language_settings_consumer.h" +#import "ios/chrome/browser/ui/settings/utils/observable_boolean.h" +#import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ui/base/l10n/l10n_util_mac.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface LanguageSettingsMediator () <BooleanObserver, PrefObserverDelegate> { + // Registrar for pref change notifications. + std::unique_ptr<PrefChangeRegistrar> _prefChangeRegistrar; + + // Pref observer to track changes to language::prefs::kAcceptLanguages. + std::unique_ptr<PrefObserverBridge> _acceptLanguagesPrefObserverBridge; + + // Pref observer to track changes to language::prefs::kFluentLanguages. + std::unique_ptr<PrefObserverBridge> _fluentLanguagesPrefObserverBridge; + + // Translate wrapper for the PrefService. + std::unique_ptr<translate::TranslatePrefs> _translatePrefs; +} + +// The BrowserState passed to this instance. +@property(nonatomic, assign) ios::ChromeBrowserState* browserState; + +// An observable boolean backed by prefs::kOfferTranslateEnabled. +@property(nonatomic, strong) PrefBackedBoolean* translateEnabledPref; + +@end + +@implementation LanguageSettingsMediator + +@synthesize consumer = _consumer; + +- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState { + DCHECK(browserState); + self = [super init]; + if (self) { + _browserState = browserState; + + _translateEnabledPref = [[PrefBackedBoolean alloc] + initWithPrefService:browserState->GetPrefs() + prefName:prefs::kOfferTranslateEnabled]; + [_translateEnabledPref setObserver:self]; + + _prefChangeRegistrar = std::make_unique<PrefChangeRegistrar>(); + _prefChangeRegistrar->Init(browserState->GetPrefs()); + _acceptLanguagesPrefObserverBridge = + std::make_unique<PrefObserverBridge>(self); + _acceptLanguagesPrefObserverBridge->ObserveChangesForPreference( + language::prefs::kAcceptLanguages, _prefChangeRegistrar.get()); + _fluentLanguagesPrefObserverBridge = + std::make_unique<PrefObserverBridge>(self); + _fluentLanguagesPrefObserverBridge->ObserveChangesForPreference( + language::prefs::kFluentLanguages, _prefChangeRegistrar.get()); + + _translatePrefs = ChromeIOSTranslateClient::CreateTranslatePrefs( + browserState->GetPrefs()); + } + return self; +} + +#pragma mark - BooleanObserver + +// Called when the value of prefs::kOfferTranslateEnabled changes. +- (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean { + DCHECK_EQ(self.translateEnabledPref, observableBoolean); + + // Inform the consumer. + [self.consumer translateEnabled:observableBoolean.value]; +} + +#pragma mark - PrefObserverDelegate + +// Called when the value of language::prefs::kAcceptLanguages or +// language::prefs::kFluentLanguages change. +- (void)onPreferenceChanged:(const std::string&)preferenceName { + DCHECK(preferenceName == language::prefs::kAcceptLanguages || + preferenceName == language::prefs::kFluentLanguages); + + // Inform the consumer + [self.consumer languagePrefsChanged]; +} + +#pragma mark - LanguageSettingsDataSource + +- (NSArray<LanguageItem*>*)acceptLanguagesItems { + // Create a map of supported language codes to supported languages. + std::vector<translate::TranslateLanguageInfo> supportedLanguages; + translate::TranslatePrefs::GetLanguageInfoList( + GetApplicationContext()->GetApplicationLocale(), + _translatePrefs->IsTranslateAllowedByPolicy(), &supportedLanguages); + std::map<std::string, translate::TranslateLanguageInfo> supportedLanguagesMap; + for (const auto& supportedLanguage : supportedLanguages) { + supportedLanguagesMap[supportedLanguage.code] = supportedLanguage; + } + + // Get the accept languages. + std::vector<std::string> languageCodes; + _translatePrefs->GetLanguageList(&languageCodes); + + NSMutableArray<LanguageItem*>* acceptLanguages = + [NSMutableArray arrayWithCapacity:languageCodes.size()]; + for (const auto& languageCode : languageCodes) { + // Ignore unsupported languages. + auto it = supportedLanguagesMap.find(languageCode); + if (it == supportedLanguagesMap.end()) { + NOTREACHED() << languageCode + " is an accept language which is not " + "supported by the platform."; + continue; + } + + LanguageItem* languageItem = [self languageItemFromLanguage:it->second]; + + // Language codes used in the language settings have the Chrome internal + // format while the Translate target language has the Translate server + // format. To convert the former to the latter the utilily function + // ToTranslateLanguageSynonym() must be used. + std::string canonicalLanguageCode = languageItem.languageCode; + language::ToTranslateLanguageSynonym(&canonicalLanguageCode); + languageItem.canonicalLanguageCode = canonicalLanguageCode; + + // The last translate-blocked language cannot be removed whether or not + // Translate is enabled at the moment. Therefore, include this information. + languageItem.blocked = + _translatePrefs->IsBlockedLanguage(languageItem.languageCode); + + if ([self translateEnabled]) { + // Show a disclosure indicator to suggest language details are available + // as well as a label indicating if the language is Translate-blocked. + languageItem.accessibilityTraits |= UIAccessibilityTraitButton; + languageItem.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + languageItem.trailingDetailText = + languageItem.isBlocked + ? l10n_util::GetNSString( + IDS_IOS_LANGUAGE_SETTINGS_NEVER_TRANSLATE_TITLE) + : l10n_util::GetNSString( + IDS_IOS_LANGUAGE_SETTINGS_OFFER_TO_TRANSLATE_TITLE); + } + [acceptLanguages addObject:languageItem]; + } + return acceptLanguages; +} + +- (BOOL)translateEnabled { + return self.translateEnabledPref.value; +} + +- (std::string)targetLanguageCode { + return TranslateServiceIOS::GetTargetLanguage( + self.browserState->GetPrefs(), + LanguageModelManagerFactory::GetForBrowserState(self.browserState) + ->GetPrimaryModel()); +} + +#pragma mark - LanguageSettingsCommands + +- (void)setTranslateEnabled:(BOOL)enabled { + [self.translateEnabledPref setValue:enabled]; +} + +- (void)moveLanguage:(const std::string&)languageCode + downward:(BOOL)downward + withOffset:(NSUInteger)offset { + translate::TranslatePrefs::RearrangeSpecifier where = + downward ? translate::TranslatePrefs::kDown + : translate::TranslatePrefs::kUp; + std::vector<std::string> languageCodes; + _translatePrefs->GetLanguageList(&languageCodes); + _translatePrefs->RearrangeLanguage(languageCode, where, offset, + languageCodes); +} + +- (void)removeLanguage:(const std::string&)languageCode { + _translatePrefs->RemoveFromLanguageList(languageCode); +} + +- (void)blockLanguage:(const std::string&)languageCode { + _translatePrefs->BlockLanguage(languageCode); +} + +- (void)unblockLanguage:(const std::string&)languageCode { + _translatePrefs->UnblockLanguage(languageCode); +} + +#pragma mark - Private methods + +- (LanguageItem*)languageItemFromLanguage: + (const translate::TranslateLanguageInfo&)language { + LanguageItem* languageItem = [[LanguageItem alloc] init]; + languageItem.languageCode = language.code; + languageItem.text = base::SysUTF8ToNSString(language.display_name); + languageItem.leadingDetailText = + base::SysUTF8ToNSString(language.native_display_name); + languageItem.supportsTranslate = language.supports_translate; + return languageItem; +} + +@end
diff --git a/ios/chrome/browser/ui/settings/language_settings_table_view_controller.h b/ios/chrome/browser/ui/settings/language_settings_table_view_controller.h index efbe53e0..6b18285a 100644 --- a/ios/chrome/browser/ui/settings/language_settings_table_view_controller.h +++ b/ios/chrome/browser/ui/settings/language_settings_table_view_controller.h
@@ -5,19 +5,21 @@ #ifndef IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_TABLE_VIEW_CONTROLLER_H_ #define IOS_CHROME_BROWSER_UI_SETTINGS_LANGUAGE_SETTINGS_TABLE_VIEW_CONTROLLER_H_ +#import "ios/chrome/browser/ui/settings/language_settings_consumer.h" #import "ios/chrome/browser/ui/settings/settings_root_table_view_controller.h" -namespace ios { -class ChromeBrowserState; -} // namespace ios +@protocol LanguageSettingsDataSource; +@protocol LanguageSettingsCommands; // Controller for the UI that allows the user to change language settings such -// as user preferred languages. -@interface LanguageSettingsTableViewController : SettingsRootTableViewController +// as the ordered list of accept languages and their Translate preferences. +@interface LanguageSettingsTableViewController + : SettingsRootTableViewController <LanguageSettingsConsumer> -// The designated initializer. |browserState| must not be nil and is not -// retained. -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState +// The designated initializer. |dataSource| and |commandHandler| must not be +// nil. |commandHandler| will not be retained. +- (instancetype)initWithDataSource:(id<LanguageSettingsDataSource>)dataSource + commandHandler:(id<LanguageSettingsCommands>)commandHandler NS_DESIGNATED_INITIALIZER; - (instancetype)initWithTableViewStyle:(UITableViewStyle)style appBarStyle:
diff --git a/ios/chrome/browser/ui/settings/language_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/language_settings_table_view_controller.mm index 3d6a7d2..bce1235 100644 --- a/ios/chrome/browser/ui/settings/language_settings_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/language_settings_table_view_controller.mm
@@ -4,33 +4,16 @@ #import "ios/chrome/browser/ui/settings/language_settings_table_view_controller.h" -#include <map> -#include <memory> -#include <vector> - #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/strings/sys_string_conversions.h" -#include "components/language/core/browser/language_model_manager.h" -#include "components/language/core/browser/pref_names.h" -#include "components/language/core/common/language_util.h" -#include "components/prefs/ios/pref_observer_bridge.h" -#include "components/prefs/pref_change_registrar.h" -#include "components/prefs/pref_service.h" -#include "components/translate/core/browser/translate_pref_names.h" -#include "components/translate/core/browser/translate_prefs.h" -#include "ios/chrome/browser/application_context.h" -#include "ios/chrome/browser/browser_state/chrome_browser_state.h" -#include "ios/chrome/browser/language/language_model_manager_factory.h" -#include "ios/chrome/browser/translate/chrome_ios_translate_client.h" -#include "ios/chrome/browser/translate/translate_service_ios.h" -#import "ios/chrome/browser/ui/list_model/list_model.h" +#import "ios/chrome/browser/ui/list_model/list_item+Controller.h" #import "ios/chrome/browser/ui/settings/cells/language_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" #import "ios/chrome/browser/ui/settings/language_details_table_view_controller.h" -#import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h" +#import "ios/chrome/browser/ui/settings/language_settings_commands.h" +#import "ios/chrome/browser/ui/settings/language_settings_data_source.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h" @@ -66,27 +49,13 @@ } // namespace @interface LanguageSettingsTableViewController () < - BooleanObserver, - LanguageDetailsTableViewControllerDelegate, - PrefObserverDelegate> { - // Registrar for pref change notifications. - std::unique_ptr<PrefChangeRegistrar> _prefChangeRegistrar; + LanguageDetailsTableViewControllerDelegate> - // Pref observer to track changes to language::prefs::kAcceptLanguages. - std::unique_ptr<PrefObserverBridge> _acceptLanguagesPrefObserverBridge; +// The data source passed to this instance. +@property(nonatomic, strong) id<LanguageSettingsDataSource> dataSource; - // Pref observer to track changes to language::prefs::kFluentLanguages. - std::unique_ptr<PrefObserverBridge> _fluentLanguagesPrefObserverBridge; - - // Translate wrapper for the PrefService. - std::unique_ptr<translate::TranslatePrefs> _translatePrefs; -} - -// The BrowserState passed to this instance. -@property(nonatomic, assign) ios::ChromeBrowserState* browserState; - -// Whether or not prefs::kOfferTranslateEnabled pref is enabled. -@property(nonatomic, strong) PrefBackedBoolean* translateEnabled; +// The command handler passed to this instance. +@property(nonatomic, weak) id<LanguageSettingsCommands> commandHandler; // A reference to the Add language item for quick access. @property(nonatomic, weak) TableViewTextItem* addLanguageItem; @@ -98,34 +67,19 @@ @implementation LanguageSettingsTableViewController -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState { - DCHECK(browserState); +- (instancetype)initWithDataSource:(id<LanguageSettingsDataSource>)dataSource + commandHandler: + (id<LanguageSettingsCommands>)commandHandler { + DCHECK(dataSource); + DCHECK(commandHandler); UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh) ? UITableViewStylePlain : UITableViewStyleGrouped; self = [super initWithTableViewStyle:style appBarStyle:ChromeTableViewControllerStyleNoAppBar]; if (self) { - _browserState = browserState; - - _translateEnabled = [[PrefBackedBoolean alloc] - initWithPrefService:_browserState->GetPrefs() - prefName:prefs::kOfferTranslateEnabled]; - [_translateEnabled setObserver:self]; - - _prefChangeRegistrar = std::make_unique<PrefChangeRegistrar>(); - _prefChangeRegistrar->Init(_browserState->GetPrefs()); - _acceptLanguagesPrefObserverBridge = - std::make_unique<PrefObserverBridge>(self); - _acceptLanguagesPrefObserverBridge->ObserveChangesForPreference( - language::prefs::kAcceptLanguages, _prefChangeRegistrar.get()); - _fluentLanguagesPrefObserverBridge = - std::make_unique<PrefObserverBridge>(self); - _fluentLanguagesPrefObserverBridge->ObserveChangesForPreference( - language::prefs::kFluentLanguages, _prefChangeRegistrar.get()); - - _translatePrefs = ChromeIOSTranslateClient::CreateTranslatePrefs( - _browserState->GetPrefs()); + _dataSource = dataSource; + _commandHandler = commandHandler; } return self; } @@ -164,7 +118,7 @@ l10n_util::GetNSString(IDS_IOS_LANGUAGE_SETTINGS_TRANSLATE_SWITCH_TITLE); translateSwitchItem.detailText = l10n_util::GetNSString( IDS_IOS_LANGUAGE_SETTINGS_TRANSLATE_SWITCH_SUBTITLE); - translateSwitchItem.on = self.translateEnabled.value; + translateSwitchItem.on = [self.dataSource translateEnabled]; [model addItem:translateSwitchItem toSectionWithIdentifier:SectionIdentifierTranslate]; } @@ -212,7 +166,7 @@ // Ignore selection of language items when Translate is disabled. NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath]; - return (itemType != ItemTypeLanguage || self.translateEnabled.value) + return (itemType != ItemTypeLanguage || [self.dataSource translateEnabled]) ? indexPath : nil; } @@ -224,17 +178,12 @@ TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath]; if (item.type == ItemTypeLanguage) { LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(item); - BOOL canOfferTranslate = - [self canOfferToTranslateLanguage:languageItem.languageCode - blocked:languageItem.isBlocked]; + languageItem.canOfferTranslate = + [self canOfferTranslateForLanguage:languageItem]; LanguageDetailsTableViewController* viewController = [[LanguageDetailsTableViewController alloc] - initWithLanguageCode:base::SysUTF8ToNSString( - languageItem.languageCode) - languageName:languageItem.text - blocked:languageItem.isBlocked - canOfferTranslate:canOfferTranslate]; - viewController.delegate = self; + initWithLanguageItem:languageItem + delegate:self]; [self.navigationController pushViewController:viewController animated:YES]; } } @@ -288,8 +237,8 @@ // Update the model and the table view. [self deleteItems:[NSArray arrayWithObject:indexPath]]; - // Update the pref. - _translatePrefs->RemoveFromLanguageList(languageItem.languageCode); + // Inform the command handler. + [self.commandHandler removeLanguage:languageItem.languageCode]; } - (BOOL)tableView:(UITableView*)tableView @@ -317,16 +266,12 @@ inSectionWithIdentifier:SectionIdentifierLanguages atIndex:destinationIndexPath.row]; - // Update the pref. - translate::TranslatePrefs::RearrangeSpecifier where = - sourceIndexPath.row < destinationIndexPath.row - ? translate::TranslatePrefs::kDown - : translate::TranslatePrefs::kUp; - const int offset = abs(sourceIndexPath.row - destinationIndexPath.row); - std::vector<std::string> languageCodes; - _translatePrefs->GetLanguageList(&languageCodes); - _translatePrefs->RearrangeLanguage(languageItem.languageCode, where, offset, - languageCodes); + // Inform the command handler. + BOOL downward = sourceIndexPath.row < destinationIndexPath.row; + NSUInteger offset = abs(sourceIndexPath.row - destinationIndexPath.row); + [self.commandHandler moveLanguage:languageItem.languageCode + downward:downward + withOffset:offset]; } - (UITableViewCell*)tableView:(UITableView*)tableView @@ -351,44 +296,37 @@ - (void)languageDetailsTableViewController: (LanguageDetailsTableViewController*)tableViewController didSelectOfferTranslate:(BOOL)offerTranslate - languageCode:(NSString*)languageCode { - const std::string& code = base::SysNSStringToUTF8(languageCode); + languageCode:(const std::string&)languageCode { + // Inform the command handler. if (offerTranslate) { - _translatePrefs->UnblockLanguage(code); + [self.commandHandler unblockLanguage:languageCode]; } else { - _translatePrefs->BlockLanguage(code); + [self.commandHandler blockLanguage:languageCode]; } + + // Update the model and the table view. [self updateLanguagesSection]; + [self.navigationController popViewControllerAnimated:YES]; } -#pragma mark - BooleanObserver +#pragma mark - LanguageSettingsConsumer -// Called when the value of prefs::kOfferTranslateEnabled changes. -- (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean { - // Ingnore pref changes while in edit mode. +- (void)translateEnabled:(BOOL)enabled { + // Ignore pref changes while in edit mode. if (self.isEditing) return; - DCHECK_EQ(self.translateEnabled, observableBoolean); - // Update the model and the table view. - [self setTranslateSwitchItemOn:self.translateEnabled.value]; + [self setTranslateSwitchItemOn:enabled]; [self updateLanguagesSection]; } -#pragma mark - PrefObserverDelegate - -// Called when the values of language::prefs::kAcceptLanguages or -// language::prefs::kFluentLanguages change. -- (void)onPreferenceChanged:(const std::string&)preferenceName { - // Ingnore pref changes while in edit mode. +- (void)languagePrefsChanged { + // Ignore pref changes while in edit mode. if (self.isEditing) return; - DCHECK(preferenceName == language::prefs::kAcceptLanguages || - preferenceName == language::prefs::kFluentLanguages); - // Update the model and the table view. [self updateLanguagesSection]; } @@ -405,48 +343,13 @@ [model setHeader:headerItem forSectionWithIdentifier:SectionIdentifierLanguages]; - // Populate the supported languages map. - std::map<std::string, translate::TranslateLanguageInfo> supportedLanguagesMap; - std::vector<translate::TranslateLanguageInfo> supportedLanguages; - translate::TranslatePrefs::GetLanguageInfoList( - GetApplicationContext()->GetApplicationLocale(), - _translatePrefs->IsTranslateAllowedByPolicy(), &supportedLanguages); - for (const auto& entry : supportedLanguages) { - supportedLanguagesMap[entry.code] = entry; - } - // Languages items. - std::vector<std::string> languageCodes; - _translatePrefs->GetLanguageList(&languageCodes); - for (const auto& languageCode : languageCodes) { - // Ignore unsupported languages. - auto it = supportedLanguagesMap.find(languageCode); - if (it == supportedLanguagesMap.end()) - continue; - - const translate::TranslateLanguageInfo& language = it->second; - LanguageItem* languageItem = - [[LanguageItem alloc] initWithType:ItemTypeLanguage]; - languageItem.languageCode = language.code; - languageItem.text = base::SysUTF8ToNSString(language.display_name); - languageItem.leadingDetailText = - base::SysUTF8ToNSString(language.native_display_name); - languageItem.blocked = _translatePrefs->IsBlockedLanguage(language.code); - if (self.translateEnabled.value) { - // Show a disclosure indicator to suggest Translate options are available - // as well as a label indicating if the language is Translate-blocked. - languageItem.accessibilityTraits |= UIAccessibilityTraitButton; - languageItem.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - languageItem.trailingDetailText = - languageItem.isBlocked - ? l10n_util::GetNSString( - IDS_IOS_LANGUAGE_SETTINGS_NEVER_TRANSLATE_TITLE) - : l10n_util::GetNSString( - IDS_IOS_LANGUAGE_SETTINGS_OFFER_TO_TRANSLATE_TITLE); - } - [model addItem:languageItem - toSectionWithIdentifier:SectionIdentifierLanguages]; - } + [[self.dataSource acceptLanguagesItems] + enumerateObjectsUsingBlock:^(LanguageItem* item, NSUInteger index, + BOOL* stop) { + item.type = ItemTypeLanguage; + [model addItem:item toSectionWithIdentifier:SectionIdentifierLanguages]; + }]; // Add language item. TableViewTextItem* addLanguageItem = @@ -502,26 +405,21 @@ [self reconfigureCellsForItems:@[ self.translateSwitchItem ]]; } -- (BOOL)canOfferToTranslateLanguage:(const std::string&)languageCode - blocked:(BOOL)blocked { +// Returns whether Translate can be offered for the language (it can be +// unblocked). +- (BOOL)canOfferTranslateForLanguage:(LanguageItem*)languageItem { + // Cannot offer Translate for languages not supported by the Translate server. + if (!languageItem.supportsTranslate) + return NO; + // Cannot offer Translate for the last Translate-blocked language. - if (blocked && [self numberOfBlockedLanguages] <= 1) { + if (languageItem.isBlocked && [self numberOfBlockedLanguages] <= 1) { return NO; } // Cannot offer Translate for the Translate target language. - // Note the language codes used in the language settings have the Chrome - // internal format while the Translate target language has the Translate - // server format. To convert the former to the latter the utilily function - // ToTranslateLanguageSynonym() must be used. - const std::string& targetLanguageCode = - TranslateServiceIOS::GetTargetLanguage( - self.browserState->GetPrefs(), - LanguageModelManagerFactory::GetForBrowserState(self.browserState) - ->GetPrimaryModel()); - std::string canonicalLanguageCode = languageCode; - language::ToTranslateLanguageSynonym(&canonicalLanguageCode); - return targetLanguageCode != canonicalLanguageCode; + return [self.dataSource targetLanguageCode] != + languageItem.canonicalLanguageCode; } // Returns the number of Translate-blocked languages currently in the model. @@ -543,12 +441,11 @@ #pragma mark - Actions - (void)translateSwitchChanged:(UISwitch*)switchView { - // Update the pref. - [self.translateEnabled setValue:switchView.isOn]; + // Inform the command handler. + [self.commandHandler setTranslateEnabled:switchView.isOn]; // Update the model and the table view. - [self setTranslateSwitchItemOn:switchView.isOn]; - [self updateLanguagesSection]; + [self translateEnabled:switchView.isOn]; } @end
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/settings_table_view_controller.mm index 88e820a..76452231 100644 --- a/ios/chrome/browser/ui/settings/settings_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
@@ -50,6 +50,7 @@ #import "ios/chrome/browser/ui/settings/content_settings_table_view_controller.h" #import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.h" #import "ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.h" +#import "ios/chrome/browser/ui/settings/language_settings_mediator.h" #import "ios/chrome/browser/ui/settings/language_settings_table_view_controller.h" #import "ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.h" #import "ios/chrome/browser/ui/settings/password/passwords_table_view_controller.h" @@ -863,10 +864,17 @@ controller = [[PrivacyTableViewController alloc] initWithBrowserState:_browserState]; break; - case ItemTypeLanguageSettings: - controller = [[LanguageSettingsTableViewController alloc] - initWithBrowserState:_browserState]; + case ItemTypeLanguageSettings: { + LanguageSettingsMediator* mediator = + [[LanguageSettingsMediator alloc] initWithBrowserState:_browserState]; + LanguageSettingsTableViewController* languageSettingsTableViewController = + [[LanguageSettingsTableViewController alloc] + initWithDataSource:mediator + commandHandler:mediator]; + mediator.consumer = languageSettingsTableViewController; + controller = languageSettingsTableViewController; break; + } case ItemTypeContentSettings: controller = [[ContentSettingsTableViewController alloc] initWithBrowserState:_browserState];
diff --git a/ios/chrome/browser/ui/settings/sync/utils/sync_fake_server_egtest.mm b/ios/chrome/browser/ui/settings/sync/utils/sync_fake_server_egtest.mm index 06738c4..b29d3b662 100644 --- a/ios/chrome/browser/ui/settings/sync/utils/sync_fake_server_egtest.mm +++ b/ios/chrome/browser/ui/settings/sync/utils/sync_fake_server_egtest.mm
@@ -21,7 +21,6 @@ #import "ios/chrome/browser/ui/settings/settings_table_view_controller.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/app/chrome_test_util.h" -#import "ios/chrome/test/app/sync_test_util.h" #import "ios/chrome/test/app/tab_test_util.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" @@ -47,22 +46,11 @@ // Constant for timeout while waiting for asynchronous sync operations. const NSTimeInterval kSyncOperationTimeout = 10.0; -// Waits for sync to be initialized or not, based on |isSyncInitialized| and -// fails with a GREYAssert if that condition is never met. -void AssertSyncInitialized(bool is_initialized) { - ConditionBlock condition = ^{ - return chrome_test_util::IsSyncInitialized() == is_initialized; - }; - GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(kSyncOperationTimeout, - condition), - @"Sync was not initialized"); -} - // Waits for |entity_count| entities of type |entity_type|, and fails with // a GREYAssert if the condition is not met, within a short period of time. void AssertNumberOfEntities(int entity_count, syncer::ModelType entity_type) { ConditionBlock condition = ^{ - return chrome_test_util::GetNumberOfSyncEntities(entity_type) == + return [ChromeEarlGrey numberOfSyncEntitiesWithType:entity_type] == entity_count; }; GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(kSyncOperationTimeout, @@ -70,23 +58,6 @@ @"Expected %d entities of the specified type", entity_count); } -// Waits for |entity_count| entities of type |entity_type| with name |name|, and -// fails with a GREYAssert if the condition is not met, within a short period of -// time. -void AssertNumberOfEntitiesWithName(int entity_count, - syncer::ModelType entity_type, - std::string name) { - ConditionBlock condition = ^{ - NSError* error = nil; - BOOL success = chrome_test_util::VerifyNumberOfSyncEntitiesWithName( - entity_type, name, entity_count, &error); - DCHECK(success || error); - return !!success; - }; - GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(kSyncOperationTimeout, - condition), - @"Expected %d entities of the specified type", entity_count); -} } // namespace // Hermetic sync tests, which use the fake sync server. @@ -99,17 +70,19 @@ CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey waitForBookmarksToFinishLoading]); CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBookmarks]); - chrome_test_util::ClearSyncServerData(); + [ChromeEarlGrey clearSyncServerData]; AssertNumberOfEntities(0, syncer::AUTOFILL_PROFILE); [super tearDown]; } - (void)setUp { [super setUp]; - GREYAssertEqual(chrome_test_util::GetNumberOfSyncEntities(syncer::BOOKMARKS), - 0, @"No bookmarks should exist before sync tests start."); - GREYAssertEqual(chrome_test_util::GetNumberOfSyncEntities(syncer::TYPED_URLS), - 0, @"No bookmarks should exist before sync tests start."); + GREYAssertEqual( + [ChromeEarlGrey numberOfSyncEntitiesWithType:syncer::BOOKMARKS], 0, + @"No bookmarks should exist before sync tests start."); + GREYAssertEqual( + [ChromeEarlGrey numberOfSyncEntitiesWithType:syncer::TYPED_URLS], 0, + @"No bookmarks should exist before sync tests start."); } // Tests that a bookmark added on the client (before Sync is enabled) is @@ -124,7 +97,9 @@ [SigninEarlGreyUI signinWithIdentity:identity]; // Assert that the correct number of bookmarks have been synced. - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); AssertNumberOfEntities(1, syncer::BOOKMARKS); } @@ -136,7 +111,9 @@ [SigninEarlGreyUI signinWithIdentity:identity]; // Add a bookmark after sync is initialized. - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); [self addBookmark:GURL("https://www.goo.com") withTitle:@"goo"]; AssertNumberOfEntities(1, syncer::BOOKMARKS); } @@ -145,15 +122,17 @@ // client. - (void)testSyncDownloadBookmark { [[self class] assertBookmarksWithTitle:@"hoo" expectedCount:0]; - chrome_test_util::InjectBookmarkOnFakeSyncServer("http://www.hoo.com", "hoo"); + [ChromeEarlGrey injectBookmarkOnFakeSyncServerWithURL:"http://www.hoo.com" + bookmarkTitle:"hoo"]; // Sign in to sync, after a bookmark has been injected in the sync server. ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(true); - + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); [[self class] assertBookmarksWithTitle:@"hoo" expectedCount:1]; } @@ -164,17 +143,23 @@ ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); // Store the original guid, then restart sync. - std::string original_guid = chrome_test_util::GetSyncCacheGuid(); - chrome_test_util::StopSync(); - AssertSyncInitialized(false); - chrome_test_util::StartSync(); + std::string original_guid = [ChromeEarlGrey syncCacheGUID]; + [ChromeEarlGrey stopSync]; + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:NO + syncTimeout:kSyncOperationTimeout]); + [ChromeEarlGrey startSync]; // Verify the guid did not change. - AssertSyncInitialized(true); - GREYAssertEqual(chrome_test_util::GetSyncCacheGuid(), original_guid, + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + GREYAssertEqual([ChromeEarlGrey syncCacheGUID], original_guid, @"Stored guid doesn't match current value"); } @@ -186,8 +171,10 @@ ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(true); - std::string original_guid = chrome_test_util::GetSyncCacheGuid(); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + std::string original_guid = [ChromeEarlGrey syncCacheGUID]; // Sign out the current user. ios::ChromeBrowserState* browser_state = @@ -197,13 +184,17 @@ GREYAssert(authentication_service->IsAuthenticated(), @"User is not signed in."); authentication_service->SignOut(signin_metrics::SIGNOUT_TEST, nil); - AssertSyncInitialized(false); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:NO + syncTimeout:kSyncOperationTimeout]); // Sign the user back in, and verify the guid has changed. [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); GREYAssertTrue( - chrome_test_util::GetSyncCacheGuid() != original_guid, + [ChromeEarlGrey syncCacheGUID] != original_guid, @"guid didn't change after user signed out and signed back in"); } @@ -216,7 +207,9 @@ ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); // Sign out the current user. ios::ChromeBrowserState* browser_state = @@ -226,21 +219,29 @@ GREYAssert(authentication_service->IsAuthenticated(), @"User is not signed in."); authentication_service->SignOut(signin_metrics::SIGNOUT_TEST, nil); - AssertSyncInitialized(false); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:NO + syncTimeout:kSyncOperationTimeout]); // Sign the user back in. [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); // Record the initial guid, before restarting sync. - std::string original_guid = chrome_test_util::GetSyncCacheGuid(); - chrome_test_util::StopSync(); - AssertSyncInitialized(false); - chrome_test_util::StartSync(); + std::string original_guid = [ChromeEarlGrey syncCacheGUID]; + [ChromeEarlGrey stopSync]; + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:NO + syncTimeout:kSyncOperationTimeout]); + [ChromeEarlGrey startSync]; // Verify the guid did not change after restarting sync. - AssertSyncInitialized(true); - GREYAssertEqual(chrome_test_util::GetSyncCacheGuid(), original_guid, + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + GREYAssertEqual([ChromeEarlGrey syncCacheGUID], original_guid, @"Stored guid doesn't match current value"); } @@ -248,12 +249,13 @@ - (void)testSyncDownloadAutofillProfile { const std::string kGuid = "2340E83B-5BEE-4560-8F95-5914EF7F539E"; const std::string kFullName = "Peter Pan"; - GREYAssertFalse(chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName), + GREYAssertFalse([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName], @"autofill profile should not exist"); - - chrome_test_util::InjectAutofillProfileOnFakeSyncServer(kGuid, kFullName); + [ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:kGuid + autofillProfileName:kFullName]; [self setTearDownHandler:^{ - chrome_test_util::ClearAutofillProfile(kGuid); + [ChromeEarlGrey clearAutofillProfileWithGUID:kGuid]; }]; // Sign in to sync. @@ -263,8 +265,11 @@ [SigninEarlGreyUI signinWithIdentity:identity]; // Verify that the autofill profile has been downloaded. - AssertSyncInitialized(YES); - GREYAssertTrue(chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName), + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + GREYAssertTrue([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName], @"autofill profile should exist"); } @@ -274,12 +279,14 @@ const std::string kGuid = "2340E83B-5BEE-4560-8F95-5914EF7F539E"; const std::string kFullName = "Peter Pan"; const std::string kUpdatedFullName = "Roger Rabbit"; - GREYAssertFalse(chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName), + GREYAssertFalse([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName], @"autofill profile should not exist"); - chrome_test_util::InjectAutofillProfileOnFakeSyncServer(kGuid, kFullName); + [ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:kGuid + autofillProfileName:kFullName]; [self setTearDownHandler:^{ - chrome_test_util::ClearAutofillProfile(kGuid); + [ChromeEarlGrey clearAutofillProfileWithGUID:kGuid]; }]; // Sign in to sync. @@ -289,23 +296,28 @@ [SigninEarlGreyUI signinWithIdentity:identity]; // Verify that the autofill profile has been downloaded. - AssertSyncInitialized(YES); - GREYAssertTrue(chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName), + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + GREYAssertTrue([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName], @"autofill profile should exist"); // Update autofill profile. - chrome_test_util::InjectAutofillProfileOnFakeSyncServer(kGuid, - kUpdatedFullName); + [ChromeEarlGrey + injectAutofillProfileOnFakeSyncServerWithGUID:kGuid + autofillProfileName:kUpdatedFullName]; // Trigger sync cycle and wait for update. - chrome_test_util::TriggerSyncCycle(syncer::AUTOFILL_PROFILE); + [ChromeEarlGrey triggerSyncCycleForType:syncer::AUTOFILL_PROFILE]; NSString* errorMessage = [NSString stringWithFormat: @"Did not find autofill profile for guid: %@, and name: %@", base::SysUTF8ToNSString(kGuid), base::SysUTF8ToNSString(kUpdatedFullName)]; ConditionBlock condition = ^{ - return chrome_test_util::IsAutofillProfilePresent(kGuid, kUpdatedFullName); + return [ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kUpdatedFullName]; }; GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(kSyncOperationTimeout, condition), @@ -317,11 +329,13 @@ - (void)testSyncDeleteAutofillProfile { const std::string kGuid = "2340E83B-5BEE-4560-8F95-5914EF7F539E"; const std::string kFullName = "Peter Pan"; - GREYAssertFalse(chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName), + GREYAssertFalse([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName], @"autofill profile should not exist"); - chrome_test_util::InjectAutofillProfileOnFakeSyncServer(kGuid, kFullName); + [ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:kGuid + autofillProfileName:kFullName]; [self setTearDownHandler:^{ - chrome_test_util::ClearAutofillProfile(kGuid); + [ChromeEarlGrey clearAutofillProfileWithGUID:kGuid]; }]; // Sign in to sync. @@ -331,15 +345,19 @@ [SigninEarlGreyUI signinWithIdentity:identity]; // Verify that the autofill profile has been downloaded - AssertSyncInitialized(YES); - GREYAssertTrue(chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName), + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + GREYAssertTrue([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName], @"autofill profile should exist"); // Delete autofill profile from server, and verify it is removed. - chrome_test_util::DeleteAutofillProfileOnFakeSyncServer(kGuid); - chrome_test_util::TriggerSyncCycle(syncer::AUTOFILL_PROFILE); + [ChromeEarlGrey deleteAutofillProfileOnFakeSyncServerWithGUID:kGuid]; + [ChromeEarlGrey triggerSyncCycleForType:syncer::AUTOFILL_PROFILE]; ConditionBlock condition = ^{ - return !chrome_test_util::IsAutofillProfilePresent(kGuid, kFullName); + return ![ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid + autofillProfileName:kFullName]; }; GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(kSyncOperationTimeout, condition), @@ -370,15 +388,14 @@ [SigninEarlGreyUI signinWithIdentity:identity]; // Verify the sessions on the sync server. - AssertSyncInitialized(true); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); AssertNumberOfEntities(3, syncer::SESSIONS); - NSError* error = nil; - BOOL success = chrome_test_util::VerifySessionsOnSyncServer( - std::multiset<std::string>{URL1.spec(), URL2.spec()}, &error); - - DCHECK(success || error); - GREYAssertTrue(success, [error localizedDescription]); + CHROME_EG_ASSERT_NO_ERROR( + [ChromeEarlGrey verifySyncServerURLs:(std::multiset<std::string>{ + URL1.spec(), URL2.spec()})]); } // Tests that a typed URL (after Sync is enabled) is uploaded to the Sync @@ -386,11 +403,11 @@ - (void)testSyncTypedURLUpload { const GURL mockURL("http://not-a-real-site/"); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [self setTearDownHandler:^{ - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; }]; - chrome_test_util::AddTypedURLOnClient(mockURL); + [ChromeEarlGrey addTypedURL:mockURL]; // Sign in to sync. ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; @@ -398,37 +415,30 @@ identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(YES); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); // Trigger sync and verify the typed URL is on the fake sync server. - chrome_test_util::TriggerSyncCycle(syncer::TYPED_URLS); - __block NSError* blockSafeError = nil; - GREYCondition* condition = [GREYCondition - conditionWithName:@"Wait for typed URL to be uploaded." - block:^BOOL { - NSError* error = nil; - BOOL result = - chrome_test_util::VerifyNumberOfSyncEntitiesWithName( - syncer::TYPED_URLS, mockURL.spec(), 1, &error); - blockSafeError = [error copy]; - return result; - }]; - BOOL success = [condition waitWithTimeout:kSyncOperationTimeout]; - DCHECK(success || blockSafeError); - GREYAssertTrue(success, [blockSafeError localizedDescription]); + [ChromeEarlGrey triggerSyncCycleForType:syncer::TYPED_URLS]; + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncServerEntitiesWithType:syncer::TYPED_URLS + name:mockURL.spec() + count:1 + timeout:kSyncOperationTimeout]); } // Tests that typed url is downloaded from sync server. - (void)testSyncTypedUrlDownload { const GURL mockURL("http://not-a-real-site/"); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [self setTearDownHandler:^{ - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; }]; // Inject typed url on server. - chrome_test_util::InjectTypedURLOnFakeSyncServer(mockURL.spec()); + [ChromeEarlGrey injectTypedURLOnFakeSyncServer:mockURL.spec()]; // Sign in to sync. ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; @@ -436,20 +446,15 @@ identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(YES); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); // Wait for typed url to appear on client. - __block NSError* blockSafeError = nil; - - GREYCondition* condition = [GREYCondition - conditionWithName:@"Wait for typed URL to be downloaded." - block:^BOOL { - return chrome_test_util::IsTypedUrlPresentOnClient( - mockURL, YES, &blockSafeError); - }]; - BOOL success = [condition waitWithTimeout:kSyncOperationTimeout]; - DCHECK(success || blockSafeError); - GREYAssert(success, [blockSafeError localizedDescription]); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForTypedURL:mockURL + expectPresent:YES + timeout:kSyncOperationTimeout]); } // Tests that when typed url is deleted on the client, sync the change gets @@ -457,13 +462,13 @@ - (void)testSyncTypedURLDeleteFromClient { const GURL mockURL("http://not-a-real-site/"); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [self setTearDownHandler:^{ - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; }]; // Inject typed url on server. - chrome_test_util::InjectTypedURLOnFakeSyncServer(mockURL.spec()); + [ChromeEarlGrey injectTypedURLOnFakeSyncServer:mockURL.spec()]; // Sign in to sync. ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; @@ -471,29 +476,24 @@ identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(YES); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); // Wait for typed url to appear on client. - __block NSError* blockSafeError = nil; - - GREYCondition* condition = [GREYCondition - conditionWithName:@"Wait for typed URL to be downloaded." - block:^BOOL { - return chrome_test_util::IsTypedUrlPresentOnClient( - mockURL, YES, &blockSafeError); - }]; - BOOL success = [condition waitWithTimeout:kSyncOperationTimeout]; - DCHECK(success || blockSafeError); - GREYAssert(success, [blockSafeError localizedDescription]); - - GREYAssert(chrome_test_util::GetNumberOfSyncEntities(syncer::TYPED_URLS) == 1, - @"There should be 1 typed URL entity"); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForTypedURL:mockURL + expectPresent:YES + timeout:kSyncOperationTimeout]); + GREYAssert( + [ChromeEarlGrey numberOfSyncEntitiesWithType:syncer::TYPED_URLS] == 1, + @"There should be 1 typed URL entity"); // Delete typed URL from client. - chrome_test_util::DeleteTypedUrlFromClient(mockURL); + [ChromeEarlGrey deleteTypedURL:mockURL]; // Trigger sync and wait for typed URL to be deleted. - chrome_test_util::TriggerSyncCycle(syncer::TYPED_URLS); + [ChromeEarlGrey triggerSyncCycleForType:syncer::TYPED_URLS]; AssertNumberOfEntities(0, syncer::TYPED_URLS); } @@ -502,11 +502,11 @@ - (void)testSyncTypedURLDeleteFromServer { const GURL mockURL("http://not-a-real-site/"); - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; [self setTearDownHandler:^{ - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; }]; - chrome_test_util::AddTypedURLOnClient(mockURL); + [ChromeEarlGrey addTypedURL:mockURL]; // Sign in to sync. ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; @@ -514,28 +514,24 @@ identity); [SigninEarlGreyUI signinWithIdentity:identity]; - AssertSyncInitialized(YES); - chrome_test_util::TriggerSyncCycle(syncer::TYPED_URLS); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncInitialized:YES + syncTimeout:kSyncOperationTimeout]); + [ChromeEarlGrey triggerSyncCycleForType:syncer::TYPED_URLS]; - AssertNumberOfEntitiesWithName(1, syncer::TYPED_URLS, mockURL.spec()); - - chrome_test_util::DeleteTypedUrlFromClient(mockURL); + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForSyncServerEntitiesWithType:syncer::TYPED_URLS + name:mockURL.spec() + count:1 + timeout:kSyncOperationTimeout]); + [ChromeEarlGrey deleteTypedURL:mockURL]; // Trigger sync and wait for fake server to be updated. - chrome_test_util::TriggerSyncCycle(syncer::TYPED_URLS); - __block NSError* blockSafeError = nil; - GREYCondition* condition = [GREYCondition - conditionWithName:@"Wait for typed URL to be downloaded." - block:^BOOL { - NSError* error = nil; - BOOL result = chrome_test_util::IsTypedUrlPresentOnClient( - mockURL, NO, &error); - blockSafeError = [error copy]; - return result; - }]; - BOOL success = [condition waitWithTimeout:kSyncOperationTimeout]; - DCHECK(success || blockSafeError); - GREYAssert(success, [blockSafeError localizedDescription]); + [ChromeEarlGrey triggerSyncCycleForType:syncer::TYPED_URLS]; + CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey + waitForTypedURL:mockURL + expectPresent:NO + timeout:kSyncOperationTimeout]); } #pragma mark - Test Utilities
diff --git a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm index 1d9b40e..02f9536 100644 --- a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm +++ b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
@@ -972,32 +972,13 @@ [_tabStripView setNeedsLayout]; } -#pragma mark - -#pragma mark TabModelObserver methods - -// Observer method. -- (void)tabModel:(TabModel*)model - didInsertTab:(Tab*)tab - atIndex:(NSUInteger)modelIndex - inForeground:(BOOL)fg { - TabView* view = [self tabViewForTab:tab isSelected:fg]; - [_tabArray insertObject:view atIndex:[self indexForModelIndex:modelIndex]]; - [[self tabStripView] addSubview:view]; - - [self updateContentSizeAndRepositionViews]; - [self setNeedsLayoutWithAnimation]; - [self updateContentOffsetForTabIndex:modelIndex isNewTab:YES]; - - [self updateTabCount]; -} - -// Observer method. -- (void)tabModel:(TabModel*)model - didRemoveTab:(Tab*)tab - atIndex:(NSUInteger)modelIndex { +// Observer method, |webState| removed from |webStateList|. +- (void)webStateList:(WebStateList*)webStateList + didDetachWebState:(web::WebState*)webState + atIndex:(int)atIndex { // Keep the actual view around while it is animating out. Once the animation // is done, remove the view. - NSUInteger index = [self indexForModelIndex:modelIndex]; + NSUInteger index = [self indexForModelIndex:atIndex]; TabView* view = [_tabArray objectAtIndex:index]; [_closingTabs addObject:view]; _targetFrames.RemoveFrame(view); @@ -1030,6 +1011,25 @@ [self updateTabCount]; } +#pragma mark - +#pragma mark TabModelObserver methods + +// Observer method. +- (void)tabModel:(TabModel*)model + didInsertTab:(Tab*)tab + atIndex:(NSUInteger)modelIndex + inForeground:(BOOL)fg { + TabView* view = [self tabViewForTab:tab isSelected:fg]; + [_tabArray insertObject:view atIndex:[self indexForModelIndex:modelIndex]]; + [[self tabStripView] addSubview:view]; + + [self updateContentSizeAndRepositionViews]; + [self setNeedsLayoutWithAnimation]; + [self updateContentOffsetForTabIndex:modelIndex isNewTab:YES]; + + [self updateTabCount]; +} + // Observer method. - (void)tabModel:(TabModel*)model didMoveTab:(Tab*)tab
diff --git a/ios/chrome/browser/web/cache_egtest.mm b/ios/chrome/browser/web/cache_egtest.mm index 2418aabf..506af88 100644 --- a/ios/chrome/browser/web/cache_egtest.mm +++ b/ios/chrome/browser/web/cache_egtest.mm
@@ -209,7 +209,7 @@ web::test::SetUpHttpServer(std::make_unique<CacheTestResponseProvider>()); // Clear the history to ensure expected omnibox autocomplete results. - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; const GURL cacheTestFirstPageURL = HttpServer::MakeUrl(kCacheTestFirstPageURL);
diff --git a/ios/chrome/browser/web/progress_indicator_egtest.mm b/ios/chrome/browser/web/progress_indicator_egtest.mm index 646b0bc1..28d5612 100644 --- a/ios/chrome/browser/web/progress_indicator_egtest.mm +++ b/ios/chrome/browser/web/progress_indicator_egtest.mm
@@ -198,7 +198,7 @@ [[EarlGrey selectElementWithMatcher:ProgressViewWithProgress(0.5)] assertWithMatcher:grey_sufficientlyVisible()]; - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; infinitePendingProvider->Abort(); } @@ -240,7 +240,7 @@ [[EarlGrey selectElementWithMatcher:ProgressViewWithProgress(0.5)] assertWithMatcher:grey_sufficientlyVisible()]; - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGreyUI waitForToolbarVisible:YES]); + [ChromeEarlGreyUI waitForToolbarVisible:YES]; infinitePendingProvider->Abort(); }
diff --git a/ios/chrome/test/earl_grey/BUILD.gn b/ios/chrome/test/earl_grey/BUILD.gn index edec0f596..f9a2eb6 100644 --- a/ios/chrome/test/earl_grey/BUILD.gn +++ b/ios/chrome/test/earl_grey/BUILD.gn
@@ -248,6 +248,7 @@ "//base/test:test_support", "//components/signin/core/browser", "//components/strings", + "//components/sync/base", "//components/unified_consent", "//ios/chrome/app/strings", "//ios/chrome/browser/ui/authentication:authentication", @@ -387,6 +388,7 @@ "//base", "//base/test:test_support", "//components/content_settings/core/common:common", + "//components/sync/base", "//ios/testing:nserror_support", "//ios/testing/earl_grey:eg_test_support+eg2", "//ios/third_party/earl_grey2:test_lib",
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h index 6c20c49..6ce7e38 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -11,6 +11,7 @@ #include "base/compiler_specific.h" #import "components/content_settings/core/common/content_settings.h" +#include "components/sync/base/model_type.h" #import "ios/testing/earl_grey/base_eg_test_helper_impl.h" #include "url/gurl.h" @@ -38,8 +39,9 @@ @interface ChromeEarlGreyImpl : BaseEGTestHelperImpl #pragma mark - History Utilities -// Clears browsing history. -- (NSError*)clearBrowsingHistory WARN_UNUSED_RESULT; +// Clears browsing history. Raises an EarlGrey exception if history is not +// cleared within a timeout. +- (void)clearBrowsingHistory; @end @@ -61,7 +63,9 @@ // Loads |URL| in the current WebState with transition type // ui::PAGE_TRANSITION_TYPED, and waits for the loading to complete within a // timeout, or a GREYAssert is induced. -- (NSError*)loadURL:(const GURL&)URL WARN_UNUSED_RESULT; +// TODO(crbug.com/963613): Change return type to avoid when +// CHROME_EG_ASSERT_NO_ERROR is removed. +- (NSError*)loadURL:(const GURL&)URL; // Reloads the page and waits for the loading to complete within a timeout, or a // GREYAssert is induced. @@ -158,6 +162,94 @@ - (NSError*)waitForElementWithMatcherSufficientlyVisible: (id<GREYMatcher>)matcher WARN_UNUSED_RESULT; +#pragma mark - Sync Utilities + +// Clears fake sync server data. +- (void)clearSyncServerData; + +// Starts the sync server. The server should not be running when calling this. +- (void)startSync; + +// Stops the sync server. The server should be running when calling this. +- (void)stopSync; + +// Waits for sync to be initialized or not. Returns nil on success, or else an +// NSError indicating why the operation failed. +- (NSError*)waitForSyncInitialized:(BOOL)isInitialized + syncTimeout:(NSTimeInterval)timeout WARN_UNUSED_RESULT; + +// Returns the current sync cache guid. The sync server must be running when +// calling this. +- (std::string)syncCacheGUID WARN_UNUSED_RESULT; + +// Verifies that |count| entities of the given |type| and |name| exist on the +// sync FakeServer. Folders are not included in this count. Returns nil on +// success, or else an NSError indicating why the operation failed. +- (NSError*)waitForSyncServerEntitiesWithType:(syncer::ModelType)type + name:(const std::string&)name + count:(size_t)count + timeout:(NSTimeInterval)timeout + WARN_UNUSED_RESULT; + +// Clears the autofill profile for the given |GUID|. +- (void)clearAutofillProfileWithGUID:(const std::string&)GUID; + +// Gets the number of entities of the given |type|. +- (int)numberOfSyncEntitiesWithType:(syncer::ModelType)type WARN_UNUSED_RESULT; + +// Injects a bookmark into the fake sync server with |URL| and |title|. +- (void)injectBookmarkOnFakeSyncServerWithURL:(const std::string&)URL + bookmarkTitle:(const std::string&)title; + +// Injects an autofill profile into the fake sync server with |GUID| and +// |full_name|. +- (void)injectAutofillProfileOnFakeSyncServerWithGUID:(const std::string&)GUID + autofillProfileName: + (const std::string&)fullName; + +// Returns YES if there is an autofilll profile with the corresponding |GUID| +// and |full_name|. +- (BOOL)isAutofillProfilePresentWithGUID:(const std::string&)GUID + autofillProfileName:(const std::string&)fullName + WARN_UNUSED_RESULT; + +// Adds typed URL into HistoryService. +- (void)addTypedURL:(const GURL&)URL; + +// Triggers a sync cycle for a |type|. +- (void)triggerSyncCycleForType:(syncer::ModelType)type; + +// If the provided |url| is present (or not) if |expected_present| +// is YES (or NO) returns nil, otherwise an NSError indicating why the operation +// failed. +- (NSError*)waitForTypedURL:(const GURL&)URL + expectPresent:(BOOL)expectPresent + timeout:(NSTimeInterval)timeout WARN_UNUSED_RESULT; + +// Deletes typed URL from HistoryService. +- (void)deleteTypedURL:(const GURL&)URL; + +// Injects typed URL to sync FakeServer. +- (void)injectTypedURLOnFakeSyncServer:(const std::string&)URL; + +// Deletes an autofill profile from the fake sync server with |GUID|, if it +// exists. If it doesn't exist, nothing is done. +- (void)deleteAutofillProfileOnFakeSyncServerWithGUID:(const std::string&)GUID; + +// Verifies the sessions hierarchy on the Sync FakeServer. |expected_urls| is +// the collection of URLs that are to be expected for a single window. Returns +// nil on success, or else an NSError indicating why the operation failed. See +// the SessionsHierarchy class for documentation regarding the verification. +- (NSError*)verifySyncServerURLs:(const std::multiset<std::string>&)URLs + WARN_UNUSED_RESULT; + +// Sets up a fake sync server to be used by the ProfileSyncService. +- (void)setUpFakeSyncServer; + +// Tears down the fake sync server used by the ProfileSyncService and restores +// the real one. +- (void)tearDownFakeSyncServer; + #pragma mark - Settings Utilities // Sets value for content setting.
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm index 8ee6d3c5..6a76ba3 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -28,6 +28,7 @@ #import "ios/chrome/test/app/settings_test_util.h" // nogncheck #import "ios/chrome/test/app/signin_test_util.h" // nogncheck #import "ios/chrome/test/app/static_html_view_test_util.h" // nogncheck +#import "ios/chrome/test/app/sync_test_util.h" // nogncheck #import "ios/chrome/test/app/tab_test_util.h" // nogncheck #import "ios/web/public/test/earl_grey/js_test_util.h" // nogncheck #import "ios/web/public/test/web_view_content_test_util.h" // nogncheck @@ -53,13 +54,13 @@ #pragma mark - History Utilities -- (NSError*)clearBrowsingHistory { - NSError* error = [ChromeEarlGreyAppInterface clearBrowsingHistory]; +- (void)clearBrowsingHistory { + EG_TEST_HELPER_ASSERT_NO_ERROR( + [ChromeEarlGreyAppInterface clearBrowsingHistory]); // After clearing browsing history via code, wait for the UI to be done // with any updates. This includes icons from the new tab page being removed. [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; - return error; } @end @@ -131,17 +132,13 @@ - (NSError*)loadURL:(const GURL&)URL { chrome_test_util::LoadUrl(URL); - NSError* loadingError = [ChromeEarlGrey waitForPageToFinishLoading]; - if (loadingError) { - return loadingError; - } + bool pageLoaded = chrome_test_util::WaitForPageToFinishLoading(); + EG_TEST_HELPER_ASSERT_TRUE(pageLoaded, @"Page did not complete loading"); web::WebState* webState = chrome_test_util::GetCurrentWebState(); if (webState->ContentIsHTML()) { - if (!web::WaitUntilWindowIdInjected(webState)) { - return testing::NSErrorWithLocalizedDescription( - @"WindowID failed to inject"); - } + bool windowIDInjected = web::WaitUntilWindowIdInjected(webState); + EG_TEST_HELPER_ASSERT_TRUE(windowIDInjected, @"WindowID failed to inject"); } return nil; @@ -421,6 +418,153 @@ return nil; } +#pragma mark - Sync Utilities + +- (void)clearSyncServerData { + chrome_test_util::ClearSyncServerData(); +} + +- (void)startSync { + chrome_test_util::StartSync(); +} + +- (void)stopSync { + chrome_test_util::StopSync(); +} + +- (NSError*)waitForSyncInitialized:(BOOL)isInitialized + syncTimeout:(NSTimeInterval)timeout { + bool success = WaitUntilConditionOrTimeout(timeout, ^{ + return chrome_test_util::IsSyncInitialized() == isInitialized; + }); + + if (!success) { + return testing::NSErrorWithLocalizedDescription( + @"Sync was not initialized."); + } + + return nil; +} + +- (const std::string)syncCacheGUID { + return chrome_test_util::GetSyncCacheGuid(); +} + +- (NSError*)waitForSyncServerEntitiesWithType:(syncer::ModelType)type + name:(const std::string&)name + count:(size_t)count + timeout:(NSTimeInterval)timeout { + __block NSError* error = nil; + ConditionBlock condition = ^{ + NSError* __autoreleasing tempError = error; + BOOL success = chrome_test_util::VerifyNumberOfSyncEntitiesWithName( + type, name, count, &tempError); + error = tempError; + DCHECK(success || error); + return !!success; + }; + bool success = WaitUntilConditionOrTimeout(timeout, condition); + if (error != nil) { + return nil; + } + if (!success) { + return testing::NSErrorWithLocalizedDescription( + [NSString stringWithFormat:@"Expected %zu entities of the %d type.", + count, type]); + } + return nil; +} + +- (void)clearAutofillProfileWithGUID:(const std::string&)GUID { + chrome_test_util::ClearAutofillProfile(GUID); +} + +- (int)numberOfSyncEntitiesWithType:(syncer::ModelType)type { + return chrome_test_util::GetNumberOfSyncEntities(type); +} + +- (void)injectBookmarkOnFakeSyncServerWithURL:(const std::string&)URL + bookmarkTitle:(const std::string&)title { + chrome_test_util::InjectBookmarkOnFakeSyncServer(URL, title); +} + +- (void)injectAutofillProfileOnFakeSyncServerWithGUID:(const std::string&)GUID + autofillProfileName: + (const std::string&)fullName { + chrome_test_util::InjectAutofillProfileOnFakeSyncServer(GUID, fullName); +} + +- (BOOL)isAutofillProfilePresentWithGUID:(const std::string&)GUID + autofillProfileName:(const std::string&)fullName { + return chrome_test_util::IsAutofillProfilePresent(GUID, fullName); +} + +- (void)addTypedURL:(const GURL&)URL { + chrome_test_util::AddTypedURLOnClient(URL); +} + +- (void)triggerSyncCycleForType:(syncer::ModelType)type { + chrome_test_util::TriggerSyncCycle(type); +} + +- (NSError*)waitForTypedURL:(const GURL&)URL + expectPresent:(BOOL)expectPresent + timeout:(NSTimeInterval)timeout { + __block NSError* error = nil; + ConditionBlock condition = ^{ + NSError* __autoreleasing tempError = error; + BOOL success = chrome_test_util::IsTypedUrlPresentOnClient( + URL, expectPresent, &tempError); + error = tempError; + DCHECK(success || error); + return !!success; + }; + bool success = WaitUntilConditionOrTimeout(timeout, condition); + if (error != nil) { + return nil; + } + if (!success) { + return testing::NSErrorWithLocalizedDescription( + @"Error occurred during typed URL verification."); + } + return nil; +} + +- (void)deleteTypedURL:(const GURL&)URL { + chrome_test_util::DeleteTypedUrlFromClient(URL); +} + +- (void)injectTypedURLOnFakeSyncServer:(const std::string&)URL { + chrome_test_util::InjectTypedURLOnFakeSyncServer(URL); +} + +- (void)deleteAutofillProfileOnFakeSyncServerWithGUID:(const std::string&)GUID { + chrome_test_util::DeleteAutofillProfileOnFakeSyncServer(GUID); +} + +- (NSError*)verifySyncServerURLs:(const std::multiset<std::string>&)URLs { + NSError* error = nil; + NSError* __autoreleasing tempError = error; + BOOL success = chrome_test_util::VerifySessionsOnSyncServer(URLs, &tempError); + error = tempError; + if (error != nil) { + return error; + } + if (!success) { + return testing::NSErrorWithLocalizedDescription( + @"Error occurred during verification sessions."); + } + return nil; +} + +- (void)setUpFakeSyncServer { + chrome_test_util::SetUpFakeSyncServer(); +} + +- (void)tearDownFakeSyncServer { + chrome_test_util::TearDownFakeSyncServer(); +} + #pragma mark - Settings Utilities - (NSError*)setContentSettings:(ContentSetting)setting {
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h index 7417edb32..9378503 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h
@@ -7,82 +7,99 @@ #import <Foundation/Foundation.h> #include "base/compiler_specific.h" +#import "ios/testing/earl_grey/base_eg_test_helper_impl.h" @protocol GREYMatcher; -@class NSError; + +// Public macro to invoke helper methods in test methods (Test Process). Usage +// example: +// +// @interface PageLoadTestCase : XCTestCase +// @end +// @implementation PageLoadTestCase +// - (void)testPageload { +// [ChromeEarlGreyUI loadURL:GURL("https://chromium.org")]; +// } +// +// In this example ChromeEarlGreyUIImpl must implement -loadURL:. +// +#define ChromeEarlGreyUI \ + [ChromeEarlGreyUIImpl invokedFromFile:@"" __FILE__ lineNumber:__LINE__] // Test methods that perform actions on Chrome. These methods only affect Chrome -// using the UI with Earl Grey. -@interface ChromeEarlGreyUI : NSObject +// using the UI with Earl Grey. Used for logging the failure. Compiled in Test +// Process for EG2 and EG1. Can be extended with category methods to provide +// additional test helpers. Category method names must be unique. +@interface ChromeEarlGreyUIImpl : BaseEGTestHelperImpl // Makes the toolbar visible by swiping downward, if necessary. Then taps on // the Tools menu button. At least one tab needs to be open and visible when // calling this method. -+ (void)openToolsMenu; +- (void)openToolsMenu; // Opens the settings menu by opening the tools menu, and then tapping the // Settings button. There will be a GREYAssert if the tools menu is open when // calling this method. -+ (void)openSettingsMenu; +- (void)openSettingsMenu; // Scrolls to find the button in the Tools menu with the corresponding // |buttonMatcher|, and then taps it. If |buttonMatcher| is not found, or // the Tools menu is not open when this is called there will be a GREYAssert. -+ (void)tapToolsMenuButton:(id<GREYMatcher>)buttonMatcher; +- (void)tapToolsMenuButton:(id<GREYMatcher>)buttonMatcher; // Scrolls to find the button in the Settings menu with the corresponding // |buttonMatcher|, and then taps it. If |buttonMatcher| is not found, or // the Settings menu is not open when this is called there will be a GREYAssert. -+ (void)tapSettingsMenuButton:(id<GREYMatcher>)buttonMatcher; +- (void)tapSettingsMenuButton:(id<GREYMatcher>)buttonMatcher; // Scrolls to find the button in the Privacy menu with the corresponding // |buttonMatcher|, and then taps it. If |buttonMatcher| is not found, or // the Privacy menu is not open when this is called there will be a GREYAssert. -+ (void)tapPrivacyMenuButton:(id<GREYMatcher>)buttonMatcher; +- (void)tapPrivacyMenuButton:(id<GREYMatcher>)buttonMatcher; // Scrolls to find the button in the Clear Browsing Data menu with the // corresponding |buttonMatcher|, and then taps it. If |buttonMatcher| is // not found, or the Clear Browsing Data menu is not open when this is called // there will be a GREYAssert. -+ (void)tapClearBrowsingDataMenuButton:(id<GREYMatcher>)buttonMatcher; +- (void)tapClearBrowsingDataMenuButton:(id<GREYMatcher>)buttonMatcher; // Scrolls to find the button in the accounts menu with the corresponding // |buttonMatcher|, and then taps it. If |buttonMatcher| is not found, or the // accounts menu is not open when this is called there will be a GREYAssert. -+ (void)tapAccountsMenuButton:(id<GREYMatcher>)buttonMatcher; +- (void)tapAccountsMenuButton:(id<GREYMatcher>)buttonMatcher; // Focuses the omnibox by tapping and types |text| into it. The '\n' symbol can // be passed in order to commit the string. // If |text| is empty or nil, the omnibox is just focused. -+ (void)focusOmniboxAndType:(NSString*)text; +- (void)focusOmniboxAndType:(NSString*)text; // Focuses the omnibox by tapping it. -+ (void)focusOmnibox; +- (void)focusOmnibox; // Open a new tab via the tools menu. -+ (void)openNewTab; +- (void)openNewTab; // Open a new incognito tab via the tools menu. -+ (void)openNewIncognitoTab; +- (void)openNewIncognitoTab; // Open and clear browsing data from history. -+ (void)openAndClearBrowsingDataFromHistory; +- (void)openAndClearBrowsingDataFromHistory; // Assert that history is empty. -+ (void)assertHistoryHasNoEntries; +- (void)assertHistoryHasNoEntries; // Reloads the page via the reload button, and does not wait for the page to // finish loading. -+ (void)reload; +- (void)reload; // Opens the share menu via the share button. // This method requires that there is at least one tab open. -+ (void)openShareMenu; +- (void)openShareMenu; // Waits for toolbar to become visible if |isVisible| is YES, otherwise waits // for it to disappear. If the condition is not met within a timeout, a // GREYAssert is induced. -+ (NSError*)waitForToolbarVisible:(BOOL)isVisible WARN_UNUSED_RESULT; +- (void)waitForToolbarVisible:(BOOL)isVisible; @end
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm index 48e5c87b..134ed83 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
@@ -47,9 +47,9 @@ } } // namespace -@implementation ChromeEarlGreyUI +@implementation ChromeEarlGreyUIImpl -+ (void)openToolsMenu { +- (void)openToolsMenu { // TODO(crbug.com/639524): Add logic to ensure the app is in the correct // state, for example DCHECK if no tabs are displayed. [[[EarlGrey @@ -63,12 +63,12 @@ // to always find it. } -+ (void)openSettingsMenu { +- (void)openSettingsMenu { [ChromeEarlGreyUI openToolsMenu]; [ChromeEarlGreyUI tapToolsMenuButton:SettingsMenuButton()]; } -+ (void)tapToolsMenuButton:(id<GREYMatcher>)buttonMatcher { +- (void)tapToolsMenuButton:(id<GREYMatcher>)buttonMatcher { id<GREYMatcher> interactableSettingsButton = grey_allOf(buttonMatcher, grey_interactable(), nil); [[[EarlGrey selectElementWithMatcher:interactableSettingsButton] @@ -76,7 +76,7 @@ onElementWithMatcher:ToolsMenuView()] performAction:grey_tap()]; } -+ (void)tapSettingsMenuButton:(id<GREYMatcher>)buttonMatcher { +- (void)tapSettingsMenuButton:(id<GREYMatcher>)buttonMatcher { id<GREYMatcher> interactableButtonMatcher = grey_allOf(buttonMatcher, grey_interactable(), nil); [[[EarlGrey selectElementWithMatcher:interactableButtonMatcher] @@ -85,7 +85,7 @@ performAction:grey_tap()]; } -+ (void)tapClearBrowsingDataMenuButton:(id<GREYMatcher>)buttonMatcher { +- (void)tapClearBrowsingDataMenuButton:(id<GREYMatcher>)buttonMatcher { id<GREYMatcher> interactableButtonMatcher = grey_allOf(buttonMatcher, grey_interactable(), nil); [[[EarlGrey selectElementWithMatcher:interactableButtonMatcher] @@ -93,7 +93,7 @@ onElementWithMatcher:ClearBrowsingDataView()] performAction:grey_tap()]; } -+ (void)openAndClearBrowsingDataFromHistory { +- (void)openAndClearBrowsingDataFromHistory { // Open Clear Browsing Data Button [[EarlGrey selectElementWithMatcher: @@ -126,7 +126,7 @@ performAction:grey_tap()]; } -+ (void)assertHistoryHasNoEntries { +- (void)assertHistoryHasNoEntries { id<GREYMatcher> noHistoryMessageMatcher = grey_allOf(grey_text(l10n_util::GetNSString(IDS_HISTORY_NO_RESULTS)), grey_sufficientlyVisible(), nil); @@ -140,7 +140,7 @@ assertWithMatcher:grey_nil()]; } -+ (void)tapPrivacyMenuButton:(id<GREYMatcher>)buttonMatcher { +- (void)tapPrivacyMenuButton:(id<GREYMatcher>)buttonMatcher { id<GREYMatcher> interactableButtonMatcher = grey_allOf(buttonMatcher, grey_interactable(), nil); [[[EarlGrey selectElementWithMatcher:interactableButtonMatcher] @@ -149,30 +149,29 @@ performAction:grey_tap()]; } -+ (void)tapAccountsMenuButton:(id<GREYMatcher>)buttonMatcher { +- (void)tapAccountsMenuButton:(id<GREYMatcher>)buttonMatcher { [[[EarlGrey selectElementWithMatcher:buttonMatcher] usingSearchAction:ScrollDown() onElementWithMatcher:grey_accessibilityID(kSettingsAccountsTableViewId)] performAction:grey_tap()]; } -+ (void)focusOmniboxAndType:(NSString*)text { - [[EarlGrey - selectElementWithMatcher:chrome_test_util::DefocusedLocationView()] - performAction:grey_tap()]; +- (void)focusOmniboxAndType:(NSString*)text { + [[EarlGrey selectElementWithMatcher:chrome_test_util::DefocusedLocationView()] + performAction:grey_tap()]; - if (text.length) { - [[EarlGrey selectElementWithMatcher:chrome_test_util::Omnibox()] - performAction:grey_typeText(text)]; - } + if (text.length) { + [[EarlGrey selectElementWithMatcher:chrome_test_util::Omnibox()] + performAction:grey_typeText(text)]; + } } -+ (void)focusOmnibox { +- (void)focusOmnibox { [[EarlGrey selectElementWithMatcher:chrome_test_util::DefocusedLocationView()] performAction:grey_tap()]; } -+ (void)openNewTab { +- (void)openNewTab { [ChromeEarlGreyUI openToolsMenu]; id<GREYMatcher> newTabButtonMatcher = grey_accessibilityID(kToolsMenuNewTabId); @@ -181,7 +180,7 @@ [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; } -+ (void)openNewIncognitoTab { +- (void)openNewIncognitoTab { [ChromeEarlGreyUI openToolsMenu]; id<GREYMatcher> newIncognitoTabMatcher = grey_accessibilityID(kToolsMenuNewIncognitoTabId); @@ -190,7 +189,7 @@ [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; } -+ (void)reload { +- (void)reload { // On iPhone Reload button is a part of tools menu, so open it. if (IsCompactWidth()) { [self openToolsMenu]; @@ -199,12 +198,12 @@ performAction:grey_tap()]; } -+ (void)openShareMenu { +- (void)openShareMenu { [[EarlGrey selectElementWithMatcher:chrome_test_util::ShareButton()] performAction:grey_tap()]; } -+ (NSError*)waitForToolbarVisible:(BOOL)isVisible { +- (void)waitForToolbarVisible:(BOOL)isVisible { const NSTimeInterval kWaitForToolbarAnimationTimeout = 1.0; ConditionBlock condition = ^{ NSError* error = nil; @@ -217,12 +216,9 @@ NSString* errorMessage = isVisible ? @"Toolbar was not visible" : @"Toolbar was visible"; - if (!base::test::ios::WaitUntilConditionOrTimeout( - kWaitForToolbarAnimationTimeout, condition)) { - return testing::NSErrorWithLocalizedDescription(errorMessage); - } - - return nil; + bool toolbarVisibility = base::test::ios::WaitUntilConditionOrTimeout( + kWaitForToolbarAnimationTimeout, condition); + EG_TEST_HELPER_ASSERT_TRUE(toolbarVisibility, errorMessage); } @end
diff --git a/ios/chrome/test/earl_grey/chrome_test_case.mm b/ios/chrome/test/earl_grey/chrome_test_case.mm index 81ce81c..a003517 100644 --- a/ios/chrome/test/earl_grey/chrome_test_case.mm +++ b/ios/chrome/test/earl_grey/chrome_test_case.mm
@@ -17,7 +17,6 @@ #include "components/signin/core/browser/signin_switches.h" #import "ios/chrome/test/app/chrome_test_util.h" #include "ios/chrome/test/app/signin_test_util.h" -#import "ios/chrome/test/app/sync_test_util.h" #import "ios/chrome/test/app/tab_test_util.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/testing/earl_grey/coverage_utils.h" @@ -288,7 +287,7 @@ // Make sure local data is cleared, before disabling mock authentication, // where data may be sent to real servers. chrome_test_util::SignOutAndClearAccounts(); - chrome_test_util::TearDownFakeSyncServer(); + [ChromeEarlGrey tearDownFakeSyncServer]; chrome_test_util::TearDownMockAccountReconcilor(); chrome_test_util::TearDownMockAuthentication(); } @@ -296,7 +295,7 @@ + (void)enableMockAuthentication { chrome_test_util::SetUpMockAuthentication(); chrome_test_util::SetUpMockAccountReconcilor(); - chrome_test_util::SetUpFakeSyncServer(); + [ChromeEarlGrey setUpFakeSyncServer]; } + (void)stopHTTPServer {
diff --git a/ios/chrome/test/earl_grey2/smoke_egtest.mm b/ios/chrome/test/earl_grey2/smoke_egtest.mm index ead9aa9..b2f0add 100644 --- a/ios/chrome/test/earl_grey2/smoke_egtest.mm +++ b/ios/chrome/test/earl_grey2/smoke_egtest.mm
@@ -82,7 +82,7 @@ // Tests that helpers from chrome_earl_grey.h are available for use in tests. - (void)testClearBrowsingHistory { - CHROME_EG_ASSERT_NO_ERROR([ChromeEarlGrey clearBrowsingHistory]); + [ChromeEarlGrey clearBrowsingHistory]; } @end
diff --git a/ios/web/download/BUILD.gn b/ios/web/download/BUILD.gn index e9a50d1..9341790 100644 --- a/ios/web/download/BUILD.gn +++ b/ios/web/download/BUILD.gn
@@ -6,6 +6,7 @@ source_set("download") { deps = [ + ":download_cookies", "//base", "//ios/web/net/cookies", "//ios/web/public", @@ -26,10 +27,29 @@ configs += [ "//build/config/compiler:enable_arc" ] } +source_set("download_cookies") { + visibility = [ ":*" ] + + deps = [ + "//ios/net", + "//net", + ] + + sources = [ + "download_session_cookie_storage.h", + "download_session_cookie_storage.mm", + ] + + libs = [ "Foundation.framework" ] + + configs += [ "//build/config/compiler:enable_arc" ] +} + source_set("download_unittests") { configs += [ "//build/config/compiler:enable_arc" ] testonly = true deps = [ + ":download_cookies", "//base", "//base/test:test_support", "//ios/testing:ocmock_support", @@ -46,6 +66,7 @@ sources = [ "download_controller_impl_unittest.mm", + "download_session_cookie_storage_unittest.mm", "download_task_impl_unittest.mm", ] }
diff --git a/ios/web/download/download_controller_impl.mm b/ios/web/download/download_controller_impl.mm index fbdb86d..d006883 100644 --- a/ios/web/download/download_controller_impl.mm +++ b/ios/web/download/download_controller_impl.mm
@@ -5,6 +5,7 @@ #import "ios/web/download/download_controller_impl.h" #include "base/strings/sys_string_conversions.h" +#import "ios/web/download/download_session_cookie_storage.h" #include "ios/web/public/browser_state.h" #import "ios/web/public/download/download_controller_delegate.h" #import "ios/web/public/web_client.h" @@ -89,11 +90,16 @@ NSOperationQueue* delegate_queue) { NSURLSessionConfiguration* configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:identifier]; + configuration.HTTPCookieStorage = [[DownloadSessionCookieStorage alloc] init]; + configuration.HTTPCookieStorage.cookieAcceptPolicy = + [NSHTTPCookieStorage sharedHTTPCookieStorage].cookieAcceptPolicy; // Cookies have to be set in session configuration before the session is // created. Once the session is created, the configuration object can't be // edited and configuration property will return a copy of the originally used // configuration. for (NSHTTPCookie* cookie in cookies) { + // Cookies copied from the internal WebSiteDataStore cookie store, so + // there will be no duplications or invalid cookies. [configuration.HTTPCookieStorage setCookie:cookie]; } std::string user_agent = GetWebClient()->GetUserAgent(UserAgentType::MOBILE);
diff --git a/ios/web/download/download_session_cookie_storage.h b/ios/web/download/download_session_cookie_storage.h new file mode 100644 index 0000000..da266ba --- /dev/null +++ b/ios/web/download/download_session_cookie_storage.h
@@ -0,0 +1,29 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_DOWNLOAD_DOWNLOAD_SESSION_COOKIE_STORAGE_H_ +#define IOS_WEB_DOWNLOAD_DOWNLOAD_SESSION_COOKIE_STORAGE_H_ + +#include <Foundation/Foundation.h> + +// Cookie Storage that only save cookies in memory. It assumes that all cookies +// set calls will have valid cookies and conform to the global cookies accept +// policy. This cookie store class expects setting & getting cookies methods +// calls and setting cookies accept policy calls. Other methods of the class are +// no op. +// This Cookie store is solely used by the download session, which will only +// retrieve cookies using |cookiesForURL:| when creating the retrieve request. +// After that these cookies are not useful, and it'll be safe to discard them +// and only have the version kept by the WebSiteDataStore internal cookie store. +// The reason why an instance of NSHTTPCookieStorage class (shared or newly +// created) can not be used directly in the download session is that it takes +// too long blocking UI thread when setting large number of cookies. +@interface DownloadSessionCookieStorage : NSHTTPCookieStorage + +@property(nullable, readonly, copy) NSMutableArray<NSHTTPCookie*>* cookies; +@property NSHTTPCookieAcceptPolicy cookieAcceptPolicy; + +@end + +#endif // IOS_WEB_DOWNLOAD_DOWNLOAD_SESSION_COOKIE_STORAGE_H_
diff --git a/ios/web/download/download_session_cookie_storage.mm b/ios/web/download/download_session_cookie_storage.mm new file mode 100644 index 0000000..de71338 --- /dev/null +++ b/ios/web/download/download_session_cookie_storage.mm
@@ -0,0 +1,90 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web/download/download_session_cookie_storage.h" + +#include "ios/net/cookies/system_cookie_util.h" +#import "net/base/mac/url_conversions.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation DownloadSessionCookieStorage + +@synthesize cookies = _cookies; +@synthesize cookieAcceptPolicy = _cookieAcceptPolicy; + +- (instancetype)init { + if (self = [super init]) { + _cookies = [[NSMutableArray alloc] init]; + } + return self; +} + +// This method assumes that it will be called with valid cookies, with no +// repeated cookies and no expired cookies. +- (void)setCookie:(NSHTTPCookie*)cookie { + if (self.cookieAcceptPolicy == NSHTTPCookieAcceptPolicyNever) { + return; + } + [_cookies addObject:cookie]; +} + +- (void)deleteCookie:(NSHTTPCookie*)cookie { + NOTREACHED(); +} + +- (nullable NSArray<NSHTTPCookie*>*)cookiesForURL:(NSURL*)URL { + NSMutableArray<NSHTTPCookie*>* result = [NSMutableArray array]; + GURL gURL = net::GURLWithNSURL(URL); + net::CookieOptions options; + options.set_include_httponly(); + for (NSHTTPCookie* cookie in self.cookies) { + net::CanonicalCookie canonical_cookie = + net::CanonicalCookieFromSystemCookie(cookie, base::Time()); + if (canonical_cookie.IncludeForRequestURL(gURL, options) == + net::CanonicalCookie::CookieInclusionStatus::INCLUDE) { + [result addObject:cookie]; + } + } + return [result copy]; +} + +- (nullable NSArray<NSHTTPCookie*>*)cookies { + return [_cookies copy]; +} + +- (void)setCookies:(NSArray<NSHTTPCookie*>*)cookies + forURL:(nullable NSURL*)URL + mainDocumentURL:(nullable NSURL*)mainDocumentURL { + if (self.cookieAcceptPolicy == NSHTTPCookieAcceptPolicyNever) { + return; + } + if (self.cookieAcceptPolicy == + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain) { + if (!mainDocumentURL.host || + ![[@"." stringByAppendingString:URL.host] + hasSuffix:[@"." stringByAppendingString:mainDocumentURL.host]]) { + return; + } + } + [_cookies addObjectsFromArray:cookies]; +} + +- (void)storeCookies:(NSArray<NSHTTPCookie*>*)cookies + forTask:(NSURLSessionTask*)task { + [self setCookies:cookies + forURL:task.currentRequest.URL + mainDocumentURL:task.currentRequest.mainDocumentURL]; +} + +- (void)getCookiesForTask:(NSURLSessionTask*)task + completionHandler:(void (^)(NSArray<NSHTTPCookie*>* _Nullable cookies)) + completionHandler { + if (completionHandler) + completionHandler([self cookiesForURL:task.currentRequest.URL]); +} + +@end
diff --git a/ios/web/download/download_session_cookie_storage_unittest.mm b/ios/web/download/download_session_cookie_storage_unittest.mm new file mode 100644 index 0000000..c1d60df --- /dev/null +++ b/ios/web/download/download_session_cookie_storage_unittest.mm
@@ -0,0 +1,220 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web/download/download_session_cookie_storage.h" + +#include "testing/gtest/include/gtest/gtest.h" +#include "testing/gtest_mac.h" +#include "testing/platform_test.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +// Creates NSHTTPCookie with the given proprties. +NSHTTPCookie* MakeCookie(NSString* url_string, + NSString* name, + NSString* value) { + NSURL* url = [NSURL URLWithString:url_string]; + return [NSHTTPCookie cookieWithProperties:@{ + NSHTTPCookiePath : url.path, + NSHTTPCookieName : name, + NSHTTPCookieValue : value, + NSHTTPCookieDomain : url.host, + }]; +} +} // namespace + +// Test fixture for testing DownloadSessionCookieStorage class. +class DownloadSessionCookieStorageTest : public PlatformTest { + public: + DownloadSessionCookieStorageTest() + : cookie_store_([[DownloadSessionCookieStorage alloc] init]) {} + + DownloadSessionCookieStorage* cookie_store_; +}; + +// Tests that setting cookies and getting cookies work correctly. +TEST_F(DownloadSessionCookieStorageTest, CookiesSetAndGet) { + ASSERT_FALSE(cookie_store_.cookies.count); + NSHTTPCookie* cookie = MakeCookie(@"http://foo.cookiestest.test/bar/test", + /*name=*/@"test1", /*value=*/@"value1"); + [cookie_store_ setCookie:cookie]; + NSArray<NSHTTPCookie*>* cookies = cookie_store_.cookies; + EXPECT_EQ(1U, cookies.count); + EXPECT_NSEQ(cookie, cookies.firstObject); +} + +// Tests that getting cookies for a specific URL works correctly +TEST_F(DownloadSessionCookieStorageTest, CookiesForURL) { + ASSERT_FALSE(cookie_store_.cookies.count); + + NSHTTPCookie* test_cookie_1 = + MakeCookie(/*url_string=*/@"http://foo.cookiestest.test/bar/test", + /*name=*/@"test1", /*value=*/@"value1"); + [cookie_store_ setCookie:test_cookie_1]; + + NSHTTPCookie* test_cookie_2 = + MakeCookie(/*url_string=*/@"http://foo.cookiestest.test/bar", + /*name=*/@"test2", /*value=*/@"value2"); + [cookie_store_ setCookie:test_cookie_2]; + + NSHTTPCookie* test_cookie_3 = + MakeCookie(/*url_string=*/@"http://abc.cookiestest.test/bar", + /*name=*/@"test3", /*value=*/@"value3"); + [cookie_store_ setCookie:test_cookie_3]; + + NSArray<NSHTTPCookie*>* cookies = [cookie_store_ + cookiesForURL: + [NSURL URLWithString:@"http://foo.cookiestest.test/bar/test/foo"]]; + EXPECT_EQ(2U, cookies.count); + EXPECT_TRUE([cookies containsObject:test_cookie_1]); + EXPECT_TRUE([cookies containsObject:test_cookie_2]); +} + +// Tests that |getCookiesForTask| uses the correct URL to get cookies, and also +// invokes the completion handler successfully on the result. +TEST_F(DownloadSessionCookieStorageTest, GetCookiesForTask) { + ASSERT_FALSE(cookie_store_.cookies.count); + NSURL* test_cookie1_url = + [NSURL URLWithString:@"http://foo.cookiestest.test/bar"]; + NSHTTPCookie* test_cookie_1 = + MakeCookie(/*url_string=*/@"http://foo.cookiestest.test/bar", + /*name=*/@"test1", /*value=*/@"value1"); + [cookie_store_ setCookie:test_cookie_1]; + + NSHTTPCookie* test_cookie_2 = + MakeCookie(/*url_string=*/@"http://abc.cookiestest.test/bar", + /*name=*/@"test2", /*value=*/@"value2"); + [cookie_store_ setCookie:test_cookie_2]; + + __block bool callback_called = false; + NSURLSessionTask* task = + [[NSURLSession sharedSession] dataTaskWithURL:test_cookie1_url]; + [cookie_store_ getCookiesForTask:task + completionHandler:^(NSArray<NSHTTPCookie*>* cookies) { + EXPECT_EQ(1U, cookies.count); + EXPECT_NSEQ(test_cookie_1, cookies.firstObject); + callback_called = true; + }]; + EXPECT_TRUE(callback_called); +} + +// Tests that |storeCookies:forTask:| works correctly and respects the +// |cookieAcceptPolicy|. +TEST_F(DownloadSessionCookieStorageTest, StoreCookiesForTask) { + ASSERT_FALSE(cookie_store_.cookies.count); + + // Only accept Main Domain cookies. + cookie_store_.cookieAcceptPolicy = + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; + + NSURL* test_cookie1_url = + [NSURL URLWithString:@"http://foo.test.cookiestest.test/abc"]; + NSHTTPCookie* test_cookie_1 = + MakeCookie(/*url_string=*/@"http://foo.test.cookiestest.test/abc", + /*name=*/@"a", /*value=*/@"b"); + + NSURL* test_cookie2_url = + [NSURL URLWithString:@"http://abc.foo.cookiestest.test/abc"]; + NSHTTPCookie* test_cookie_2 = + MakeCookie(/*url_string=*/@"http://abc.foo.cookiestest.test/abc", + /*name=*/@"a", /*value=*/@"b"); + + NSMutableURLRequest* request = + [NSMutableURLRequest requestWithURL:test_cookie1_url]; + request.mainDocumentURL = + [NSURL URLWithString:@"http://foo.cookiestest.test/xyz"]; + + NSURLSessionTask* task = + [[NSURLSession sharedSession] dataTaskWithRequest:request]; + [cookie_store_ storeCookies:@[ test_cookie_1 ] forTask:task]; + EXPECT_FALSE(cookie_store_.cookies.count); + + request.URL = test_cookie2_url; + task = [[NSURLSession sharedSession] dataTaskWithRequest:request]; + [cookie_store_ storeCookies:@[ test_cookie_2 ] forTask:task]; + EXPECT_EQ(1U, cookie_store_.cookies.count); + EXPECT_NSEQ(test_cookie_2, cookie_store_.cookies.firstObject); + + // Accept all Domain cookies. + cookie_store_.cookieAcceptPolicy = NSHTTPCookieAcceptPolicyAlways; + + request.URL = test_cookie1_url; + task = [[NSURLSession sharedSession] dataTaskWithRequest:request]; + [cookie_store_ storeCookies:@[ test_cookie_1 ] forTask:task]; + NSArray<NSHTTPCookie*>* result = cookie_store_.cookies; + EXPECT_EQ(2U, result.count); + EXPECT_TRUE([result containsObject:test_cookie_1]); +} + +// Tests that setCookiesForURL: respects the |cookieAcceptPolicy| settings. +TEST_F(DownloadSessionCookieStorageTest, SetCookiesForURL) { + ASSERT_FALSE(cookie_store_.cookies.count); + + NSURL* main_doc_url = + [NSURL URLWithString:@"http://foo.cookiestest.test/xyz"]; + + // Only accept Main Domain cookies. + cookie_store_.cookieAcceptPolicy = + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; + + NSURL* test_cookie1_url = + [NSURL URLWithString:@"http://foo.test.cookiestest.test/abc"]; + NSHTTPCookie* test_cookie_1 = + MakeCookie(/*url_string=*/@"http://foo.test.cookiestest.test/abc", + /*name=*/@"a", /*value=*/@"b"); + [cookie_store_ setCookies:@[ test_cookie_1 ] + forURL:test_cookie1_url + mainDocumentURL:main_doc_url]; + EXPECT_FALSE(cookie_store_.cookies.count); + + NSURL* test_cookie2_url = + [NSURL URLWithString:@"http://abc.foo.cookiestest.test/abc"]; + NSHTTPCookie* test_cookie_2 = + MakeCookie(/*url_string=*/@"http://abc.foo.cookiestest.test/abc", + /*name=*/@"a", /*value=*/@"b"); + [cookie_store_ setCookies:@[ test_cookie_2 ] + forURL:test_cookie2_url + mainDocumentURL:main_doc_url]; + + EXPECT_EQ(1U, cookie_store_.cookies.count); + EXPECT_NSEQ(test_cookie_2, cookie_store_.cookies.firstObject); + + // Accept all Domain cookies. + cookie_store_.cookieAcceptPolicy = NSHTTPCookieAcceptPolicyAlways; + [cookie_store_ setCookies:@[ test_cookie_1 ] + forURL:test_cookie1_url + mainDocumentURL:main_doc_url]; + NSArray<NSHTTPCookie*>* result = cookie_store_.cookies; + EXPECT_EQ(2U, result.count); + EXPECT_TRUE([result containsObject:test_cookie_1]); +} + +// Tests that when |cookieAcceptPolicy| is set to +// |NSHTTPCookieAcceptPolicyNever|, no cookies will be saved. +TEST_F(DownloadSessionCookieStorageTest, NeverAcceptCookies) { + ASSERT_FALSE(cookie_store_.cookies.count); + // By default Cookies accept policy is NSHTTPCookieAcceptPolicyAlways. + EXPECT_EQ(cookie_store_.cookieAcceptPolicy, NSHTTPCookieAcceptPolicyAlways); + + cookie_store_.cookieAcceptPolicy = NSHTTPCookieAcceptPolicyNever; + NSURL* test_cookie_url = [NSURL URLWithString:@"http://foo.cookiestest.test"]; + NSHTTPCookie* cookie = + MakeCookie(/*url_string=*/@"http://foo.cookiestest.test", /*name=*/@"a", + /*value=*/@"b"); + [cookie_store_ setCookie:cookie]; + EXPECT_FALSE(cookie_store_.cookies.count); + + [cookie_store_ setCookies:@[ cookie ] + forURL:test_cookie_url + mainDocumentURL:test_cookie_url]; + EXPECT_FALSE(cookie_store_.cookies.count); + + NSURLSessionTask* task = + [[NSURLSession sharedSession] dataTaskWithURL:test_cookie_url]; + [cookie_store_ storeCookies:@[ cookie ] forTask:task]; + EXPECT_FALSE(cookie_store_.cookies.count); +}
diff --git a/media/base/decryptor.h b/media/base/decryptor.h index b865cab..62b7902c 100644 --- a/media/base/decryptor.h +++ b/media/base/decryptor.h
@@ -121,9 +121,10 @@ // - Set to kError if unexpected error has occurred. In this case the // returned frame(s) must be NULL/empty. // Second parameter: The decoded video frame or audio buffers. - typedef base::Callback<void(Status, const AudioFrames&)> AudioDecodeCB; - typedef base::Callback<void(Status, - const scoped_refptr<VideoFrame>&)> VideoDecodeCB; + typedef base::RepeatingCallback<void(Status, const AudioFrames&)> + AudioDecodeCB; + typedef base::RepeatingCallback<void(Status, scoped_refptr<VideoFrame>)> + VideoDecodeCB; // Decrypts and decodes the |encrypted| buffer. The status and the decrypted // buffer are returned via the provided callback.
diff --git a/media/base/null_video_sink.cc b/media/base/null_video_sink.cc index a91a813f..128212e 100644 --- a/media/base/null_video_sink.cc +++ b/media/base/null_video_sink.cc
@@ -87,14 +87,14 @@ delay); } -void NullVideoSink::PaintSingleFrame(const scoped_refptr<VideoFrame>& frame, +void NullVideoSink::PaintSingleFrame(scoped_refptr<VideoFrame> frame, bool repaint_duplicate_frame) { if (!repaint_duplicate_frame && frame == last_frame_) return; last_frame_ = frame; if (new_frame_cb_) - new_frame_cb_.Run(frame); + new_frame_cb_.Run(std::move(frame)); } } // namespace media
diff --git a/media/base/null_video_sink.h b/media/base/null_video_sink.h index 54cd9549..1d5a31a 100644 --- a/media/base/null_video_sink.h +++ b/media/base/null_video_sink.h
@@ -20,7 +20,7 @@ class MEDIA_EXPORT NullVideoSink : public VideoRendererSink { public: - using NewFrameCB = base::Callback<void(const scoped_refptr<VideoFrame>&)>; + using NewFrameCB = base::RepeatingCallback<void(scoped_refptr<VideoFrame>)>; // Periodically calls |callback| every |interval| on |task_runner| once the // sink has been started. If |clockless| is true, the RenderCallback will @@ -35,7 +35,7 @@ // VideoRendererSink implementation. void Start(RenderCallback* callback) override; void Stop() override; - void PaintSingleFrame(const scoped_refptr<VideoFrame>& frame, + void PaintSingleFrame(scoped_refptr<VideoFrame> frame, bool repaint_duplicate_frame) override; void set_tick_clock_for_testing(const base::TickClock* tick_clock) {
diff --git a/media/base/null_video_sink_unittest.cc b/media/base/null_video_sink_unittest.cc index 66eb929e..5909ec9b 100644 --- a/media/base/null_video_sink_unittest.cc +++ b/media/base/null_video_sink_unittest.cc
@@ -58,7 +58,7 @@ bool)); MOCK_METHOD0(OnFrameDropped, void()); - MOCK_METHOD1(FrameReceived, void(const scoped_refptr<VideoFrame>&)); + MOCK_METHOD1(FrameReceived, void(scoped_refptr<VideoFrame>)); protected: base::MessageLoop message_loop_;
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc index e09e5617..88b83a7 100644 --- a/media/base/video_frame_unittest.cc +++ b/media/base/video_frame_unittest.cc
@@ -259,9 +259,8 @@ } } -static void FrameNoLongerNeededCallback( - const scoped_refptr<media::VideoFrame>& frame, - bool* triggered) { +static void FrameNoLongerNeededCallback(scoped_refptr<media::VideoFrame> frame, + bool* triggered) { *triggered = true; }
diff --git a/media/base/video_renderer_sink.h b/media/base/video_renderer_sink.h index 8cb5b6f..2598d0c 100644 --- a/media/base/video_renderer_sink.h +++ b/media/base/video_renderer_sink.h
@@ -62,7 +62,7 @@ // useful for painting poster images or hole frames without having to issue a // Start() -> Render() -> Stop(). Clients are free to mix usage of Render() // based painting and PaintSingleFrame(). - virtual void PaintSingleFrame(const scoped_refptr<VideoFrame>& frame, + virtual void PaintSingleFrame(scoped_refptr<VideoFrame> frame, bool repaint_duplicate_frame = false) = 0; virtual ~VideoRendererSink() {}
diff --git a/media/base/video_thumbnail_decoder_unittest.cc b/media/base/video_thumbnail_decoder_unittest.cc index a898b1c..4f7dee3 100644 --- a/media/base/video_thumbnail_decoder_unittest.cc +++ b/media/base/video_thumbnail_decoder_unittest.cc
@@ -60,7 +60,7 @@ return thumbnail_decoder_.get(); } MockVideoDecoder* mock_video_decoder() { return mock_video_decoder_; } - const scoped_refptr<VideoFrame>& frame() { return frame_; } + scoped_refptr<VideoFrame> frame() { return frame_; } private: void OnFrameDecoded(scoped_refptr<VideoFrame> frame) {
diff --git a/media/base/video_util.cc b/media/base/video_util.cc index 81c67675..8f4e0c22 100644 --- a/media/base/video_util.cc +++ b/media/base/video_util.cc
@@ -18,7 +18,7 @@ namespace { // Empty method used for keeping a reference to the original media::VideoFrame. -void ReleaseOriginalFrame(const scoped_refptr<media::VideoFrame>& frame) {} +void ReleaseOriginalFrame(scoped_refptr<media::VideoFrame> frame) {} // Helper to apply padding to the region outside visible rect up to the coded // size with the repeated last column / row of the visible rect. @@ -423,7 +423,7 @@ } scoped_refptr<VideoFrame> WrapAsI420VideoFrame( - const scoped_refptr<VideoFrame>& frame) { + scoped_refptr<VideoFrame> frame) { DCHECK_EQ(VideoFrame::STORAGE_OWNED_MEMORY, frame->storage_type()); DCHECK_EQ(PIXEL_FORMAT_I420A, frame->format()); @@ -434,7 +434,7 @@ if (!wrapped_frame) return nullptr; wrapped_frame->AddDestructionObserver( - base::Bind(&ReleaseOriginalFrame, frame)); + base::BindOnce(&ReleaseOriginalFrame, std::move(frame))); return wrapped_frame; }
diff --git a/media/base/video_util.h b/media/base/video_util.h index 2d5d47b2..2b7e4f2 100644 --- a/media/base/video_util.h +++ b/media/base/video_util.h
@@ -133,7 +133,7 @@ // Converts a frame with YV12A format into I420 by dropping alpha channel. MEDIA_EXPORT scoped_refptr<VideoFrame> WrapAsI420VideoFrame( - const scoped_refptr<VideoFrame>& frame); + scoped_refptr<VideoFrame> frame); // Copy I420 video frame to match the required coded size and pad the region // outside the visible rect repeatly with the last column / row up to the coded
diff --git a/media/blink/video_frame_compositor.cc b/media/blink/video_frame_compositor.cc index 0f40a4c4..09bdae9 100644 --- a/media/blink/video_frame_compositor.cc +++ b/media/blink/video_frame_compositor.cc
@@ -154,11 +154,10 @@ return current_frame_; } -void VideoFrameCompositor::SetCurrentFrame( - const scoped_refptr<VideoFrame>& frame) { +void VideoFrameCompositor::SetCurrentFrame(scoped_refptr<VideoFrame> frame) { DCHECK(task_runner_->BelongsToCurrentThread()); base::AutoLock lock(current_frame_lock_); - current_frame_ = frame; + current_frame_ = std::move(frame); } void VideoFrameCompositor::PutCurrentFrame() { @@ -209,17 +208,16 @@ base::Unretained(this), false)); } -void VideoFrameCompositor::PaintSingleFrame( - const scoped_refptr<VideoFrame>& frame, - bool repaint_duplicate_frame) { +void VideoFrameCompositor::PaintSingleFrame(scoped_refptr<VideoFrame> frame, + bool repaint_duplicate_frame) { if (!task_runner_->BelongsToCurrentThread()) { task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&VideoFrameCompositor::PaintSingleFrame, - base::Unretained(this), frame, repaint_duplicate_frame)); + FROM_HERE, base::BindOnce(&VideoFrameCompositor::PaintSingleFrame, + base::Unretained(this), std::move(frame), + repaint_duplicate_frame)); return; } - if (ProcessNewFrame(frame, repaint_duplicate_frame) && + if (ProcessNewFrame(std::move(frame), repaint_duplicate_frame) && IsClientSinkAvailable()) { client_->DidReceiveFrame(); } @@ -261,9 +259,8 @@ new_processed_frame_cb_ = std::move(cb); } -bool VideoFrameCompositor::ProcessNewFrame( - const scoped_refptr<VideoFrame>& frame, - bool repaint_duplicate_frame) { +bool VideoFrameCompositor::ProcessNewFrame(scoped_refptr<VideoFrame> frame, + bool repaint_duplicate_frame) { DCHECK(task_runner_->BelongsToCurrentThread()); if (frame && GetCurrentFrame() && !repaint_duplicate_frame && @@ -275,7 +272,7 @@ // subsequent PutCurrentFrame() call it will mark it as rendered. rendered_last_frame_ = false; - SetCurrentFrame(frame); + SetCurrentFrame(std::move(frame)); if (new_processed_frame_cb_) std::move(new_processed_frame_cb_).Run(base::TimeTicks::Now());
diff --git a/media/blink/video_frame_compositor.h b/media/blink/video_frame_compositor.h index 65f536b..da94514f 100644 --- a/media/blink/video_frame_compositor.h +++ b/media/blink/video_frame_compositor.h
@@ -105,7 +105,7 @@ // same thread (typically the media thread). void Start(RenderCallback* callback) override; void Stop() override; - void PaintSingleFrame(const scoped_refptr<VideoFrame>& frame, + void PaintSingleFrame(scoped_refptr<VideoFrame> frame, bool repaint_duplicate_frame = false) override; // If |client_| is not set, |callback_| is set, and |is_background_rendering_| @@ -171,10 +171,10 @@ void OnRendererStateUpdate(bool new_state); // Handles setting of |current_frame_|. - bool ProcessNewFrame(const scoped_refptr<VideoFrame>& frame, + bool ProcessNewFrame(scoped_refptr<VideoFrame> frame, bool repaint_duplicate_frame); - void SetCurrentFrame(const scoped_refptr<VideoFrame>& frame); + void SetCurrentFrame(scoped_refptr<VideoFrame> frame); // Called by |background_rendering_timer_| when enough time elapses where we // haven't seen a Render() call.
diff --git a/media/capture/video_capturer_source.h b/media/capture/video_capturer_source.h index b02a0515..d98f6079a 100644 --- a/media/capture/video_capturer_source.h +++ b/media/capture/video_capturer_source.h
@@ -42,8 +42,8 @@ // Because a source can start generating frames before a subscriber is added, // the first video frame delivered may not have timestamp equal to 0. using VideoCaptureDeliverFrameCB = - base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, - base::TimeTicks estimated_capture_time)>; + base::RepeatingCallback<void(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks estimated_capture_time)>; using VideoCaptureDeviceFormatsCB = base::Callback<void(const media::VideoCaptureFormats&)>;
diff --git a/media/cast/cast_receiver.h b/media/cast/cast_receiver.h index 638ee04..9c7fe54ae 100644 --- a/media/cast/cast_receiver.h +++ b/media/cast/cast_receiver.h
@@ -30,13 +30,15 @@ // discontinuities for playback. Note: A NULL pointer can be returned when data // is not available (e.g., bad/missing packet). typedef base::Callback<void(std::unique_ptr<AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous)> AudioFrameDecodedCallback; // TODO(miu): |video_frame| includes a timestamp, so use that instead. -typedef base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, - bool is_continuous)> VideoFrameDecodedCallback; +typedef base::RepeatingCallback<void( + scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, + bool is_continuous)> + VideoFrameDecodedCallback; // The following callback delivers encoded frame data and metadata. The client // should examine the |frame_id| field to determine whether any frames have been
diff --git a/media/cast/cast_sender.h b/media/cast/cast_sender.h index 6628324..29b5859 100644 --- a/media/cast/cast_sender.h +++ b/media/cast/cast_sender.h
@@ -17,6 +17,7 @@ #include "base/time/tick_clock.h" #include "base/time/time.h" #include "media/base/audio_bus.h" +#include "media/base/video_frame.h" #include "media/cast/cast_config.h" #include "media/cast/cast_environment.h" #include "media/cast/constants.h" @@ -27,7 +28,6 @@ } namespace media { -class VideoFrame; namespace cast { @@ -35,9 +35,8 @@ public: // Insert video frames into Cast sender. Frames will be encoded, packetized // and sent to the network. - virtual void InsertRawVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& capture_time) = 0; + virtual void InsertRawVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks capture_time) = 0; // Creates a |VideoFrame| optimized for the encoder. When available, these // frames offer performance benefits, such as memory copy elimination. The
diff --git a/media/cast/cast_sender_impl.cc b/media/cast/cast_sender_impl.cc index 2041143..7f7ed55 100644 --- a/media/cast/cast_sender_impl.cc +++ b/media/cast/cast_sender_impl.cc
@@ -26,14 +26,12 @@ video_sender.get() ? video_sender->CreateVideoFrameFactory().release() : nullptr) {} - void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& capture_time) final { - cast_environment_->PostTask(CastEnvironment::MAIN, - FROM_HERE, - base::Bind(&VideoSender::InsertRawVideoFrame, - video_sender_, - video_frame, - capture_time)); + void InsertRawVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks capture_time) final { + cast_environment_->PostTask( + CastEnvironment::MAIN, FROM_HERE, + base::BindRepeating(&VideoSender::InsertRawVideoFrame, video_sender_, + std::move(video_frame), capture_time)); } scoped_refptr<VideoFrame> MaybeCreateOptimizedFrame(
diff --git a/media/cast/receiver/cast_receiver_impl.cc b/media/cast/receiver/cast_receiver_impl.cc index 01e6cb4..db343ac6 100644 --- a/media/cast/receiver/cast_receiver_impl.cc +++ b/media/cast/receiver/cast_receiver_impl.cc
@@ -197,11 +197,11 @@ FrameId frame_id, RtpTimeTicks rtp_timestamp, const base::TimeTicks& playout_time, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, bool is_continuous) { DCHECK(cast_environment->CurrentlyOn(CastEnvironment::MAIN)); - if (video_frame.get()) { + if (video_frame) { // TODO(miu): This is reporting incorrect timestamp and delay. // http://crbug.com/547251 std::unique_ptr<FrameEvent> playout_event(new FrameEvent()); @@ -220,7 +220,7 @@ (playout_time - base::TimeTicks()).InMicroseconds()); } - callback.Run(video_frame, playout_time, is_continuous); + callback.Run(std::move(video_frame), playout_time, is_continuous); } } // namespace cast
diff --git a/media/cast/receiver/cast_receiver_impl.h b/media/cast/receiver/cast_receiver_impl.h index 6454d492..2b29b852 100644 --- a/media/cast/receiver/cast_receiver_impl.h +++ b/media/cast/receiver/cast_receiver_impl.h
@@ -82,7 +82,7 @@ FrameId frame_id, RtpTimeTicks rtp_timestamp, const base::TimeTicks& playout_time, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, bool is_continuous); const scoped_refptr<CastEnvironment> cast_environment_;
diff --git a/media/cast/receiver/video_decoder.h b/media/cast/receiver/video_decoder.h index bde9b0ec..2116217c 100644 --- a/media/cast/receiver/video_decoder.h +++ b/media/cast/receiver/video_decoder.h
@@ -26,8 +26,9 @@ // normally true, but will be false if the decoder has detected a frame skip // since the last decode operation; and the client might choose to take steps // to smooth/interpolate video discontinuities in this case. - typedef base::Callback<void(const scoped_refptr<VideoFrame>& frame, - bool is_continuous)> DecodeFrameCallback; + typedef base::RepeatingCallback<void(scoped_refptr<VideoFrame> frame, + bool is_continuous)> + DecodeFrameCallback; VideoDecoder(const scoped_refptr<CastEnvironment>& cast_environment, Codec codec);
diff --git a/media/cast/receiver/video_decoder_unittest.cc b/media/cast/receiver/video_decoder_unittest.cc index 85186498..d64c3bc 100644 --- a/media/cast/receiver/video_decoder_unittest.cc +++ b/media/cast/receiver/video_decoder_unittest.cc
@@ -125,14 +125,14 @@ private: // Called by |vp8_decoder_| to deliver each frame of decoded video. - void OnDecodedFrame(const scoped_refptr<VideoFrame>& expected_video_frame, + void OnDecodedFrame(scoped_refptr<VideoFrame> expected_video_frame, bool should_be_continuous, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, bool is_continuous) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); // A NULL |video_frame| indicates a decode error, which we don't expect. - ASSERT_TRUE(video_frame.get()); + ASSERT_TRUE(video_frame); // Did the decoder detect whether frames were dropped? EXPECT_EQ(should_be_continuous, is_continuous);
diff --git a/media/cast/sender/external_video_encoder.cc b/media/cast/sender/external_video_encoder.cc index 92ce151b..cc13dc5b 100644 --- a/media/cast/sender/external_video_encoder.cc +++ b/media/cast/sender/external_video_encoder.cc
@@ -68,11 +68,11 @@ const base::TimeTicks start_time; InProgressExternalVideoFrameEncode( - const scoped_refptr<VideoFrame>& v_frame, + scoped_refptr<VideoFrame> v_frame, base::TimeTicks r_time, VideoEncoder::FrameEncodedCallback callback, int bit_rate) - : video_frame(v_frame), + : video_frame(std::move(v_frame)), reference_time(r_time), frame_encoded_callback(callback), target_bit_rate(bit_rate), @@ -157,7 +157,7 @@ } void EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, bool key_frame_requested, const VideoEncoder::FrameEncodedCallback& frame_encoded_callback) { @@ -663,7 +663,7 @@ } bool ExternalVideoEncoder::EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); @@ -674,7 +674,7 @@ client_->task_runner()->PostTask( FROM_HERE, base::BindOnce(&VEAClientImpl::EncodeVideoFrame, client_, - video_frame, reference_time, + std::move(video_frame), reference_time, key_frame_requested_, frame_encoded_callback)); key_frame_requested_ = false; return true;
diff --git a/media/cast/sender/external_video_encoder.h b/media/cast/sender/external_video_encoder.h index 44002c2..d9a40ca 100644 --- a/media/cast/sender/external_video_encoder.h +++ b/media/cast/sender/external_video_encoder.h
@@ -43,7 +43,7 @@ // VideoEncoder implementation. bool EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) final; void SetBitRate(int new_bit_rate) final;
diff --git a/media/cast/sender/fake_software_video_encoder.cc b/media/cast/sender/fake_software_video_encoder.cc index 214929b..65f44b8b 100644 --- a/media/cast/sender/fake_software_video_encoder.cc +++ b/media/cast/sender/fake_software_video_encoder.cc
@@ -31,7 +31,7 @@ void FakeSoftwareVideoEncoder::Initialize() {} void FakeSoftwareVideoEncoder::Encode( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, SenderEncodedFrame* encoded_frame) { DCHECK(encoded_frame);
diff --git a/media/cast/sender/fake_software_video_encoder.h b/media/cast/sender/fake_software_video_encoder.h index 7061b7e..09106a24 100644 --- a/media/cast/sender/fake_software_video_encoder.h +++ b/media/cast/sender/fake_software_video_encoder.h
@@ -21,7 +21,7 @@ // SoftwareVideoEncoder implementations. void Initialize() final; - void Encode(const scoped_refptr<media::VideoFrame>& video_frame, + void Encode(scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, SenderEncodedFrame* encoded_frame) final; void UpdateRates(uint32_t new_bitrate) final;
diff --git a/media/cast/sender/h264_vt_encoder.cc b/media/cast/sender/h264_vt_encoder.cc index e4dd235..0cfb573 100644 --- a/media/cast/sender/h264_vt_encoder.cc +++ b/media/cast/sender/h264_vt_encoder.cc
@@ -351,7 +351,7 @@ } bool H264VideoToolboxEncoder::EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/media/cast/sender/h264_vt_encoder.h b/media/cast/sender/h264_vt_encoder.h index 5a4178d..ab92ae79 100644 --- a/media/cast/sender/h264_vt_encoder.h +++ b/media/cast/sender/h264_vt_encoder.h
@@ -38,7 +38,7 @@ // media::cast::VideoEncoder implementation bool EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) final; void SetBitRate(int new_bit_rate) final;
diff --git a/media/cast/sender/h264_vt_encoder_unittest.cc b/media/cast/sender/h264_vt_encoder_unittest.cc index 187603a..60e02b31 100644 --- a/media/cast/sender/h264_vt_encoder_unittest.cc +++ b/media/cast/sender/h264_vt_encoder_unittest.cc
@@ -138,8 +138,8 @@ EXPECT_TRUE(decoder_init_result); } - void PushExpectation(const scoped_refptr<VideoFrame>& frame) { - expectations_.push(frame); + void PushExpectation(scoped_refptr<VideoFrame> frame) { + expectations_.push(std::move(frame)); } void EncodeDone(std::unique_ptr<SenderEncodedFrame> encoded_frame) {
diff --git a/media/cast/sender/performance_metrics_overlay.cc b/media/cast/sender/performance_metrics_overlay.cc index 9b35b42..c0f1c81 100644 --- a/media/cast/sender/performance_metrics_overlay.cc +++ b/media/cast/sender/performance_metrics_overlay.cc
@@ -274,7 +274,7 @@ // are invoked. frame->AddDestructionObserver(base::Bind( [](const VideoFrameMetadata* sent_frame_metadata, - const scoped_refptr<VideoFrame>& source_frame) { + scoped_refptr<VideoFrame> source_frame) { source_frame->metadata()->Clear(); source_frame->metadata()->MergeMetadataFrom(sent_frame_metadata); },
diff --git a/media/cast/sender/size_adaptable_video_encoder_base.cc b/media/cast/sender/size_adaptable_video_encoder_base.cc index f4464cc..244d851 100644 --- a/media/cast/sender/size_adaptable_video_encoder_base.cc +++ b/media/cast/sender/size_adaptable_video_encoder_base.cc
@@ -34,7 +34,7 @@ } bool SizeAdaptableVideoEncoderBase::EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); @@ -56,11 +56,9 @@ } const bool is_frame_accepted = encoder_->EncodeVideoFrame( - video_frame, - reference_time, + std::move(video_frame), reference_time, base::Bind(&SizeAdaptableVideoEncoderBase::OnEncodedVideoFrame, - weak_factory_.GetWeakPtr(), - frame_encoded_callback)); + weak_factory_.GetWeakPtr(), frame_encoded_callback)); if (is_frame_accepted) ++frames_in_encoder_; return is_frame_accepted;
diff --git a/media/cast/sender/size_adaptable_video_encoder_base.h b/media/cast/sender/size_adaptable_video_encoder_base.h index 8443e2c..c712787 100644 --- a/media/cast/sender/size_adaptable_video_encoder_base.h +++ b/media/cast/sender/size_adaptable_video_encoder_base.h
@@ -37,7 +37,7 @@ // VideoEncoder implementation. bool EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) final; void SetBitRate(int new_bit_rate) final;
diff --git a/media/cast/sender/software_video_encoder.h b/media/cast/sender/software_video_encoder.h index c39028d..b73afa0 100644 --- a/media/cast/sender/software_video_encoder.h +++ b/media/cast/sender/software_video_encoder.h
@@ -30,7 +30,7 @@ virtual void Initialize() = 0; // Encode a raw image (as a part of a video stream). - virtual void Encode(const scoped_refptr<media::VideoFrame>& video_frame, + virtual void Encode(scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, SenderEncodedFrame* encoded_frame) = 0;
diff --git a/media/cast/sender/video_encoder.h b/media/cast/sender/video_encoder.h index 74cec93..363415a 100644 --- a/media/cast/sender/video_encoder.h +++ b/media/cast/sender/video_encoder.h
@@ -50,7 +50,7 @@ // CastEnvironment thread with the result. If false is returned, nothing // happens and the callback will not be run. virtual bool EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) = 0;
diff --git a/media/cast/sender/video_encoder_impl.cc b/media/cast/sender/video_encoder_impl.cc index e441c56..ed3586e 100644 --- a/media/cast/sender/video_encoder_impl.cc +++ b/media/cast/sender/video_encoder_impl.cc
@@ -29,7 +29,7 @@ void EncodeVideoFrameOnEncoderThread( scoped_refptr<CastEnvironment> environment, SoftwareVideoEncoder* encoder, - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const VideoEncoderImpl::CodecDynamicConfig& dynamic_config, const VideoEncoderImpl::FrameEncodedCallback& frame_encoded_callback) { @@ -40,7 +40,7 @@ encoder->UpdateRates(dynamic_config.bit_rate); std::unique_ptr<SenderEncodedFrame> encoded_frame(new SenderEncodedFrame()); - encoder->Encode(video_frame, reference_time, encoded_frame.get()); + encoder->Encode(std::move(video_frame), reference_time, encoded_frame.get()); encoded_frame->encode_completion_time = environment->Clock()->NowTicks(); environment->PostTask( CastEnvironment::MAIN, @@ -104,22 +104,19 @@ } bool VideoEncoderImpl::EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); DCHECK(!video_frame->visible_rect().IsEmpty()); DCHECK(!frame_encoded_callback.is_null()); - cast_environment_->PostTask(CastEnvironment::VIDEO, - FROM_HERE, - base::Bind(&EncodeVideoFrameOnEncoderThread, - cast_environment_, - encoder_.get(), - video_frame, - reference_time, - dynamic_config_, - frame_encoded_callback)); + cast_environment_->PostTask( + CastEnvironment::VIDEO, FROM_HERE, + base::BindRepeating(&EncodeVideoFrameOnEncoderThread, cast_environment_, + encoder_.get(), std::move(video_frame), + reference_time, dynamic_config_, + frame_encoded_callback)); dynamic_config_.key_frame_requested = false; return true;
diff --git a/media/cast/sender/video_encoder_impl.h b/media/cast/sender/video_encoder_impl.h index cd350e6..673b79f3 100644 --- a/media/cast/sender/video_encoder_impl.h +++ b/media/cast/sender/video_encoder_impl.h
@@ -38,7 +38,7 @@ // VideoEncoder implementation. bool EncodeVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, const FrameEncodedCallback& frame_encoded_callback) final; void SetBitRate(int new_bit_rate) final;
diff --git a/media/cast/sender/video_encoder_unittest.cc b/media/cast/sender/video_encoder_unittest.cc index 35fa76f..6eba9d5 100644 --- a/media/cast/sender/video_encoder_unittest.cc +++ b/media/cast/sender/video_encoder_unittest.cc
@@ -252,6 +252,7 @@ encoded_frames[encoded_frames.size() - 4])) { auto video_frame = CreateTestVideoFrame(frame_size); const base::TimeTicks reference_time = Now(); + const base::TimeDelta timestamp = video_frame->timestamp(); const bool accepted_request = video_encoder()->EncodeVideoFrame( std::move(video_frame), reference_time, base::BindRepeating( @@ -271,8 +272,7 @@ encoded_frames->emplace_back(std::move(encoded_frame)); }, encoded_frames_weak_factory.GetWeakPtr(), - RtpTimeTicks::FromTimeDelta(video_frame->timestamp(), - kVideoFrequency), + RtpTimeTicks::FromTimeDelta(timestamp, kVideoFrequency), reference_time)); if (accepted_request) { ++count_frames_accepted;
diff --git a/media/cast/sender/video_sender.cc b/media/cast/sender/video_sender.cc index 196e1119f..e555368 100644 --- a/media/cast/sender/video_sender.cc +++ b/media/cast/sender/video_sender.cc
@@ -129,7 +129,7 @@ VideoSender::~VideoSender() = default; void VideoSender::InsertRawVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); @@ -252,7 +252,7 @@ MaybeRenderPerformanceMetricsOverlay( GetTargetPlayoutDelay(), low_latency_mode_, bitrate, frames_in_encoder_ + 1, last_reported_encoder_utilization_, - last_reported_lossy_utilization_, video_frame); + last_reported_lossy_utilization_, std::move(video_frame)); if (video_encoder_->EncodeVideoFrame( frame_to_encode, reference_time, base::Bind(&VideoSender::OnEncodedVideoFrame, AsWeakPtr(), @@ -295,7 +295,7 @@ } void VideoSender::OnEncodedVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, int encoder_bitrate, std::unique_ptr<SenderEncodedFrame> encoded_frame) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
diff --git a/media/cast/sender/video_sender.h b/media/cast/sender/video_sender.h index 910e155..7a8be22 100644 --- a/media/cast/sender/video_sender.h +++ b/media/cast/sender/video_sender.h
@@ -52,7 +52,7 @@ // Note: It is not guaranteed that |video_frame| will actually be encoded and // sent, if VideoSender detects too many frames in flight. Therefore, clients // should be careful about the rate at which this method is called. - void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, + void InsertRawVideoFrame(scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time); // Creates a |VideoFrameFactory| object to vend |VideoFrame| object with @@ -68,7 +68,7 @@ private: // Called by the |video_encoder_| with the next EncodedFrame to send. - void OnEncodedVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, + void OnEncodedVideoFrame(scoped_refptr<media::VideoFrame> video_frame, int encoder_bitrate, std::unique_ptr<SenderEncodedFrame> encoded_frame);
diff --git a/media/cast/sender/vp8_encoder.cc b/media/cast/sender/vp8_encoder.cc index 8a211ce..8d7794f 100644 --- a/media/cast/sender/vp8_encoder.cc +++ b/media/cast/sender/vp8_encoder.cc
@@ -183,7 +183,7 @@ VPX_CODEC_OK); } -void Vp8Encoder::Encode(const scoped_refptr<media::VideoFrame>& video_frame, +void Vp8Encoder::Encode(scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, SenderEncodedFrame* encoded_frame) { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/media/cast/sender/vp8_encoder.h b/media/cast/sender/vp8_encoder.h index 2b2cfc5..79468ca 100644 --- a/media/cast/sender/vp8_encoder.h +++ b/media/cast/sender/vp8_encoder.h
@@ -32,7 +32,7 @@ // SoftwareVideoEncoder implementations. void Initialize() final; - void Encode(const scoped_refptr<media::VideoFrame>& video_frame, + void Encode(scoped_refptr<media::VideoFrame> video_frame, const base::TimeTicks& reference_time, SenderEncodedFrame* encoded_frame) final; void UpdateRates(uint32_t new_bitrate) final;
diff --git a/media/cast/test/cast_benchmarks.cc b/media/cast/test/cast_benchmarks.cc index 99ab474..33c4804 100644 --- a/media/cast/test/cast_benchmarks.cc +++ b/media/cast/test/cast_benchmarks.cc
@@ -299,10 +299,9 @@ task_runner_->Sleep(duration); } - void BasicPlayerGotVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& render_time, - bool continuous) { + void BasicPlayerGotVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks render_time, + bool continuous) { video_ticks_.push_back( std::make_pair(testing_clock_receiver_.NowTicks(), render_time)); cast_receiver_->RequestDecodedVideoFrame(base::Bind( @@ -310,7 +309,7 @@ } void BasicPlayerGotAudioFrame(std::unique_ptr<AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { audio_ticks_.push_back( std::make_pair(testing_clock_receiver_.NowTicks(), playout_time));
diff --git a/media/cast/test/end2end_unittest.cc b/media/cast/test/end2end_unittest.cc index 5c5f134..fd90386 100644 --- a/media/cast/test/end2end_unittest.cc +++ b/media/cast/test/end2end_unittest.cc
@@ -251,7 +251,7 @@ } void AddExpectedResult(const AudioBus& audio_bus, - const base::TimeTicks& playout_time) { + base::TimeTicks playout_time) { std::unique_ptr<ExpectedAudioFrame> expected_audio_frame( new ExpectedAudioFrame()); expected_audio_frame->audio_bus = @@ -262,13 +262,13 @@ } void IgnoreAudioFrame(std::unique_ptr<AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { ++num_called_; } void CheckAudioFrame(std::unique_ptr<AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { ++num_called_; @@ -330,7 +330,7 @@ void AddExpectedResult(int frame_number, const gfx::Size& size, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool should_be_continuous) { ExpectedVideoFrame expected_video_frame; expected_video_frame.frame_number = frame_number; @@ -341,12 +341,12 @@ } void CheckVideoFrame(bool examine_content, - const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous) { ++num_called_; - ASSERT_TRUE(video_frame.get()); + ASSERT_TRUE(video_frame); ASSERT_FALSE(expected_frame_.empty()); ExpectedVideoFrame expected_video_frame = expected_frame_.front(); expected_frame_.pop_front(); @@ -529,8 +529,7 @@ } } - void FeedAudioFramesWithExpectedDelay(int count, - const base::TimeDelta& delay) { + void FeedAudioFramesWithExpectedDelay(int count, base::TimeDelta delay) { for (int i = 0; i < count; ++i) { std::unique_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( base::TimeDelta::FromMilliseconds(kAudioFrameDurationMs))); @@ -573,7 +572,7 @@ return gfx::Size(kVideoWidth, kVideoHeight); } - void SendVideoFrame(int frame_number, const base::TimeTicks& reference_time) { + void SendVideoFrame(int frame_number, base::TimeTicks reference_time) { if (start_time_.is_null()) start_time_ = reference_time; const base::TimeDelta time_diff = reference_time - start_time_; @@ -771,9 +770,9 @@ } } - void BasicPlayerGotVideoFrame( - const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& playout_time, bool continuous) { + void BasicPlayerGotVideoFrame(scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks playout_time, + bool continuous) { // The following tests that the sender and receiver clocks can be // out-of-sync, drift, and jitter with respect to one another; and depsite // this, the receiver will produce smoothly-progressing playout times. @@ -806,7 +805,7 @@ } void BasicPlayerGotAudioFrame(std::unique_ptr<AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { VLOG_IF(1, !last_audio_playout_time_.is_null()) << "Audio frame playout time delta (compared to last frame) is "
diff --git a/media/cast/test/linux_output_window.cc b/media/cast/test/linux_output_window.cc index ed9347a..ef17d3f 100644 --- a/media/cast/test/linux_output_window.cc +++ b/media/cast/test/linux_output_window.cc
@@ -120,27 +120,24 @@ XSync(display_, false); } -void LinuxOutputWindow::RenderFrame( - const scoped_refptr<media::VideoFrame>& video_frame) { - const gfx::Size damage_size(std::min(video_frame->visible_rect().width(), - image_->width), - std::min(video_frame->visible_rect().height(), - image_->height)); +void LinuxOutputWindow::RenderFrame(const media::VideoFrame& video_frame) { + const gfx::Size damage_size( + std::min(video_frame.visible_rect().width(), image_->width), + std::min(video_frame.visible_rect().height(), image_->height)); if (damage_size.width() < image_->width || damage_size.height() < image_->height) memset(image_->data, 0x00, image_->bytes_per_line * image_->height); if (!damage_size.IsEmpty()) { - libyuv::I420ToARGB(video_frame->visible_data(VideoFrame::kYPlane), - video_frame->stride(VideoFrame::kYPlane), - video_frame->visible_data(VideoFrame::kUPlane), - video_frame->stride(VideoFrame::kUPlane), - video_frame->visible_data(VideoFrame::kVPlane), - video_frame->stride(VideoFrame::kVPlane), + libyuv::I420ToARGB(video_frame.visible_data(VideoFrame::kYPlane), + video_frame.stride(VideoFrame::kYPlane), + video_frame.visible_data(VideoFrame::kUPlane), + video_frame.stride(VideoFrame::kUPlane), + video_frame.visible_data(VideoFrame::kVPlane), + video_frame.stride(VideoFrame::kVPlane), reinterpret_cast<uint8_t*>(image_->data), - image_->bytes_per_line, - damage_size.width(), + image_->bytes_per_line, damage_size.width(), damage_size.height()); }
diff --git a/media/cast/test/linux_output_window.h b/media/cast/test/linux_output_window.h index d4de979..bab3916 100644 --- a/media/cast/test/linux_output_window.h +++ b/media/cast/test/linux_output_window.h
@@ -31,7 +31,7 @@ const std::string& name); virtual ~LinuxOutputWindow(); - void RenderFrame(const scoped_refptr<media::VideoFrame>& video_frame); + void RenderFrame(const media::VideoFrame& video_frame); private: void CreateWindow(int x_pos,
diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc index b04d69dd3..120e179 100644 --- a/media/cast/test/receiver.cc +++ b/media/cast/test/receiver.cc
@@ -275,8 +275,8 @@ //////////////////////////////////////////////////////////////////// // InProcessReceiver finals. - void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + void OnVideoFrame(scoped_refptr<VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous) final { DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN)); LOG_IF(WARNING, !is_continuous) @@ -284,7 +284,7 @@ video_playout_queue_.push_back(std::make_pair(playout_time, video_frame)); ScheduleVideoPlayout(); uint16_t frame_no; - if (media::cast::test::DecodeBarcode(video_frame, &frame_no)) { + if (media::cast::test::DecodeBarcode(*video_frame, &frame_no)) { video_play_times_.insert( std::pair<uint16_t, base::TimeTicks>(frame_no, playout_time)); } else { @@ -293,7 +293,7 @@ } void OnAudioFrame(std::unique_ptr<AudioBus> audio_frame, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) final { DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN)); LOG_IF(WARNING, !is_continuous) @@ -425,7 +425,7 @@ if (!video_playout_queue_.empty()) { const scoped_refptr<VideoFrame> video_frame = PopOneVideoFrame(false); #if defined(USE_X11) - render_.RenderFrame(video_frame); + render_.RenderFrame(*video_frame); #endif // defined(USE_X11) } ScheduleVideoPlayout();
diff --git a/media/cast/test/simulator.cc b/media/cast/test/simulator.cc index c2404627..4abd277 100644 --- a/media/cast/test/simulator.cc +++ b/media/cast/test/simulator.cc
@@ -252,14 +252,13 @@ std::vector<double> ssim; }; -void GotVideoFrame( - GotVideoFrameOutput* metrics_output, - const base::FilePath& yuv_output, - EncodedVideoFrameTracker* video_frame_tracker, - CastReceiver* cast_receiver, - const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& render_time, - bool continuous) { +void GotVideoFrame(GotVideoFrameOutput* metrics_output, + const base::FilePath& yuv_output, + EncodedVideoFrameTracker* video_frame_tracker, + CastReceiver* cast_receiver, + scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks render_time, + bool continuous) { ++metrics_output->counter; cast_receiver->RequestDecodedVideoFrame( base::Bind(&GotVideoFrame, metrics_output, yuv_output, @@ -275,14 +274,14 @@ } if (!yuv_output.empty()) { - AppendYuvToFile(yuv_output, video_frame); + AppendYuvToFile(yuv_output, std::move(video_frame)); } } void GotAudioFrame(int* counter, CastReceiver* cast_receiver, std::unique_ptr<AudioBus> audio_bus, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { ++*counter; cast_receiver->RequestDecodedAudioFrame(
diff --git a/media/cast/test/utility/barcode.cc b/media/cast/test/utility/barcode.cc index 8a8e174..e753d0712 100644 --- a/media/cast/test/utility/barcode.cc +++ b/media/cast/test/utility/barcode.cc
@@ -80,7 +80,7 @@ } namespace { -bool DecodeBarCodeRows(const scoped_refptr<VideoFrame>& frame, +bool DecodeBarCodeRows(const VideoFrame& frame, std::vector<bool>* output, int min_row, int max_row) { @@ -88,11 +88,11 @@ base::circular_deque<int> runs; bool is_black = true; int length = 0; - for (int pos = 0; pos < frame->row_bytes(VideoFrame::kYPlane); pos++) { + for (int pos = 0; pos < frame.row_bytes(VideoFrame::kYPlane); pos++) { float value = 0.0; for (int row = min_row; row < max_row; row++) { - value += frame->data(VideoFrame::kYPlane)[ - frame->stride(VideoFrame::kYPlane) * row + pos]; + value += frame.data( + VideoFrame::kYPlane)[frame.stride(VideoFrame::kYPlane) * row + pos]; } value /= max_row - min_row; if (is_black ? value > kBlackThreshold : value < kWhiteThreshold) { @@ -148,16 +148,13 @@ // Note that "output" is assumed to be the right size already. This // could be inferred from the data, but the decoding is more robust // if we can assume that we know how many bits we want. -bool DecodeBarcode(const scoped_refptr<VideoFrame>& frame, - std::vector<bool>* output) { - DCHECK(frame->format() == PIXEL_FORMAT_YV12 || - frame->format() == PIXEL_FORMAT_I422 || - frame->format() == PIXEL_FORMAT_I420); - int rows = frame->rows(VideoFrame::kYPlane); +bool DecodeBarcode(const VideoFrame& frame, std::vector<bool>* output) { + DCHECK(frame.format() == PIXEL_FORMAT_YV12 || + frame.format() == PIXEL_FORMAT_I422 || + frame.format() == PIXEL_FORMAT_I420); + int rows = frame.rows(VideoFrame::kYPlane); // Middle 10 lines - if (DecodeBarCodeRows(frame, - output, - std::max(0, rows / 2 - 5), + if (DecodeBarCodeRows(frame, output, std::max(0, rows / 2 - 5), std::min(rows, rows / 2 + 5))) { return true; }
diff --git a/media/cast/test/utility/barcode.h b/media/cast/test/utility/barcode.h index 1c381498..47e1d76 100644 --- a/media/cast/test/utility/barcode.h +++ b/media/cast/test/utility/barcode.h
@@ -23,8 +23,7 @@ // Decode a barcode (encoded by EncodeBarCode) into |output|. // |output| should already be sized to contain the right number // of bits. -bool DecodeBarcode(const scoped_refptr<media::VideoFrame>& frame, - std::vector<bool>* output); +bool DecodeBarcode(const media::VideoFrame& frame, std::vector<bool>* output); // Convenience templates that allows you to encode/decode numeric // types directly. @@ -37,8 +36,8 @@ return EncodeBarcode(bits, output_frame); } -template<class T> -bool DecodeBarcode(scoped_refptr<media::VideoFrame> output_frame, T* data) { +template <class T> +bool DecodeBarcode(const media::VideoFrame& output_frame, T* data) { std::vector<bool> bits(sizeof(T) * 8); bool ret = DecodeBarcode(output_frame, &bits); if (!ret) return false;
diff --git a/media/cast/test/utility/barcode_unittest.cc b/media/cast/test/utility/barcode_unittest.cc index 04e43f5a..bf127e6 100644 --- a/media/cast/test/utility/barcode_unittest.cc +++ b/media/cast/test/utility/barcode_unittest.cc
@@ -17,7 +17,7 @@ for (unsigned char in_bits = 0; in_bits < 255; in_bits++) { EXPECT_TRUE(EncodeBarcode(in_bits, frame)); unsigned char out_bits = ~in_bits; - EXPECT_TRUE(DecodeBarcode(frame, &out_bits)); + EXPECT_TRUE(DecodeBarcode(*frame, &out_bits)); EXPECT_EQ(in_bits, out_bits); } } @@ -29,28 +29,28 @@ std::vector<bool> out_bits(1024); for (int i = 0; i < 1024; i++) in_bits[i] = true; EXPECT_TRUE(EncodeBarcode(in_bits, frame)); - EXPECT_TRUE(DecodeBarcode(frame, &out_bits)); + EXPECT_TRUE(DecodeBarcode(*frame, &out_bits)); for (int i = 0; i < 1024; i++) { EXPECT_EQ(in_bits[i], out_bits[i]); } for (int i = 0; i < 1024; i++) in_bits[i] = false; EXPECT_TRUE(EncodeBarcode(in_bits, frame)); - EXPECT_TRUE(DecodeBarcode(frame, &out_bits)); + EXPECT_TRUE(DecodeBarcode(*frame, &out_bits)); for (int i = 0; i < 1024; i++) { EXPECT_EQ(in_bits[i], out_bits[i]); } for (int i = 0; i < 1024; i++) in_bits[i] = (i & 1) == 0; EXPECT_TRUE(EncodeBarcode(in_bits, frame)); - EXPECT_TRUE(DecodeBarcode(frame, &out_bits)); + EXPECT_TRUE(DecodeBarcode(*frame, &out_bits)); for (int i = 0; i < 1024; i++) { EXPECT_EQ(in_bits[i], out_bits[i]); } for (int i = 0; i < 1024; i++) in_bits[i] = (i & 1) == 1; EXPECT_TRUE(EncodeBarcode(in_bits, frame)); - EXPECT_TRUE(DecodeBarcode(frame, &out_bits)); + EXPECT_TRUE(DecodeBarcode(*frame, &out_bits)); for (int i = 0; i < 1024; i++) { EXPECT_EQ(in_bits[i], out_bits[i]); }
diff --git a/media/cast/test/utility/in_process_receiver.cc b/media/cast/test/utility/in_process_receiver.cc index ed2b111..493dbcc6 100644 --- a/media/cast/test/utility/in_process_receiver.cc +++ b/media/cast/test/utility/in_process_receiver.cc
@@ -115,7 +115,7 @@ } void InProcessReceiver::GotAudioFrame(std::unique_ptr<AudioBus> audio_frame, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); if (audio_frame.get()) @@ -123,13 +123,12 @@ PullNextAudioFrame(); } -void InProcessReceiver::GotVideoFrame( - const scoped_refptr<VideoFrame>& video_frame, - const base::TimeTicks& playout_time, - bool is_continuous) { +void InProcessReceiver::GotVideoFrame(scoped_refptr<VideoFrame> video_frame, + base::TimeTicks playout_time, + bool is_continuous) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); - if (video_frame.get()) - OnVideoFrame(video_frame, playout_time, is_continuous); + if (video_frame) + OnVideoFrame(std::move(video_frame), playout_time, is_continuous); PullNextVideoFrame(); }
diff --git a/media/cast/test/utility/in_process_receiver.h b/media/cast/test/utility/in_process_receiver.h index 22891e9..11841ff7 100644 --- a/media/cast/test/utility/in_process_receiver.h +++ b/media/cast/test/utility/in_process_receiver.h
@@ -86,10 +86,10 @@ // To be implemented by subclasses. These are called on the Cast MAIN thread // as each frame is received. virtual void OnAudioFrame(std::unique_ptr<AudioBus> audio_frame, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous) = 0; - virtual void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + virtual void OnVideoFrame(scoped_refptr<VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous) = 0; // Helper method that creates |transport_| and |cast_receiver_|, starts @@ -112,10 +112,10 @@ // comments for the callbacks defined in src/media/cast/cast_receiver.h for // argument description and semantics. void GotAudioFrame(std::unique_ptr<AudioBus> audio_frame, - const base::TimeTicks& playout_time, + base::TimeTicks playout_time, bool is_continuous); - void GotVideoFrame(const scoped_refptr<VideoFrame>& video_frame, - const base::TimeTicks& playout_time, + void GotVideoFrame(scoped_refptr<VideoFrame> video_frame, + base::TimeTicks playout_time, bool is_continuous); void PullNextAudioFrame(); void PullNextVideoFrame();
diff --git a/media/filters/aom_video_decoder_unittest.cc b/media/filters/aom_video_decoder_unittest.cc index 9f656926..596b761 100644 --- a/media/filters/aom_video_decoder_unittest.cc +++ b/media/filters/aom_video_decoder_unittest.cc
@@ -155,9 +155,9 @@ return status; } - void FrameReady(const scoped_refptr<VideoFrame>& frame) { + void FrameReady(scoped_refptr<VideoFrame> frame) { DCHECK(!frame->metadata()->IsTrue(VideoFrameMetadata::END_OF_STREAM)); - output_frames_.push_back(frame); + output_frames_.push_back(std::move(frame)); } MOCK_METHOD1(DecodeDone, void(DecodeStatus));
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc index 1c0a3a9..8302d35 100644 --- a/media/filters/decrypting_video_decoder.cc +++ b/media/filters/decrypting_video_decoder.cc
@@ -220,9 +220,8 @@ &DecryptingVideoDecoder::DeliverFrame, weak_this_))); } -void DecryptingVideoDecoder::DeliverFrame( - Decryptor::Status status, - const scoped_refptr<VideoFrame>& frame) { +void DecryptingVideoDecoder::DeliverFrame(Decryptor::Status status, + scoped_refptr<VideoFrame> frame) { DVLOG(3) << "DeliverFrame() - status: " << status; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK_EQ(state_, kPendingDecode) << state_; @@ -301,7 +300,7 @@ frame->set_color_space(config_.color_space_info().ToGfxColorSpace()); } - output_cb_.Run(frame); + output_cb_.Run(std::move(frame)); if (scoped_pending_buffer_to_decode->end_of_stream()) { // Set |pending_buffer_to_decode_| back as we need to keep flushing the
diff --git a/media/filters/decrypting_video_decoder.h b/media/filters/decrypting_video_decoder.h index 03cec55..857ff947 100644 --- a/media/filters/decrypting_video_decoder.h +++ b/media/filters/decrypting_video_decoder.h
@@ -70,8 +70,7 @@ void DecodePendingBuffer(); // Callback for Decryptor::DecryptAndDecodeVideo(). - void DeliverFrame(Decryptor::Status status, - const scoped_refptr<VideoFrame>& frame); + void DeliverFrame(Decryptor::Status status, scoped_refptr<VideoFrame> frame); // Callback for the |decryptor_| to notify this object that a new key has been // added.
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index 07c8f19..1aa9042 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc
@@ -707,7 +707,7 @@ DeliverFrame(frame); } -void GpuVideoDecoder::DeliverFrame(const scoped_refptr<VideoFrame>& frame) { +void GpuVideoDecoder::DeliverFrame(scoped_refptr<VideoFrame> frame) { DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); // During a pending vda->Reset(), we don't accumulate frames. Drop it on the @@ -717,7 +717,7 @@ frame->metadata()->SetBoolean(VideoFrameMetadata::POWER_EFFICIENT, true); - output_cb_.Run(frame); + output_cb_.Run(std::move(frame)); } // static
diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h index 1f2ae7f..468a695 100644 --- a/media/filters/gpu_video_decoder.h +++ b/media/filters/gpu_video_decoder.h
@@ -104,7 +104,7 @@ typedef std::map<int32_t, PictureBuffer> PictureBufferMap; - void DeliverFrame(const scoped_refptr<VideoFrame>& frame); + void DeliverFrame(scoped_refptr<VideoFrame> frame); // Static method is to allow it to run even after GVD is deleted. static void ReleaseMailbox(base::WeakPtr<GpuVideoDecoder> decoder,
diff --git a/media/filters/video_renderer_algorithm.cc b/media/filters/video_renderer_algorithm.cc index 115c6382..afa76b4 100644 --- a/media/filters/video_renderer_algorithm.cc +++ b/media/filters/video_renderer_algorithm.cc
@@ -334,7 +334,13 @@ DCHECK(frame); DCHECK(!frame->metadata()->IsTrue(VideoFrameMetadata::END_OF_STREAM)); - ReadyFrame ready_frame(frame); + // Note: Not all frames have duration. E.g., this class is used with WebRTC + // which does not provide duration information for its frames. + base::TimeDelta metadata_frame_duration; + auto has_duration = frame->metadata()->GetTimeDelta( + VideoFrameMetadata::FRAME_DURATION, &metadata_frame_duration); + auto timestamp = frame->timestamp(); + ReadyFrame ready_frame(std::move(frame)); auto it = frame_queue_.empty() ? frame_queue_.end() : std::lower_bound(frame_queue_.begin(), frame_queue_.end(), @@ -347,7 +353,7 @@ if (new_frame_index <= 0 && have_rendered_frames_) { LIMITED_MEDIA_LOG(INFO, media_log_, out_of_order_frame_logs_, kMaxOutOfOrderFrameLogs) - << "Dropping frame with timestamp " << frame->timestamp() + << "Dropping frame with timestamp " << timestamp << ", which is earlier than the last rendered frame (" << frame_queue_.front().frame->timestamp() << ")."; ++frames_dropped_during_enqueue_; @@ -357,15 +363,13 @@ // Drop any frames which are less than a millisecond apart in media time (even // those with timestamps matching an already enqueued frame), there's no way // we can reasonably render these frames; it's effectively a 1000fps limit. - const base::TimeDelta delta = - std::min(new_frame_index < frame_queue_.size() - ? frame_queue_[new_frame_index].frame->timestamp() - - frame->timestamp() - : base::TimeDelta::Max(), - new_frame_index > 0 - ? frame->timestamp() - - frame_queue_[new_frame_index - 1].frame->timestamp() - : base::TimeDelta::Max()); + const base::TimeDelta delta = std::min( + new_frame_index < frame_queue_.size() + ? frame_queue_[new_frame_index].frame->timestamp() - timestamp + : base::TimeDelta::Max(), + new_frame_index > 0 + ? timestamp - frame_queue_[new_frame_index - 1].frame->timestamp() + : base::TimeDelta::Max()); if (delta < base::TimeDelta::FromMilliseconds(1)) { DVLOG(2) << "Dropping frame too close to an already enqueued frame: " << delta.InMicroseconds() << " us"; @@ -376,7 +380,7 @@ // Calculate an accurate start time and an estimated end time if possible for // the new frame; this allows EffectiveFramesQueued() to be relatively correct // immediately after a new frame is queued. - std::vector<base::TimeDelta> media_timestamps(1, frame->timestamp()); + std::vector<base::TimeDelta> media_timestamps(1, timestamp); // If there are not enough frames to estimate duration based on end time, ask // the WallClockTimeCB to convert the estimated frame duration into wall clock @@ -384,15 +388,9 @@ // // Note: This duration value is not compensated for playback rate and // thus is different than |average_frame_duration_| which is compensated. - // - // Note: Not all frames have duration. E.g., this class is used with WebRTC - // which does not provide duration information for its frames. - base::TimeDelta metadata_frame_duration; - if (!frame_duration_calculator_.count() && - frame->metadata()->GetTimeDelta(VideoFrameMetadata::FRAME_DURATION, - &metadata_frame_duration) && + if (!frame_duration_calculator_.count() && has_duration && metadata_frame_duration > base::TimeDelta()) { - media_timestamps.push_back(frame->timestamp() + metadata_frame_duration); + media_timestamps.push_back(timestamp + metadata_frame_duration); } std::vector<base::TimeTicks> wall_clock_times; @@ -408,8 +406,7 @@ if (it != frame_queue_.end()) { LIMITED_MEDIA_LOG(INFO, media_log_, out_of_order_frame_logs_, kMaxOutOfOrderFrameLogs) - << "Decoded frame with timestamp " << frame->timestamp() - << " is out of order."; + << "Decoded frame with timestamp " << timestamp << " is out of order."; } frame_queue_.insert(it, ready_frame);
diff --git a/media/filters/video_renderer_algorithm_unittest.cc b/media/filters/video_renderer_algorithm_unittest.cc index c8b963d7..6ed5aa0 100644 --- a/media/filters/video_renderer_algorithm_unittest.cc +++ b/media/filters/video_renderer_algorithm_unittest.cc
@@ -878,7 +878,7 @@ RunFramePumpTest( true, &frame_tg, &display_tg, [¤t_frame, &actual_frame_pattern, desired_frame_pattern, this]( - const scoped_refptr<VideoFrame>& frame, size_t frames_dropped) { + scoped_refptr<VideoFrame> frame, size_t frames_dropped) { ASSERT_TRUE(frame); ASSERT_EQ(0u, frames_dropped); @@ -1124,18 +1124,18 @@ TickGenerator display_tg(tick_clock_->NowTicks(), test_rate[1]); scoped_refptr<VideoFrame> current_frame; - RunFramePumpTest( - true, &frame_tg, &display_tg, - [¤t_frame, this](const scoped_refptr<VideoFrame>& frame, - size_t frames_dropped) { - ASSERT_TRUE(frame); + RunFramePumpTest(true, &frame_tg, &display_tg, + [¤t_frame, this](scoped_refptr<VideoFrame> frame, + size_t frames_dropped) { + ASSERT_TRUE(frame); - // We don't count frames dropped that cadence says we should skip. - ASSERT_EQ(0u, frames_dropped); - ASSERT_NE(current_frame, frame); - ASSERT_TRUE(is_using_cadence()); - current_frame = frame; - }); + // We don't count frames dropped that cadence says we + // should skip. + ASSERT_EQ(0u, frames_dropped); + ASSERT_NE(current_frame, frame); + ASSERT_TRUE(is_using_cadence()); + current_frame = frame; + }); if (HasFatalFailure()) return; @@ -1157,7 +1157,7 @@ RunFramePumpTest( true, &frame_tg, &display_tg, [¤t_frame, &actual_frame_pattern, &desired_frame_pattern, this]( - const scoped_refptr<VideoFrame>& frame, size_t frames_dropped) { + scoped_refptr<VideoFrame> frame, size_t frames_dropped) { ASSERT_TRUE(frame); ASSERT_EQ(0u, frames_dropped); @@ -1362,7 +1362,7 @@ TickGenerator display_tg(tick_clock_->NowTicks(), display_rate); RunFramePumpTest( true, &frame_tg, &display_tg, - [](const scoped_refptr<VideoFrame>& frame, size_t frames_dropped) {}); + [](scoped_refptr<VideoFrame> frame, size_t frames_dropped) {}); } // Common display rates. @@ -1399,7 +1399,7 @@ time_source_.SetPlaybackRate(playback_rate); RunFramePumpTest( false, &frame_tg, &display_tg, - [](const scoped_refptr<VideoFrame>& frame, size_t frames_dropped) {}); + [](scoped_refptr<VideoFrame> frame, size_t frames_dropped) {}); if (HasFatalFailure()) return;
diff --git a/media/gpu/android/android_video_encode_accelerator.cc b/media/gpu/android/android_video_encode_accelerator.cc index 240734f..c527070 100644 --- a/media/gpu/android/android_video_encode_accelerator.cc +++ b/media/gpu/android/android_video_encode_accelerator.cc
@@ -229,9 +229,8 @@ } } -void AndroidVideoEncodeAccelerator::Encode( - const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) { +void AndroidVideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, + bool force_keyframe) { DVLOG(3) << __PRETTY_FUNCTION__ << ": " << force_keyframe; DCHECK(thread_checker_.CalledOnValidThread()); RETURN_ON_FAILURE(frame->format() == PIXEL_FORMAT_I420, "Unexpected format", @@ -251,7 +250,7 @@ kInvalidArgumentError); pending_frames_.push( - std::make_tuple(frame, force_keyframe, base::Time::Now())); + std::make_tuple(std::move(frame), force_keyframe, base::Time::Now())); DoIOTask(); }
diff --git a/media/gpu/android/android_video_encode_accelerator.h b/media/gpu/android/android_video_encode_accelerator.h index 384a518..bc0d850 100644 --- a/media/gpu/android/android_video_encode_accelerator.h +++ b/media/gpu/android/android_video_encode_accelerator.h
@@ -41,8 +41,7 @@ // VideoEncodeAccelerator implementation. VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override;
diff --git a/media/gpu/android/media_codec_video_decoder.cc b/media/gpu/android/media_codec_video_decoder.cc index a9f588c5..07e1c893 100644 --- a/media/gpu/android/media_codec_video_decoder.cc +++ b/media/gpu/android/media_codec_video_decoder.cc
@@ -850,14 +850,14 @@ void MediaCodecVideoDecoder::ForwardVideoFrame( int reset_generation, std::unique_ptr<ScopedAsyncTrace> async_trace, - const scoped_refptr<VideoFrame>& frame) { + scoped_refptr<VideoFrame> frame) { DVLOG(3) << __func__ << " : " << (frame ? frame->AsHumanReadableString() : "null"); if (reset_generation == reset_generation_) { // TODO(liberato): We might actually have a SW decoder. Consider setting // this to false if so, especially for higher bitrates. frame->metadata()->SetBoolean(VideoFrameMetadata::POWER_EFFICIENT, true); - output_cb_.Run(frame); + output_cb_.Run(std::move(frame)); } }
diff --git a/media/gpu/android/media_codec_video_decoder.h b/media/gpu/android/media_codec_video_decoder.h index ecb467c..5a34dac4 100644 --- a/media/gpu/android/media_codec_video_decoder.h +++ b/media/gpu/android/media_codec_video_decoder.h
@@ -177,7 +177,7 @@ // started when we dequeued the corresponding output buffer. void ForwardVideoFrame(int reset_generation, std::unique_ptr<ScopedAsyncTrace> async_trace, - const scoped_refptr<VideoFrame>& frame); + scoped_refptr<VideoFrame> frame); // Starts draining the codec by queuing an EOS if required. It skips the drain // if possible.
diff --git a/media/gpu/android/video_frame_factory.h b/media/gpu/android/video_frame_factory.h index c4708da..1650038 100644 --- a/media/gpu/android/video_frame_factory.h +++ b/media/gpu/android/video_frame_factory.h
@@ -32,8 +32,7 @@ public: using GetStubCb = base::Callback<gpu::CommandBufferStub*()>; using InitCb = base::RepeatingCallback<void(scoped_refptr<TextureOwner>)>; - using OnceOutputCb = - base::OnceCallback<void(const scoped_refptr<VideoFrame>&)>; + using OnceOutputCb = base::OnceCallback<void(scoped_refptr<VideoFrame>)>; VideoFrameFactory() = default; virtual ~VideoFrameFactory() = default;
diff --git a/media/gpu/mac/vt_video_encode_accelerator_mac.cc b/media/gpu/mac/vt_video_encode_accelerator_mac.cc index 0811b3b..84ba11e 100644 --- a/media/gpu/mac/vt_video_encode_accelerator_mac.cc +++ b/media/gpu/mac/vt_video_encode_accelerator_mac.cc
@@ -179,14 +179,15 @@ return true; } -void VTVideoEncodeAccelerator::Encode(const scoped_refptr<VideoFrame>& frame, +void VTVideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) { DVLOG(3) << __func__; DCHECK(thread_checker_.CalledOnValidThread()); encoder_thread_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&VTVideoEncodeAccelerator::EncodeTask, - base::Unretained(this), frame, force_keyframe)); + FROM_HERE, + base::BindOnce(&VTVideoEncodeAccelerator::EncodeTask, + base::Unretained(this), std::move(frame), force_keyframe)); } void VTVideoEncodeAccelerator::UseOutputBitstreamBuffer( @@ -251,9 +252,8 @@ delete this; } -void VTVideoEncodeAccelerator::EncodeTask( - const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) { +void VTVideoEncodeAccelerator::EncodeTask(scoped_refptr<VideoFrame> frame, + bool force_keyframe) { DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); DCHECK(compression_session_); DCHECK(frame);
diff --git a/media/gpu/mac/vt_video_encode_accelerator_mac.h b/media/gpu/mac/vt_video_encode_accelerator_mac.h index 3371b4df..5f955e53 100644 --- a/media/gpu/mac/vt_video_encode_accelerator_mac.h +++ b/media/gpu/mac/vt_video_encode_accelerator_mac.h
@@ -33,8 +33,7 @@ // VideoEncodeAccelerator implementation. VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override; @@ -51,7 +50,7 @@ struct BitstreamBufferRef; // Encoding tasks to be run on |encoder_thread_|. - void EncodeTask(const scoped_refptr<VideoFrame>& frame, bool force_keyframe); + void EncodeTask(scoped_refptr<VideoFrame> frame, bool force_keyframe); void UseOutputBitstreamBufferTask( std::unique_ptr<BitstreamBufferRef> buffer_ref); void RequestEncodingParametersChangeTask(uint32_t bitrate,
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc index 65b3ae4..1945fb1 100644 --- a/media/gpu/v4l2/v4l2_device.cc +++ b/media/gpu/v4l2/v4l2_device.cc
@@ -45,7 +45,7 @@ void* GetPlaneMapping(const size_t plane); size_t GetMemoryUsage() const; const struct v4l2_buffer* v4l2_buffer() const { return &v4l2_buffer_; } - const scoped_refptr<VideoFrame>& GetVideoFrame(); + scoped_refptr<VideoFrame> GetVideoFrame(); private: V4L2Buffer(scoped_refptr<V4L2Device> device, @@ -185,7 +185,7 @@ *layout, gfx::Rect(size), size, std::move(dmabuf_fds), base::TimeDelta()); } -const scoped_refptr<VideoFrame>& V4L2Buffer::GetVideoFrame() { +scoped_refptr<VideoFrame> V4L2Buffer::GetVideoFrame() { // We can create the VideoFrame only when using MMAP buffers. if (v4l2_buffer_.memory != V4L2_MEMORY_MMAP) { DVLOGF(1) << "Cannot create video frame from non-MMAP buffer"; @@ -262,7 +262,7 @@ bool QueueBuffer(); void* GetPlaneMapping(const size_t plane); - const scoped_refptr<VideoFrame>& GetVideoFrame(); + scoped_refptr<VideoFrame> GetVideoFrame(); // Data from the buffer, that users can query and/or write. struct v4l2_buffer v4l2_buffer_; @@ -330,7 +330,7 @@ return queue_->buffers_[BufferId()]->GetPlaneMapping(plane); } -const scoped_refptr<VideoFrame>& V4L2BufferRefBase::GetVideoFrame() { +scoped_refptr<VideoFrame> V4L2BufferRefBase::GetVideoFrame() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Used so we can return a const scoped_refptr& in all cases. @@ -383,7 +383,7 @@ return *this; } -const scoped_refptr<VideoFrame>& V4L2WritableBufferRef::GetVideoFrame() { +scoped_refptr<VideoFrame> V4L2WritableBufferRef::GetVideoFrame() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return buffer_data_->GetVideoFrame(); @@ -564,7 +564,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } -const scoped_refptr<VideoFrame>& V4L2ReadableBuffer::GetVideoFrame() { +scoped_refptr<VideoFrame> V4L2ReadableBuffer::GetVideoFrame() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return buffer_data_->GetVideoFrame();
diff --git a/media/gpu/v4l2/v4l2_device.h b/media/gpu/v4l2/v4l2_device.h index 550b310..bc209f23 100644 --- a/media/gpu/v4l2/v4l2_device.h +++ b/media/gpu/v4l2/v4l2_device.h
@@ -112,7 +112,7 @@ // V4L2ReadableBufferRef if both references point to the same V4L2 buffer. // Note: at the moment, this method is valid for MMAP buffers only. It will // return nullptr for any other buffer type. - const scoped_refptr<VideoFrame>& GetVideoFrame() WARN_UNUSED_RESULT; + scoped_refptr<VideoFrame> GetVideoFrame() WARN_UNUSED_RESULT; // Return the V4L2 buffer ID of the underlying buffer. // TODO(acourbot) This is used for legacy clients but should be ultimately @@ -171,7 +171,7 @@ // V4L2ReadableBufferRef if both references point to the same V4L2 buffer. // Note: at the moment, this method is valid for MMAP buffers only. It will // return nullptr for any other buffer type. - const scoped_refptr<VideoFrame>& GetVideoFrame() WARN_UNUSED_RESULT; + scoped_refptr<VideoFrame> GetVideoFrame() WARN_UNUSED_RESULT; private: friend class V4L2BufferRefFactory;
diff --git a/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc b/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc index 9352a7c2..2353b4b 100644 --- a/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc
@@ -248,9 +248,8 @@ return true; } -void V4L2MjpegDecodeAccelerator::Decode( - BitstreamBuffer bitstream_buffer, - const scoped_refptr<VideoFrame>& video_frame) { +void V4L2MjpegDecodeAccelerator::Decode(BitstreamBuffer bitstream_buffer, + scoped_refptr<VideoFrame> video_frame) { DVLOGF(4) << "input_id=" << bitstream_buffer.id() << ", size=" << bitstream_buffer.size(); DCHECK(io_task_runner_->BelongsToCurrentThread()); @@ -267,7 +266,7 @@ } std::unique_ptr<JobRecord> job_record( - new JobRecord(std::move(bitstream_buffer), video_frame)); + new JobRecord(std::move(bitstream_buffer), std::move(video_frame))); decoder_task_runner_->PostTask( FROM_HERE, @@ -671,7 +670,7 @@ bool V4L2MjpegDecodeAccelerator::ConvertOutputImage( const BufferRecord& output_buffer, - const scoped_refptr<VideoFrame>& dst_frame) { + VideoFrame* dst_frame) { uint8_t* dst_y = dst_frame->data(VideoFrame::kYPlane); uint8_t* dst_u = dst_frame->data(VideoFrame::kUPlane); uint8_t* dst_v = dst_frame->data(VideoFrame::kVPlane); @@ -821,7 +820,7 @@ // Copy the decoded data from output buffer to the buffer provided by the // client. Do format conversion when output format is not // V4L2_PIX_FMT_YUV420. - if (!ConvertOutputImage(output_record, job_record->out_frame)) { + if (!ConvertOutputImage(output_record, job_record->out_frame.get())) { PostNotifyError(job_record->bitstream_buffer_id, PLATFORM_FAILURE); return; }
diff --git a/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.h b/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.h index e2d249f..b0c9442c 100644 --- a/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.h +++ b/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.h
@@ -38,7 +38,7 @@ bool Initialize( chromeos_camera::MjpegDecodeAccelerator::Client* client) override; void Decode(BitstreamBuffer bitstream_buffer, - const scoped_refptr<VideoFrame>& video_frame) override; + scoped_refptr<VideoFrame> video_frame) override; bool IsSupported() override; private: @@ -90,7 +90,7 @@ // - V4L2_PIX_FMT_YUV_420M // - V4L2_PIX_FMT_YUV_422M bool ConvertOutputImage(const BufferRecord& output_buffer, - const scoped_refptr<VideoFrame>& dst_frame); + VideoFrame* dst_frame); // Return the number of input/output buffers enqueued to the device. size_t InputBufferQueuedCount();
diff --git a/media/gpu/v4l2/v4l2_video_encode_accelerator.cc b/media/gpu/v4l2/v4l2_video_encode_accelerator.cc index 3c437f2..bd430c0ac 100644 --- a/media/gpu/v4l2/v4l2_video_encode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_video_encode_accelerator.cc
@@ -363,7 +363,7 @@ NOTIFY_ERROR(kPlatformFailureError); } -void V4L2VideoEncodeAccelerator::Encode(const scoped_refptr<VideoFrame>& frame, +void V4L2VideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) { DVLOGF(4) << "force_keyframe=" << force_keyframe; DCHECK(child_task_runner_->BelongsToCurrentThread()); @@ -405,13 +405,13 @@ } } } else { - image_processor_input_queue_.emplace(frame, force_keyframe); + image_processor_input_queue_.emplace(std::move(frame), force_keyframe); } } else { encoder_thread_.task_runner()->PostTask( - FROM_HERE, - base::BindOnce(&V4L2VideoEncodeAccelerator::EncodeTask, - base::Unretained(this), frame, force_keyframe)); + FROM_HERE, base::BindOnce(&V4L2VideoEncodeAccelerator::EncodeTask, + base::Unretained(this), std::move(frame), + force_keyframe)); } } @@ -628,9 +628,8 @@ return buffer_ref->shm->size() - remaining_dst_size; } -void V4L2VideoEncodeAccelerator::EncodeTask( - const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) { +void V4L2VideoEncodeAccelerator::EncodeTask(scoped_refptr<VideoFrame> frame, + bool force_keyframe) { DVLOGF(4) << "force_keyframe=" << force_keyframe; DCHECK(encoder_thread_.task_runner()->BelongsToCurrentThread()); DCHECK_NE(encoder_state_, kUninitialized); @@ -640,7 +639,7 @@ return; } - encoder_input_queue_.emplace(frame, force_keyframe); + encoder_input_queue_.emplace(std::move(frame), force_keyframe); Enqueue(); }
diff --git a/media/gpu/v4l2/v4l2_video_encode_accelerator.h b/media/gpu/v4l2/v4l2_video_encode_accelerator.h index 1b3356c1..05a88fab 100644 --- a/media/gpu/v4l2/v4l2_video_encode_accelerator.h +++ b/media/gpu/v4l2/v4l2_video_encode_accelerator.h
@@ -50,8 +50,7 @@ // VideoEncodeAccelerator implementation. VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override; @@ -127,7 +126,7 @@ // Encoding tasks, to be run on encode_thread_. // - void EncodeTask(const scoped_refptr<VideoFrame>& frame, bool force_keyframe); + void EncodeTask(scoped_refptr<VideoFrame> frame, bool force_keyframe); // Add a BitstreamBuffer to the queue of buffers ready to be used for encoder // output.
diff --git a/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc index 71b8f082..ad547de 100644 --- a/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc
@@ -132,7 +132,7 @@ surface_size_ = input_size; } - if (!vaapi_wrapper_->UploadVideoFrameToSurface(request->video_frame, + if (!vaapi_wrapper_->UploadVideoFrameToSurface(*request->video_frame, va_surface_id_)) { VLOGF(1) << "Failed to upload video frame to VA surface"; notify_error_cb_.Run(buffer_id, PLATFORM_FAILURE);
diff --git a/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc b/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc index d1a281f..f4fcad7d 100644 --- a/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc
@@ -147,7 +147,7 @@ bool VaapiMjpegDecodeAccelerator::OutputPictureOnTaskRunner( std::unique_ptr<ScopedVAImage> scoped_image, int32_t input_buffer_id, - const scoped_refptr<VideoFrame>& video_frame) { + scoped_refptr<VideoFrame> video_frame) { DCHECK(decoder_task_runner_->BelongsToCurrentThread()); TRACE_EVENT1("jpeg", "VaapiMjpegDecodeAccelerator::OutputPictureOnTaskRunner", @@ -236,7 +236,7 @@ } if (!OutputPictureOnTaskRunner(std::move(image), bitstream_buffer_id, - video_frame)) { + std::move(video_frame))) { VLOGF(1) << "Output picture failed"; NotifyError(bitstream_buffer_id, PLATFORM_FAILURE); } @@ -244,7 +244,7 @@ void VaapiMjpegDecodeAccelerator::Decode( BitstreamBuffer bitstream_buffer, - const scoped_refptr<VideoFrame>& video_frame) { + scoped_refptr<VideoFrame> video_frame) { DCHECK(io_task_runner_->BelongsToCurrentThread()); TRACE_EVENT1("jpeg", "Decode", "input_id", bitstream_buffer.id());
diff --git a/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.h b/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.h index 4d1f7de3..c32ceb5 100644 --- a/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.h +++ b/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.h
@@ -47,7 +47,7 @@ bool Initialize( chromeos_camera::MjpegDecodeAccelerator::Client* client) override; void Decode(BitstreamBuffer bitstream_buffer, - const scoped_refptr<VideoFrame>& video_frame) override; + scoped_refptr<VideoFrame> video_frame) override; bool IsSupported() override; private: @@ -69,7 +69,7 @@ // |input_buffer_id| of the resulting picture to client for output. bool OutputPictureOnTaskRunner(std::unique_ptr<ScopedVAImage> image, int32_t input_buffer_id, - const scoped_refptr<VideoFrame>& video_frame); + scoped_refptr<VideoFrame> video_frame); // ChildThread's task runner. const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc index 408ff2c12..ba1da76 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -418,7 +418,7 @@ VASurfaceID va_surface_id) { DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); DVLOGF(4) << "frame is uploading: " << va_surface_id; - if (!vaapi_wrapper_->UploadVideoFrameToSurface(frame, va_surface_id)) + if (!vaapi_wrapper_->UploadVideoFrameToSurface(*frame, va_surface_id)) NOTIFY_ERROR(kPlatformFailureError, "Failed to upload frame"); } @@ -500,15 +500,16 @@ buffer->id, encode_job->Metadata(data_size))); } -void VaapiVideoEncodeAccelerator::Encode(const scoped_refptr<VideoFrame>& frame, +void VaapiVideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) { DVLOGF(4) << "Frame timestamp: " << frame->timestamp().InMilliseconds() << " force_keyframe: " << force_keyframe; DCHECK(child_task_runner_->BelongsToCurrentThread()); encoder_thread_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&VaapiVideoEncodeAccelerator::EncodeTask, - base::Unretained(this), frame, force_keyframe)); + FROM_HERE, + base::BindOnce(&VaapiVideoEncodeAccelerator::EncodeTask, + base::Unretained(this), std::move(frame), force_keyframe)); } void VaapiVideoEncodeAccelerator::EncodeTask(scoped_refptr<VideoFrame> frame, @@ -516,7 +517,8 @@ DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); DCHECK_NE(state_, kUninitialized); - input_queue_.push(std::make_unique<InputFrameRef>(frame, force_keyframe)); + input_queue_.push( + std::make_unique<InputFrameRef>(std::move(frame), force_keyframe)); EncodePendingInputs(); }
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.h b/media/gpu/vaapi/vaapi_video_encode_accelerator.h index e7b9277..9aef0e0 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.h +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.h
@@ -37,8 +37,7 @@ // VideoEncodeAccelerator implementation. VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override;
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc index bf80a642..ac8f86626 100644 --- a/media/gpu/vaapi/vaapi_wrapper.cc +++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -1458,12 +1458,11 @@ return scoped_image->IsValid() ? std::move(scoped_image) : nullptr; } -bool VaapiWrapper::UploadVideoFrameToSurface( - const scoped_refptr<VideoFrame>& frame, - VASurfaceID va_surface_id) { +bool VaapiWrapper::UploadVideoFrameToSurface(const VideoFrame& frame, + VASurfaceID va_surface_id) { base::AutoLock auto_lock(*va_lock_); - const gfx::Size size = frame->coded_size(); + const gfx::Size size = frame.coded_size(); bool va_create_put_fallback = false; VAImage image; VAStatus va_res = vaDeriveImage(va_display_, va_surface_id, &image); @@ -1500,30 +1499,28 @@ int ret = 0; { base::AutoUnlock auto_unlock(*va_lock_); - switch (frame->format()) { + switch (frame.format()) { case PIXEL_FORMAT_I420: - ret = libyuv::I420ToNV12(frame->data(VideoFrame::kYPlane), - frame->stride(VideoFrame::kYPlane), - frame->data(VideoFrame::kUPlane), - frame->stride(VideoFrame::kUPlane), - frame->data(VideoFrame::kVPlane), - frame->stride(VideoFrame::kVPlane), - image_ptr + image.offsets[0], image.pitches[0], - image_ptr + image.offsets[1], image.pitches[1], - image.width, image.height); + ret = libyuv::I420ToNV12( + frame.data(VideoFrame::kYPlane), frame.stride(VideoFrame::kYPlane), + frame.data(VideoFrame::kUPlane), frame.stride(VideoFrame::kUPlane), + frame.data(VideoFrame::kVPlane), frame.stride(VideoFrame::kVPlane), + image_ptr + image.offsets[0], image.pitches[0], + image_ptr + image.offsets[1], image.pitches[1], image.width, + image.height); break; case PIXEL_FORMAT_NV12: - libyuv::CopyPlane(frame->data(VideoFrame::kYPlane), - frame->stride(VideoFrame::kYPlane), + libyuv::CopyPlane(frame.data(VideoFrame::kYPlane), + frame.stride(VideoFrame::kYPlane), image_ptr + image.offsets[0], image.pitches[0], image.width, image.height); - libyuv::CopyPlane(frame->data(VideoFrame::kUVPlane), - frame->stride(VideoFrame::kUVPlane), + libyuv::CopyPlane(frame.data(VideoFrame::kUVPlane), + frame.stride(VideoFrame::kUVPlane), image_ptr + image.offsets[1], image.pitches[1], image.width, image.height / 2); break; default: - LOG(ERROR) << "Unsupported pixel format: " << frame->format(); + LOG(ERROR) << "Unsupported pixel format: " << frame.format(); return false; } }
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h index e98390d..1ac3978 100644 --- a/media/gpu/vaapi/vaapi_wrapper.h +++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -221,7 +221,7 @@ const gfx::Size& size); // Upload contents of |frame| into |va_surface_id| for encode. - bool UploadVideoFrameToSurface(const scoped_refptr<VideoFrame>& frame, + bool UploadVideoFrameToSurface(const VideoFrame& frame, VASurfaceID va_surface_id); // Create a buffer of |size| bytes to be used as encode output.
diff --git a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc index 1f7408e7..593a8dc 100644 --- a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc +++ b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc
@@ -256,7 +256,7 @@ } void MediaFoundationVideoEncodeAccelerator::Encode( - const scoped_refptr<VideoFrame>& frame, + scoped_refptr<VideoFrame> frame, bool force_keyframe) { DVLOG(3) << __func__; DCHECK(main_client_task_runner_->BelongsToCurrentThread()); @@ -264,7 +264,7 @@ encoder_thread_task_runner_->PostTask( FROM_HERE, base::BindOnce(&MediaFoundationVideoEncodeAccelerator::EncodeTask, - encoder_task_weak_factory_.GetWeakPtr(), frame, + encoder_task_weak_factory_.GetWeakPtr(), std::move(frame), force_keyframe)); }
diff --git a/media/gpu/windows/media_foundation_video_encode_accelerator_win.h b/media/gpu/windows/media_foundation_video_encode_accelerator_win.h index 43ef0e6..df7052d9 100644 --- a/media/gpu/windows/media_foundation_video_encode_accelerator_win.h +++ b/media/gpu/windows/media_foundation_video_encode_accelerator_win.h
@@ -41,8 +41,7 @@ // VideoEncodeAccelerator implementation. VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override;
diff --git a/media/gpu/windows/output_with_release_mailbox_cb.h b/media/gpu/windows/output_with_release_mailbox_cb.h index 499d6e5..d653c3a1 100644 --- a/media/gpu/windows/output_with_release_mailbox_cb.h +++ b/media/gpu/windows/output_with_release_mailbox_cb.h
@@ -18,8 +18,7 @@ // Similar to VideoFrame::ReleaseMailboxCB for now. using ReleaseMailboxCB = base::OnceCallback<void(const gpu::SyncToken&)>; using OutputWithReleaseMailboxCB = - base::RepeatingCallback<void(ReleaseMailboxCB, - const scoped_refptr<VideoFrame>&)>; + base::RepeatingCallback<void(ReleaseMailboxCB, scoped_refptr<VideoFrame>)>; } // namespace deprecated } // namespace media
diff --git a/media/learning/common/BUILD.gn b/media/learning/common/BUILD.gn index 20e2cac..4e208d3 100644 --- a/media/learning/common/BUILD.gn +++ b/media/learning/common/BUILD.gn
@@ -38,6 +38,7 @@ deps = [ "//base", + "//services/metrics/public/cpp:metrics_cpp", ] }
diff --git a/media/learning/common/DEPS b/media/learning/common/DEPS new file mode 100644 index 0000000..cde7e700 --- /dev/null +++ b/media/learning/common/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+services/metrics", +]
diff --git a/media/learning/common/learning_task.cc b/media/learning/common/learning_task.cc index 07cc407..fa5c088 100644 --- a/media/learning/common/learning_task.cc +++ b/media/learning/common/learning_task.cc
@@ -4,6 +4,8 @@ #include "media/learning/common/learning_task.h" +#include "base/hash/hash.h" + namespace media { namespace learning { @@ -23,5 +25,9 @@ LearningTask::~LearningTask() = default; +LearningTask::Id LearningTask::GetId() const { + return base::PersistentHash(name); +} + } // namespace learning } // namespace media
diff --git a/media/learning/common/learning_task.h b/media/learning/common/learning_task.h index ed5f4f7..4980919 100644 --- a/media/learning/common/learning_task.h +++ b/media/learning/common/learning_task.h
@@ -23,6 +23,9 @@ // TODO(liberato): should this be in impl? Probably not if we want to allow // registering tasks. struct COMPONENT_EXPORT(LEARNING_COMMON) LearningTask { + // Numeric ID for this task for UKM reporting. + using Id = uint64_t; + // Not all models support all feature / target descriptions. For example, // NaiveBayes requires kUnordered features. Similarly, LogLinear woudln't // support kUnordered features or targets. kRandomForest might support more @@ -84,7 +87,11 @@ LearningTask(const LearningTask&); ~LearningTask(); - // Unique name for this learner. + // Return a stable, unique numeric ID for this task. This requires a stable, + // unique |name| for the task. This is used to identify this task in UKM. + Id GetId() const; + + // Unique name for this task. std::string name; Model model = Model::kExtraTrees; @@ -183,6 +190,20 @@ // [0-9] [10-19] ... [90-99] [100 and up]. This makes sense if the training // set maximum size is the default of 100, and each example has a weight of 1. int num_reporting_weight_buckets = 11; + + // If set, then we'll record results to UKM. Note that this may require an + // additional privacy review for your learning task! Also note that it is + // currently exclusive with |uma_hacky_confusion_matrix| for no technical + // reason whatsoever. + bool report_via_ukm = false; + + // When reporting via UKM, we will scale observed / predicted values. These + // are the minimum and maximum target / observed values that will be + // representable. The UKM record will scale / translate this range into + // 0-100 integer, inclusive. This is intended for regression targets. + // Classification will do something else. + double ukm_min_input_value = 0.0; + double ukm_max_input_value = 1.0; }; } // namespace learning
diff --git a/media/learning/common/learning_task_controller.h b/media/learning/common/learning_task_controller.h index 1e224bd..ef098330 100644 --- a/media/learning/common/learning_task_controller.h +++ b/media/learning/common/learning_task_controller.h
@@ -11,6 +11,7 @@ #include "base/unguessable_token.h" #include "media/learning/common/labelled_example.h" #include "media/learning/common/learning_task.h" +#include "services/metrics/public/cpp/ukm_source_id.h" namespace media { namespace learning { @@ -21,13 +22,16 @@ // SourceId, which most callers don't care about. struct ObservationCompletion { ObservationCompletion() = default; - /* implicit */ ObservationCompletion(const TargetValue& target) - : target_value(target) {} - ObservationCompletion(const TargetValue& target, WeightType w) - : target_value(target), weight(w) {} + /* implicit */ ObservationCompletion(const TargetValue& target, + WeightType w = 1., + ukm::SourceId id = ukm::kInvalidSourceId) + : target_value(target), weight(w), source_id(id) {} TargetValue target_value; - WeightType weight = 1u; + WeightType weight; + + // Optional, and ignored from the renderer. + ukm::SourceId source_id; }; // Client for a single learning task. Intended to be the primary API for client
diff --git a/media/learning/impl/BUILD.gn b/media/learning/impl/BUILD.gn index 27ed8c2..32ffc74 100644 --- a/media/learning/impl/BUILD.gn +++ b/media/learning/impl/BUILD.gn
@@ -50,6 +50,7 @@ deps = [ "//base", "//services/metrics/public/cpp:metrics_cpp", + "//services/metrics/public/cpp:ukm_builders", ] public_deps = [ @@ -80,6 +81,7 @@ deps = [ ":impl", "//base/test:test_support", + "//components/ukm:test_support", "//media:test_support", "//media/learning/impl", "//testing/gtest",
diff --git a/media/learning/impl/DEPS b/media/learning/impl/DEPS new file mode 100644 index 0000000..9eaf6b7 --- /dev/null +++ b/media/learning/impl/DEPS
@@ -0,0 +1,9 @@ +include_rules = [ + "+services/metrics", +] + +specific_include_rules = { + "distribution_reporter_unittest.cc" : [ + "+components/ukm", + ], +}
diff --git a/media/learning/impl/distribution_reporter.cc b/media/learning/impl/distribution_reporter.cc index a42f2c5..66276449 100644 --- a/media/learning/impl/distribution_reporter.cc +++ b/media/learning/impl/distribution_reporter.cc
@@ -6,6 +6,8 @@ #include "base/bind.h" #include "base/metrics/histogram_functions.h" +#include "services/metrics/public/cpp/ukm_builders.h" +#include "services/metrics/public/cpp/ukm_recorder.h" namespace media { namespace learning { @@ -162,16 +164,68 @@ } }; +// Ukm-based reporter. +class UkmRegressionReporter : public DistributionReporter { + public: + UkmRegressionReporter(const LearningTask& task) + : DistributionReporter(task) {} + + void OnPrediction(const PredictionInfo& info, + TargetHistogram predicted) override { + DCHECK_EQ(task().target_description.ordering, + LearningTask::Ordering::kNumeric); + + DCHECK_NE(info.source_id, ukm::kInvalidSourceId); + + ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get(); + if (!ukm_recorder) + return; + + ukm::builders::Media_Learning_PredictionRecord builder(info.source_id); + builder.SetLearningTask(task().GetId()); + builder.SetObservedValue(Bucketize(info.observed.value())); + builder.SetPredictedValue(Bucketize(predicted.Average())); + builder.SetTrainingDataTotalWeight(info.total_training_weight); + builder.SetTrainingDataSize(info.total_training_examples); + // TODO(liberato): we'd add feature subsets here. + + builder.Record(ukm_recorder); + } + + // Scale and translate |value| from the range specified in the task to 0-100. + // We scale it so that the buckets have an equal amount of the input range in + // each of them. + int Bucketize(double value) { + const int output_min = 0; + const int output_max = 100; + // Scale it so that input_min -> output_min and input_max -> output_max. + // Note that the input width is |input_max - input_min|, but there are + // |output_max - output_min + 1| output buckets. That's why we don't + // add one to the denominator, but we do add one to the numerator. + double scaled_value = + ((output_max - output_min + 1) * (value - task().ukm_min_input_value)) / + (task().ukm_max_input_value - task().ukm_min_input_value) + + output_min; + // Clip to [0, 100] and truncate to an integer. + return std::min(std::max(static_cast<int>(scaled_value), output_min), + output_max); + } +}; + std::unique_ptr<DistributionReporter> DistributionReporter::Create( const LearningTask& task) { // We only know how to report regression tasks right now. if (task.target_description.ordering != LearningTask::Ordering::kNumeric) return nullptr; + // We can report hacky UMA or non-hacky UKM. We could report both if we had + // a DistributionReporter that forwarded predictions to each, but we don't. if (task.uma_hacky_aggregate_confusion_matrix || task.uma_hacky_by_training_weight_confusion_matrix || task.uma_hacky_by_feature_subset_confusion_matrix) { return std::make_unique<UmaRegressionReporter>(task); + } else if (task.report_via_ukm) { + return std::make_unique<UkmRegressionReporter>(task); } return nullptr;
diff --git a/media/learning/impl/distribution_reporter.h b/media/learning/impl/distribution_reporter.h index 99310aa0..349302e5 100644 --- a/media/learning/impl/distribution_reporter.h +++ b/media/learning/impl/distribution_reporter.h
@@ -15,6 +15,7 @@ #include "media/learning/common/learning_task.h" #include "media/learning/impl/model.h" #include "media/learning/impl/target_histogram.h" +#include "services/metrics/public/cpp/ukm_source_id.h" namespace media { namespace learning { @@ -29,6 +30,19 @@ // What value was observed? TargetValue observed; + // UKM source id to use when logging this result. + // This will be filled in by the LearningTaskController. For example, the + // MojoLearningTaskControllerService will be created in the browser by the + // MediaMetricsProvider, which gets the SourceId via callback from the + // RenderFrameHostDelegate on construction. + // + // TODO(liberato): Right now, this is not filled in anywhere. When the + // mojo service is created (MediaMetricsProvider), record the source id and + // memorize it in any MojoLearningTaskControllerService that's created by + // the MediaMetricsProvider, either directly or in a wrapper for the + // mojo controller. + ukm::SourceId source_id = ukm::kInvalidSourceId; + // Total weight of the training data used to create this model. double total_training_weight = 0.;
diff --git a/media/learning/impl/distribution_reporter_unittest.cc b/media/learning/impl/distribution_reporter_unittest.cc index 43679be..55f1f4a 100644 --- a/media/learning/impl/distribution_reporter_unittest.cc +++ b/media/learning/impl/distribution_reporter_unittest.cc
@@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/test/scoped_task_environment.h" +#include "components/ukm/test_ukm_recorder.h" #include "media/learning/common/learning_task.h" #include "media/learning/impl/distribution_reporter.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +17,9 @@ class DistributionReporterTest : public testing::Test { public: - DistributionReporterTest() { + DistributionReporterTest() + : ukm_recorder_(std::make_unique<ukm::TestAutoSetUkmRecorder>()), + source_id_(123) { task_.name = "TaskName"; // UMA reporting requires a numeric target. task_.target_description.ordering = LearningTask::Ordering::kNumeric; @@ -24,9 +27,19 @@ base::test::ScopedTaskEnvironment scoped_task_environment_; + std::unique_ptr<ukm::TestAutoSetUkmRecorder> ukm_recorder_; + LearningTask task_; + ukm::SourceId source_id_; + std::unique_ptr<DistributionReporter> reporter_; + + TargetHistogram HistogramFor(double value) { + TargetHistogram histogram; + histogram += TargetValue(value); + return histogram; + } }; TEST_F(DistributionReporterTest, DistributionReporterDoesNotCrash) { @@ -50,8 +63,47 @@ std::move(cb).Run(predicted); } -TEST_F(DistributionReporterTest, DistributionReporterMustBeRequested) { +TEST_F(DistributionReporterTest, CallbackRecordsRegressionPredictions) { + // Make sure that |reporter_| records everything correctly for regressions. + task_.target_description.ordering = LearningTask::Ordering::kNumeric; + // Scale 1-2 => 0->100. + task_.ukm_min_input_value = 1.; + task_.ukm_max_input_value = 2.; + task_.report_via_ukm = true; + reporter_ = DistributionReporter::Create(task_); + EXPECT_NE(reporter_, nullptr); + + DistributionReporter::PredictionInfo info; + info.observed = TargetValue(1.1); // => 10 + info.source_id = source_id_; + auto cb = reporter_->GetPredictionCallback(info); + + TargetHistogram predicted; + const TargetValue One(1); + const TargetValue Five(5); + // Predict an average of 1.5 => 50 in the 0-100 scale. + predicted[One] = 70; + predicted[Five] = 10; + ASSERT_EQ(predicted.Average(), 1.5); + std::move(cb).Run(predicted); + + // The record should show the correct averages, scaled by |fixed_point_scale|. + std::vector<const ukm::mojom::UkmEntry*> entries = + ukm_recorder_->GetEntriesByName("Media.Learning.PredictionRecord"); + EXPECT_EQ(entries.size(), 1u); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[0], "LearningTask", + task_.GetId()); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[0], "ObservedValue", 10); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[0], "PredictedValue", 50); +} + +TEST_F(DistributionReporterTest, DistributionReporterNeedsUmaNameOrUkm) { // Make sure that we don't get a reporter if we don't request any reporting. + task_.target_description.ordering = LearningTask::Ordering::kNumeric; + task_.uma_hacky_aggregate_confusion_matrix = false; + task_.uma_hacky_by_training_weight_confusion_matrix = false; + task_.uma_hacky_by_feature_subset_confusion_matrix = false; + task_.report_via_ukm = false; reporter_ = DistributionReporter::Create(task_); EXPECT_EQ(reporter_, nullptr); } @@ -83,5 +135,59 @@ EXPECT_NE(reporter_, nullptr); } +TEST_F(DistributionReporterTest, UkmBucketizesProperly) { + task_.target_description.ordering = LearningTask::Ordering::kNumeric; + // Scale [1000, 2000] => [0, 100] + task_.ukm_min_input_value = 1000; + task_.ukm_max_input_value = 2000; + task_.report_via_ukm = true; + + reporter_ = DistributionReporter::Create(task_); + DistributionReporter::PredictionInfo info; + info.source_id = source_id_; + + // Add a few predictions / observations. We rotate the predicted / observed + // just to be sure they end up in the right UKM field. + + // Inputs less than min scale to 0. + info.observed = TargetValue(900); + reporter_->GetPredictionCallback(info).Run(HistogramFor(1500)); + + // Inputs exactly at min scale to 0. + info.observed = TargetValue(1000); + reporter_->GetPredictionCallback(info).Run(HistogramFor(2000)); + + // Inputs in the middle scale to 50. + info.observed = TargetValue(1500); + reporter_->GetPredictionCallback(info).Run(HistogramFor(2100)); + + // Inputs at max scale to 100. + info.observed = TargetValue(2000); + reporter_->GetPredictionCallback(info).Run(HistogramFor(900)); + + // Inputs greater than max scale to 100. + info.observed = TargetValue(2100); + reporter_->GetPredictionCallback(info).Run(HistogramFor(1000)); + + std::vector<const ukm::mojom::UkmEntry*> entries = + ukm_recorder_->GetEntriesByName("Media.Learning.PredictionRecord"); + EXPECT_EQ(entries.size(), 5u); + + ukm::TestUkmRecorder::ExpectEntryMetric(entries[0], "ObservedValue", 0); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[0], "PredictedValue", 50); + + ukm::TestUkmRecorder::ExpectEntryMetric(entries[1], "ObservedValue", 0); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[1], "PredictedValue", 100); + + ukm::TestUkmRecorder::ExpectEntryMetric(entries[2], "ObservedValue", 50); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[2], "PredictedValue", 100); + + ukm::TestUkmRecorder::ExpectEntryMetric(entries[3], "ObservedValue", 100); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[3], "PredictedValue", 0); + + ukm::TestUkmRecorder::ExpectEntryMetric(entries[4], "ObservedValue", 100); + ukm::TestUkmRecorder::ExpectEntryMetric(entries[4], "PredictedValue", 0); +} + } // namespace learning } // namespace media
diff --git a/media/learning/impl/learning_session_impl.h b/media/learning/impl/learning_session_impl.h index 01402f5..1ada2b5 100644 --- a/media/learning/impl/learning_session_impl.h +++ b/media/learning/impl/learning_session_impl.h
@@ -24,7 +24,8 @@ : public LearningSession { public: // We will create LearningTaskControllers that run on |task_runner|. - LearningSessionImpl(scoped_refptr<base::SequencedTaskRunner> task_runner); + explicit LearningSessionImpl( + scoped_refptr<base::SequencedTaskRunner> task_runner); ~LearningSessionImpl() override; // Create a SequenceBound controller for |task| on |task_runner|.
diff --git a/media/learning/impl/learning_task_controller_helper.cc b/media/learning/impl/learning_task_controller_helper.cc index 01c8972..6b05067 100644 --- a/media/learning/impl/learning_task_controller_helper.cc +++ b/media/learning/impl/learning_task_controller_helper.cc
@@ -50,6 +50,7 @@ iter->second.example.target_value = completion.target_value; iter->second.example.weight = completion.weight; iter->second.target_done = true; + iter->second.source_id = completion.source_id; ProcessExampleIfFinished(std::move(iter)); } @@ -98,7 +99,7 @@ if (!iter->second.features_done || !iter->second.target_done) return; - add_example_cb_.Run(std::move(iter->second.example)); + add_example_cb_.Run(std::move(iter->second.example), iter->second.source_id); pending_examples_.erase(iter); // TODO(liberato): If we receive FeatureVector f1 then f2, and start filling
diff --git a/media/learning/impl/learning_task_controller_helper.h b/media/learning/impl/learning_task_controller_helper.h index 7e9bb6f..28318655 100644 --- a/media/learning/impl/learning_task_controller_helper.h +++ b/media/learning/impl/learning_task_controller_helper.h
@@ -16,6 +16,7 @@ #include "base/threading/sequence_bound.h" #include "media/learning/common/learning_task_controller.h" #include "media/learning/impl/feature_provider.h" +#include "services/metrics/public/cpp/ukm_source_id.h" namespace media { namespace learning { @@ -35,7 +36,8 @@ : public base::SupportsWeakPtr<LearningTaskControllerHelper> { public: // Callback to add labelled examples as training data. - using AddExampleCB = base::RepeatingCallback<void(LabelledExample)>; + using AddExampleCB = + base::RepeatingCallback<void(LabelledExample, ukm::SourceId)>; // TODO(liberato): Consider making the FP not optional. LearningTaskControllerHelper(const LearningTask& task, @@ -61,6 +63,8 @@ // Has the client added a TargetValue? // TODO(liberato): Should it provide a weight with the target value? bool target_done = false; + + ukm::SourceId source_id = ukm::kInvalidSourceId; }; // [non-repeating int] = example
diff --git a/media/learning/impl/learning_task_controller_helper_unittest.cc b/media/learning/impl/learning_task_controller_helper_unittest.cc index bda756f..606c7a7 100644 --- a/media/learning/impl/learning_task_controller_helper_unittest.cc +++ b/media/learning/impl/learning_task_controller_helper_unittest.cc
@@ -72,8 +72,9 @@ std::move(sb_fp)); } - void OnLabelledExample(LabelledExample example) { + void OnLabelledExample(LabelledExample example, ukm::SourceId source_id) { most_recent_example_ = std::move(example); + most_recent_source_id_ = source_id; } // Since we're friends but the tests aren't. @@ -93,6 +94,7 @@ // Most recently added example via OnLabelledExample, if any. base::Optional<LabelledExample> most_recent_example_; + ukm::SourceId most_recent_source_id_; LearningTask task_; @@ -105,13 +107,16 @@ // A helper that doesn't use a FeatureProvider should forward examples as soon // as they're done. CreateClient(false); + ukm::SourceId source_id = 2; helper_->BeginObservation(id_, example_.features); EXPECT_EQ(pending_example_count(), 1u); helper_->CompleteObservation( - id_, ObservationCompletion(example_.target_value, example_.weight)); + id_, + ObservationCompletion(example_.target_value, example_.weight, source_id)); EXPECT_TRUE(most_recent_example_); EXPECT_EQ(*most_recent_example_, example_); EXPECT_EQ(most_recent_example_->weight, example_.weight); + EXPECT_EQ(most_recent_source_id_, source_id); EXPECT_EQ(pending_example_count(), 0u); }
diff --git a/media/learning/impl/learning_task_controller_impl.cc b/media/learning/impl/learning_task_controller_impl.cc index 544218a..50a8948 100644 --- a/media/learning/impl/learning_task_controller_impl.cc +++ b/media/learning/impl/learning_task_controller_impl.cc
@@ -75,7 +75,8 @@ helper_->CancelObservation(id); } -void LearningTaskControllerImpl::AddFinishedExample(LabelledExample example) { +void LearningTaskControllerImpl::AddFinishedExample(LabelledExample example, + ukm::SourceId source_id) { // Verify that we have a trainer and that we got the right number of features. // We don't compare to |task_.feature_descriptions.size()| since that has been // adjusted to the subset size already. We expect the original count. @@ -110,6 +111,7 @@ DistributionReporter::PredictionInfo info; info.observed = example.target_value; + info.source_id = source_id; info.total_training_weight = last_training_weight_; info.total_training_examples = last_training_size_; reporter_->GetPredictionCallback(info).Run(predicted); @@ -127,6 +129,10 @@ num_untrained_examples_ = 0; + // Record these for metrics. + last_training_weight_ = training_data_->total_weight(); + last_training_size_ = training_data_->size(); + TrainedModelCB model_cb = base::BindOnce(&LearningTaskControllerImpl::OnModelTrained, AsWeakPtr(), training_data_->total_weight(), training_data_->size());
diff --git a/media/learning/impl/learning_task_controller_impl.h b/media/learning/impl/learning_task_controller_impl.h index eae031b..06df120b 100644 --- a/media/learning/impl/learning_task_controller_impl.h +++ b/media/learning/impl/learning_task_controller_impl.h
@@ -54,7 +54,7 @@ private: // Add |example| to the training data, and process it. - void AddFinishedExample(LabelledExample example); + void AddFinishedExample(LabelledExample example, ukm::SourceId source_id); // Called by |training_cb_| when the model is trained. |training_weight| and // |training_size| are the training set's total weight and number of examples.
diff --git a/media/mojo/clients/mojo_decryptor_unittest.cc b/media/mojo/clients/mojo_decryptor_unittest.cc index 2a8b00b2..9e0c010 100644 --- a/media/mojo/clients/mojo_decryptor_unittest.cc +++ b/media/mojo/clients/mojo_decryptor_unittest.cc
@@ -107,8 +107,7 @@ void(Decryptor::Status status, const Decryptor::AudioFrames& frames)); MOCK_METHOD2(VideoDecoded, - void(Decryptor::Status status, - const scoped_refptr<VideoFrame>& frame)); + void(Decryptor::Status status, scoped_refptr<VideoFrame> frame)); MOCK_METHOD0(OnConnectionClosed, void()); MOCK_METHOD0(OnFrameDestroyed, void());
diff --git a/media/mojo/clients/mojo_video_encode_accelerator.cc b/media/mojo/clients/mojo_video_encode_accelerator.cc index 12962613..3ed37fc 100644 --- a/media/mojo/clients/mojo_video_encode_accelerator.cc +++ b/media/mojo/clients/mojo_video_encode_accelerator.cc
@@ -5,6 +5,7 @@ #include "media/mojo/clients/mojo_video_encode_accelerator.h" #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/logging.h" #include "gpu/ipc/client/gpu_channel_host.h" #include "media/base/video_frame.h" @@ -17,9 +18,6 @@ namespace { -// Does nothing but keeping |frame| alive. -void KeepVideoFrameAlive(const scoped_refptr<VideoFrame>& frame) {} - // File-static mojom::VideoEncodeAcceleratorClient implementation to trampoline // method calls to its |client_|. Note that this class is thread hostile when // bound. @@ -117,7 +115,7 @@ return result; } -void MojoVideoEncodeAccelerator::Encode(const scoped_refptr<VideoFrame>& frame, +void MojoVideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) { DVLOG(2) << __func__ << " tstamp=" << frame->timestamp(); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -157,8 +155,10 @@ // this gets destroyed and probably recycle its shared_memory_handle(): keep // the former alive until the remote end is actually finished. DCHECK(vea_.is_bound()); - vea_->Encode(mojo_frame, force_keyframe, - base::Bind(&KeepVideoFrameAlive, frame)); + vea_->Encode( + std::move(mojo_frame), force_keyframe, + base::BindOnce(base::DoNothing::Once<scoped_refptr<VideoFrame>>(), + std::move(frame))); } void MojoVideoEncodeAccelerator::UseOutputBitstreamBuffer(
diff --git a/media/mojo/clients/mojo_video_encode_accelerator.h b/media/mojo/clients/mojo_video_encode_accelerator.h index b30b75ae..6b62093 100644 --- a/media/mojo/clients/mojo_video_encode_accelerator.h +++ b/media/mojo/clients/mojo_video_encode_accelerator.h
@@ -35,8 +35,7 @@ // VideoEncodeAccelerator implementation. SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate_num) override;
diff --git a/media/mojo/interfaces/video_frame_struct_traits.cc b/media/mojo/interfaces/video_frame_struct_traits.cc index 6eb6dac3..e876d747 100644 --- a/media/mojo/interfaces/video_frame_struct_traits.cc +++ b/media/mojo/interfaces/video_frame_struct_traits.cc
@@ -18,15 +18,15 @@ namespace { media::mojom::VideoFrameDataPtr MakeVideoFrameData( - const scoped_refptr<media::VideoFrame>& input) { + const media::VideoFrame* input) { if (input->metadata()->IsTrue(media::VideoFrameMetadata::END_OF_STREAM)) { return media::mojom::VideoFrameData::NewEosData( media::mojom::EosVideoFrameData::New()); } if (input->storage_type() == media::VideoFrame::STORAGE_MOJO_SHARED_BUFFER) { - media::MojoSharedBufferVideoFrame* mojo_frame = - static_cast<media::MojoSharedBufferVideoFrame*>(input.get()); + const media::MojoSharedBufferVideoFrame* mojo_frame = + static_cast<const media::MojoSharedBufferVideoFrame*>(input); // TODO(https://crbug.com/803136): This should duplicate as READ_ONLY, but // can't because there is no guarantee that the input handle is sharable as @@ -66,7 +66,7 @@ media::mojom::VideoFrameDataPtr StructTraits<media::mojom::VideoFrameDataView, scoped_refptr<media::VideoFrame>>:: data(const scoped_refptr<media::VideoFrame>& input) { - return media::mojom::VideoFrameDataPtr(MakeVideoFrameData(input)); + return media::mojom::VideoFrameDataPtr(MakeVideoFrameData(input.get())); } // static
diff --git a/media/mojo/services/mojo_decryptor_service.cc b/media/mojo/services/mojo_decryptor_service.cc index a57aa3b..952fad2 100644 --- a/media/mojo/services/mojo_decryptor_service.cc +++ b/media/mojo/services/mojo_decryptor_service.cc
@@ -273,7 +273,7 @@ void MojoDecryptorService::OnVideoDecoded( DecryptAndDecodeVideoCallback callback, Status status, - const scoped_refptr<VideoFrame>& frame) { + scoped_refptr<VideoFrame> frame) { DVLOG_IF(1, status != Status::kSuccess) << __func__ << ": status = " << status; DVLOG_IF(3, status == Status::kSuccess) << __func__;
diff --git a/media/mojo/services/mojo_decryptor_service.h b/media/mojo/services/mojo_decryptor_service.h index 17e8258..8d18baf 100644 --- a/media/mojo/services/mojo_decryptor_service.h +++ b/media/mojo/services/mojo_decryptor_service.h
@@ -92,7 +92,7 @@ const media::Decryptor::AudioFrames& frames); void OnVideoDecoded(DecryptAndDecodeVideoCallback callback, Status status, - const scoped_refptr<VideoFrame>& frame); + scoped_refptr<VideoFrame> frame); // Returns audio/video buffer reader according to the |stream_type|. MojoDecoderBufferReader* GetBufferReader(StreamType stream_type) const;
diff --git a/media/renderers/paint_canvas_video_renderer.cc b/media/renderers/paint_canvas_video_renderer.cc index f9d5c083..2c3feeb1 100644 --- a/media/renderers/paint_canvas_video_renderer.cc +++ b/media/renderers/paint_canvas_video_renderer.cc
@@ -418,11 +418,11 @@ // Generates an RGB image from a VideoFrame. Convert YUV to RGB plain on GPU. class VideoImageGenerator : public cc::PaintImageGenerator { public: - VideoImageGenerator(const scoped_refptr<VideoFrame>& frame) + VideoImageGenerator(scoped_refptr<VideoFrame> frame) : cc::PaintImageGenerator( SkImageInfo::MakeN32Premul(frame->visible_rect().width(), frame->visible_rect().height())), - frame_(frame) { + frame_(std::move(frame)) { DCHECK(!frame_->HasTextures()); } ~VideoImageGenerator() override = default; @@ -580,13 +580,12 @@ ResetCache(); } -void PaintCanvasVideoRenderer::Paint( - const scoped_refptr<VideoFrame>& video_frame, - cc::PaintCanvas* canvas, - const gfx::RectF& dest_rect, - cc::PaintFlags& flags, - VideoTransformation video_transformation, - viz::ContextProvider* context_provider) { +void PaintCanvasVideoRenderer::Paint(scoped_refptr<VideoFrame> video_frame, + cc::PaintCanvas* canvas, + const gfx::RectF& dest_rect, + cc::PaintFlags& flags, + VideoTransformation video_transformation, + viz::ContextProvider* context_provider) { DCHECK(thread_checker_.CalledOnValidThread()); if (flags.getAlpha() == 0) { return; @@ -684,7 +683,8 @@ if (video_frame->HasTextures()) { // Synchronize |video_frame| with the read operations in UpdateLastImage(), // which are triggered by canvas->flush(). - SynchronizeVideoFrameRead(video_frame, context_provider->ContextGL(), + SynchronizeVideoFrameRead(std::move(video_frame), + context_provider->ContextGL(), context_provider->ContextSupport()); } // Because we are not retaining a reference to the VideoFrame, it would be @@ -693,15 +693,15 @@ DCHECK(!last_image_wraps_video_frame_texture_); } -void PaintCanvasVideoRenderer::Copy( - const scoped_refptr<VideoFrame>& video_frame, - cc::PaintCanvas* canvas, - viz::ContextProvider* context_provider) { +void PaintCanvasVideoRenderer::Copy(scoped_refptr<VideoFrame> video_frame, + cc::PaintCanvas* canvas, + viz::ContextProvider* context_provider) { cc::PaintFlags flags; flags.setBlendMode(SkBlendMode::kSrc); flags.setFilterQuality(kLow_SkFilterQuality); - Paint(video_frame, canvas, - gfx::RectF(gfx::SizeF(video_frame->visible_rect().size())), flags, + + auto dest_rect = gfx::RectF(gfx::SizeF(video_frame->visible_rect().size())); + Paint(std::move(video_frame), canvas, dest_rect, flags, media::kNoTransformation, context_provider); } @@ -1101,7 +1101,7 @@ bool PaintCanvasVideoRenderer::CopyVideoFrameTexturesToGLTexture( viz::ContextProvider* context_provider, gpu::gles2::GLES2Interface* destination_gl, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, unsigned int target, unsigned int texture, unsigned int internal_format, @@ -1172,13 +1172,13 @@ // Synchronize |video_frame| with the read operations in UpdateLastImage(), // which are triggered by getBackendTexture() or CopyTextureCHROMIUM (in the // case last_image_ was referencing its texture(s) directly). - SynchronizeVideoFrameRead(video_frame, canvas_gl, + SynchronizeVideoFrameRead(std::move(video_frame), canvas_gl, context_provider->ContextSupport()); } else { CopyVideoFrameSingleTextureToGLTexture( destination_gl, video_frame.get(), target, texture, internal_format, format, type, level, premultiply_alpha, flip_y); - SynchronizeVideoFrameRead(video_frame, destination_gl, nullptr); + SynchronizeVideoFrameRead(std::move(video_frame), destination_gl, nullptr); } DCHECK(!last_image_wraps_video_frame_texture_); @@ -1188,7 +1188,7 @@ bool PaintCanvasVideoRenderer::PrepareVideoFrameForWebGL( viz::ContextProvider* context_provider, gpu::gles2::GLES2Interface* destination_gl, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, unsigned int target, unsigned int texture) { DCHECK(thread_checker_.CalledOnValidThread()); @@ -1263,7 +1263,7 @@ bool PaintCanvasVideoRenderer::CopyVideoFrameYUVDataToGLTexture( viz::ContextProvider* context_provider, gpu::gles2::GLES2Interface* destination_gl, - const scoped_refptr<VideoFrame>& video_frame, + const VideoFrame& video_frame, unsigned int target, unsigned int texture, unsigned int internal_format, @@ -1278,17 +1278,17 @@ return false; } - if (!video_frame || !video_frame->IsMappable()) { + if (!video_frame.IsMappable()) { return false; } - if (video_frame->format() != media::PIXEL_FORMAT_I420) { + if (video_frame.format() != media::PIXEL_FORMAT_I420) { return false; } // Could handle NV12 here as well. See NewSkImageFromVideoFrameYUVTextures. static constexpr size_t kNumPlanes = 3; - DCHECK_EQ(video_frame->NumPlanes(video_frame->format()), kNumPlanes); + DCHECK_EQ(video_frame.NumPlanes(video_frame.format()), kNumPlanes); // Y,U,V GPU-side SkImages. (These must outlive the yuv_textures). sk_sp<SkImage> yuv_images[kNumPlanes]{}; // Y,U,V GPU textures from those SkImages. @@ -1296,13 +1296,13 @@ GrBackendTexture yuv_textures[kNumPlanes]{}; // Upload the whole coded image area (not visible rect). - gfx::Size y_tex_size = video_frame->coded_size(); + gfx::Size y_tex_size = video_frame.coded_size(); gfx::Size uv_tex_size((y_tex_size.width() + 1) / 2, (y_tex_size.height() + 1) / 2); for (size_t plane = 0; plane < kNumPlanes; ++plane) { - const uint8_t* data = video_frame->data(plane); - int plane_stride = video_frame->stride(plane); + const uint8_t* data = video_frame.data(plane); + int plane_stride = video_frame.stride(plane); bool is_y_plane = plane == media::VideoFrame::kYPlane; gfx::Size tex_size = is_y_plane ? y_tex_size : uv_tex_size; @@ -1328,9 +1328,8 @@ } // Decode 3 GPU-side Y,U,V SkImages into a GPU-side RGB SkImage. - sk_sp<SkImage> yuv_image = - YUVGrBackendTexturesToSkImage(gr_context, video_frame->ColorSpace(), - video_frame->format(), yuv_textures); + sk_sp<SkImage> yuv_image = YUVGrBackendTexturesToSkImage( + gr_context, video_frame.ColorSpace(), video_frame.format(), yuv_textures); if (!yuv_image) { return false; } @@ -1355,7 +1354,7 @@ destination_gl->CreateAndConsumeTextureCHROMIUM( mailbox_holder.mailbox.name); VideoFrameCopyTextureOrSubTexture( - destination_gl, video_frame->coded_size(), video_frame->visible_rect(), + destination_gl, video_frame.coded_size(), video_frame.visible_rect(), intermediate_texture, target, texture, internal_format, format, type, level, premultiply_alpha, flip_y); destination_gl->DeleteTextures(1, &intermediate_texture); @@ -1455,7 +1454,7 @@ } bool PaintCanvasVideoRenderer::UpdateLastImage( - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, viz::ContextProvider* context_provider, bool allow_wrap_texture) { DCHECK(!last_image_wraps_video_frame_texture_); @@ -1506,7 +1505,7 @@ } bool PaintCanvasVideoRenderer::PrepareVideoFrame( - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, viz::ContextProvider* context_provider, unsigned int textureTarget, unsigned int texture) {
diff --git a/media/renderers/paint_canvas_video_renderer.h b/media/renderers/paint_canvas_video_renderer.h index 3a31b531..5b483c9 100644 --- a/media/renderers/paint_canvas_video_renderer.h +++ b/media/renderers/paint_canvas_video_renderer.h
@@ -53,7 +53,7 @@ // // If |video_frame| is nullptr or an unsupported format, |dest_rect| will be // painted black. - void Paint(const scoped_refptr<VideoFrame>& video_frame, + void Paint(scoped_refptr<VideoFrame> video_frame, cc::PaintCanvas* canvas, const gfx::RectF& dest_rect, cc::PaintFlags& flags, @@ -64,7 +64,7 @@ // // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d| // and |context_support| must be provided. - void Copy(const scoped_refptr<VideoFrame>& video_frame, + void Copy(scoped_refptr<VideoFrame> video_frame, cc::PaintCanvas* canvas, viz::ContextProvider* context_provider); @@ -97,7 +97,7 @@ bool CopyVideoFrameTexturesToGLTexture( viz::ContextProvider* context_provider, gpu::gles2::GLES2Interface* destination_gl, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, unsigned int target, unsigned int texture, unsigned int internal_format, @@ -109,7 +109,7 @@ bool PrepareVideoFrameForWebGL(viz::ContextProvider* context_provider, gpu::gles2::GLES2Interface* gl, - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, unsigned int target, unsigned int texture); @@ -123,7 +123,7 @@ bool CopyVideoFrameYUVDataToGLTexture( viz::ContextProvider* context_provider, gpu::gles2::GLES2Interface* destination_gl, - const scoped_refptr<VideoFrame>& video_frame, + const VideoFrame& video_frame, unsigned int target, unsigned int texture, unsigned int internal_format, @@ -185,13 +185,13 @@ private: // Update the cache holding the most-recently-painted frame. Returns false // if the image couldn't be updated. - bool UpdateLastImage(const scoped_refptr<VideoFrame>& video_frame, + bool UpdateLastImage(scoped_refptr<VideoFrame> video_frame, viz::ContextProvider* context_provider, bool allow_wrap_texture); void CorrectLastImageDimensions(const SkIRect& visible_rect); - bool PrepareVideoFrame(const scoped_refptr<VideoFrame>& video_frame, + bool PrepareVideoFrame(scoped_refptr<VideoFrame> video_frame, viz::ContextProvider* context_provider, unsigned int textureTarget, unsigned int texture);
diff --git a/media/renderers/paint_canvas_video_renderer_unittest.cc b/media/renderers/paint_canvas_video_renderer_unittest.cc index 7a4432b..8089b0f 100644 --- a/media/renderers/paint_canvas_video_renderer_unittest.cc +++ b/media/renderers/paint_canvas_video_renderer_unittest.cc
@@ -78,18 +78,17 @@ // Paints the |video_frame| to the |canvas| using |renderer_|, setting the // color of |video_frame| to |color| first. - void Paint(const scoped_refptr<VideoFrame>& video_frame, + void Paint(scoped_refptr<VideoFrame> video_frame, cc::PaintCanvas* canvas, Color color); - void PaintRotated(const scoped_refptr<VideoFrame>& video_frame, + void PaintRotated(scoped_refptr<VideoFrame> video_frame, cc::PaintCanvas* canvas, const gfx::RectF& dest_rect, Color color, SkBlendMode mode, VideoTransformation video_transformation); - void Copy(const scoped_refptr<VideoFrame>& video_frame, - cc::PaintCanvas* canvas); + void Copy(scoped_refptr<VideoFrame> video_frame, cc::PaintCanvas* canvas); // Getters for various frame sizes. scoped_refptr<VideoFrame> natural_frame() { return natural_frame_; } @@ -230,16 +229,15 @@ nullptr); } -void PaintCanvasVideoRendererTest::Paint( - const scoped_refptr<VideoFrame>& video_frame, - cc::PaintCanvas* canvas, - Color color) { - PaintRotated(video_frame, canvas, kNaturalRect, color, SkBlendMode::kSrcOver, - kNoTransformation); +void PaintCanvasVideoRendererTest::Paint(scoped_refptr<VideoFrame> video_frame, + cc::PaintCanvas* canvas, + Color color) { + PaintRotated(std::move(video_frame), canvas, kNaturalRect, color, + SkBlendMode::kSrcOver, kNoTransformation); } void PaintCanvasVideoRendererTest::PaintRotated( - const scoped_refptr<VideoFrame>& video_frame, + scoped_refptr<VideoFrame> video_frame, cc::PaintCanvas* canvas, const gfx::RectF& dest_rect, Color color, @@ -261,14 +259,13 @@ cc::PaintFlags flags; flags.setBlendMode(mode); flags.setFilterQuality(kLow_SkFilterQuality); - renderer_.Paint(video_frame, canvas, dest_rect, flags, video_transformation, - nullptr); + renderer_.Paint(std::move(video_frame), canvas, dest_rect, flags, + video_transformation, nullptr); } -void PaintCanvasVideoRendererTest::Copy( - const scoped_refptr<VideoFrame>& video_frame, - cc::PaintCanvas* canvas) { - renderer_.Copy(video_frame, canvas, nullptr); +void PaintCanvasVideoRendererTest::Copy(scoped_refptr<VideoFrame> video_frame, + cc::PaintCanvas* canvas) { + renderer_.Copy(std::move(video_frame), canvas, nullptr); } TEST_F(PaintCanvasVideoRendererTest, NoFrame) { @@ -560,14 +557,14 @@ static_cast<unsigned char*>(base::AlignedAlloc( byte_size, media::VideoFrame::kFrameAddressAlignment))); const gfx::Rect rect(offset_x, offset_y, bitmap.width(), bitmap.height()); - scoped_refptr<media::VideoFrame> video_frame = + auto video_frame = CreateTestY16Frame(gfx::Size(stride, offset_y + bitmap.height()), rect, memory.get(), cropped_frame()->timestamp()); cc::SkiaPaintCanvas canvas(bitmap); cc::PaintFlags flags; flags.setFilterQuality(kNone_SkFilterQuality); - renderer_.Paint(video_frame, &canvas, + renderer_.Paint(std::move(video_frame), &canvas, gfx::RectF(bitmap.width(), bitmap.height()), flags, kNoTransformation, nullptr); for (int j = 0; j < bitmap.height(); j++) { @@ -709,8 +706,8 @@ cc::PaintFlags flags; flags.setFilterQuality(kLow_SkFilterQuality); - renderer_.Paint(video_frame, &canvas, kNaturalRect, flags, kNoTransformation, - context_provider.get()); + renderer_.Paint(std::move(video_frame), &canvas, kNaturalRect, flags, + kNoTransformation, context_provider.get()); } void EmptyCallback(const gpu::SyncToken& sync_token) {} @@ -734,8 +731,8 @@ gfx::RectF visible_rect(visible_size.width(), visible_size.height()); cc::PaintFlags flags; - renderer_.Paint(video_frame, &canvas, visible_rect, flags, kNoTransformation, - nullptr); + renderer_.Paint(std::move(video_frame), &canvas, visible_rect, flags, + kNoTransformation, nullptr); EXPECT_EQ(fWidth / 2, renderer_.LastImageDimensionsForTesting().width()); EXPECT_EQ(fWidth / 2, renderer_.LastImageDimensionsForTesting().height()); @@ -754,7 +751,7 @@ static_cast<unsigned char*>(base::AlignedAlloc( byte_size, media::VideoFrame::kFrameAddressAlignment))); const gfx::Rect rect(offset_x, offset_y, width, height); - scoped_refptr<media::VideoFrame> video_frame = + auto video_frame = CreateTestY16Frame(gfx::Size(stride, offset_y + height), rect, memory.get(), cropped_frame()->timestamp()); @@ -802,7 +799,7 @@ static_cast<unsigned char*>(base::AlignedAlloc( byte_size, media::VideoFrame::kFrameAddressAlignment))); const gfx::Rect rect(offset_x, offset_y, width, height); - scoped_refptr<media::VideoFrame> video_frame = + auto video_frame = CreateTestY16Frame(gfx::Size(stride, offset_y + height), rect, memory.get(), cropped_frame()->timestamp());
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc index e5ccc57..f39028b 100644 --- a/media/renderers/video_renderer_impl_unittest.cc +++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -459,7 +459,7 @@ // Use StrictMock<T> to catch missing/extra callbacks. class MockCB : public MockRendererClient { public: - MOCK_METHOD1(FrameReceived, void(const scoped_refptr<VideoFrame>&)); + MOCK_METHOD1(FrameReceived, void(scoped_refptr<VideoFrame>)); }; StrictMock<MockCB> mock_cb_;
diff --git a/media/renderers/video_resource_updater.cc b/media/renderers/video_resource_updater.cc index 2fd4954..7b14b5e 100644 --- a/media/renderers/video_resource_updater.cc +++ b/media/renderers/video_resource_updater.cc
@@ -1205,10 +1205,9 @@ return external_resources; } -void VideoResourceUpdater::ReturnTexture( - const scoped_refptr<VideoFrame>& video_frame, - const gpu::SyncToken& sync_token, - bool lost_resource) { +void VideoResourceUpdater::ReturnTexture(scoped_refptr<VideoFrame> video_frame, + const gpu::SyncToken& sync_token, + bool lost_resource) { // TODO(dshwang): Forward to the decoder as a lost resource. if (lost_resource) return;
diff --git a/media/renderers/video_resource_updater.h b/media/renderers/video_resource_updater.h index 783780c..9069190 100644 --- a/media/renderers/video_resource_updater.h +++ b/media/renderers/video_resource_updater.h
@@ -185,7 +185,7 @@ void RecycleResource(uint32_t plane_resource_id, const gpu::SyncToken& sync_token, bool lost_resource); - void ReturnTexture(const scoped_refptr<VideoFrame>& video_frame, + void ReturnTexture(scoped_refptr<VideoFrame> video_frame, const gpu::SyncToken& sync_token, bool lost_resource);
diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc index 90f4ac1..232ba63 100644 --- a/media/test/pipeline_integration_test_base.cc +++ b/media/test/pipeline_integration_test_base.cc
@@ -537,14 +537,14 @@ } void PipelineIntegrationTestBase::OnVideoFramePaint( - const scoped_refptr<VideoFrame>& frame) { + scoped_refptr<VideoFrame> frame) { last_video_frame_format_ = frame->format(); last_video_frame_color_space_ = frame->ColorSpace(); if (!hashing_enabled_ || last_frame_ == frame) return; - last_frame_ = frame; DVLOG(3) << __func__ << " pts=" << frame->timestamp().InSecondsF(); - VideoFrame::HashFrameForTesting(&md5_context_, *frame.get()); + VideoFrame::HashFrameForTesting(&md5_context_, *frame); + last_frame_ = std::move(frame); } void PipelineIntegrationTestBase::CheckDuration() {
diff --git a/media/test/pipeline_integration_test_base.h b/media/test/pipeline_integration_test_base.h index 5a518b4..b5beb72 100644 --- a/media/test/pipeline_integration_test_base.h +++ b/media/test/pipeline_integration_test_base.h
@@ -218,7 +218,7 @@ // Creates Demuxer and sets |demuxer_|. void CreateDemuxer(std::unique_ptr<DataSource> data_source); - void OnVideoFramePaint(const scoped_refptr<VideoFrame>& frame); + void OnVideoFramePaint(scoped_refptr<VideoFrame> frame); void CheckDuration();
diff --git a/media/video/fake_video_encode_accelerator.cc b/media/video/fake_video_encode_accelerator.cc index 1646d2c0..2a551e34 100644 --- a/media/video/fake_video_encode_accelerator.cc +++ b/media/video/fake_video_encode_accelerator.cc
@@ -58,9 +58,8 @@ return true; } -void FakeVideoEncodeAccelerator::Encode( - const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) { +void FakeVideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, + bool force_keyframe) { DCHECK(client_); queued_frames_.push(force_keyframe); EncodeTask();
diff --git a/media/video/fake_video_encode_accelerator.h b/media/video/fake_video_encode_accelerator.h index 92ff731..f9fd28e 100644 --- a/media/video/fake_video_encode_accelerator.h +++ b/media/video/fake_video_encode_accelerator.h
@@ -35,8 +35,7 @@ VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; - void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override;
diff --git a/media/video/mock_video_encode_accelerator.h b/media/video/mock_video_encode_accelerator.h index 35e93e63..bc72c16 100644 --- a/media/video/mock_video_encode_accelerator.h +++ b/media/video/mock_video_encode_accelerator.h
@@ -23,8 +23,7 @@ bool(const VideoEncodeAccelerator::Config& config, VideoEncodeAccelerator::Client* client)); MOCK_METHOD2(Encode, - void(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe)); + void(scoped_refptr<VideoFrame> frame, bool force_keyframe)); MOCK_METHOD1(UseOutputBitstreamBuffer, void(BitstreamBuffer buffer)); MOCK_METHOD2(RequestEncodingParametersChange, void(uint32_t bitrate, uint32_t framerate));
diff --git a/media/video/video_encode_accelerator.h b/media/video/video_encode_accelerator.h index 969536b..90ca6a1 100644 --- a/media/video/video_encode_accelerator.h +++ b/media/video/video_encode_accelerator.h
@@ -243,8 +243,7 @@ // Parameters: // |frame| is the VideoFrame that is to be encoded. // |force_keyframe| forces the encoding of a keyframe for this frame. - virtual void Encode(const scoped_refptr<VideoFrame>& frame, - bool force_keyframe) = 0; + virtual void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) = 0; // Send a bitstream buffer to the encoder to be used for storing future // encoded output. Each call here with a given |buffer| will cause the buffer
diff --git a/net/docs/proxy.md b/net/docs/proxy.md index 66c157a..71a36eb 100644 --- a/net/docs/proxy.md +++ b/net/docs/proxy.md
@@ -160,7 +160,7 @@ will not give feedback that the bad proxies were cleared, however capturing a new NetLog dump can confirm it was cleared. -## Arguments are passed to `FindProxyForURL(url, host)` in PAC scripts +## Arguments passed to `FindProxyForURL(url, host)` in PAC scripts PAC scripts in Chrome are expected to define a JavaScript function `FindProxyForURL`.
diff --git a/services/viz/privileged/interfaces/compositing/BUILD.gn b/services/viz/privileged/interfaces/compositing/BUILD.gn index 2a43c3c..0ac5848 100644 --- a/services/viz/privileged/interfaces/compositing/BUILD.gn +++ b/services/viz/privileged/interfaces/compositing/BUILD.gn
@@ -33,4 +33,7 @@ if (use_ozone) { enabled_features += [ "use_ozone" ] } + if (use_x11) { + enabled_features += [ "use_x11" ] + } }
diff --git a/services/viz/privileged/interfaces/compositing/display_private.mojom b/services/viz/privileged/interfaces/compositing/display_private.mojom index 77789a5e77..deb327b 100644 --- a/services/viz/privileged/interfaces/compositing/display_private.mojom +++ b/services/viz/privileged/interfaces/compositing/display_private.mojom
@@ -90,6 +90,10 @@ [EnableIf=is_android] DidCompleteSwapWithSize(gfx.mojom.Size size); + // Notifies that a swap has occurred with a new size. + [EnableIf=use_x11] + DidCompleteSwapWithNewSize(gfx.mojom.Size size); + // Notifies that context creation failed. On Android we can't fall back to // SW in these cases, so we need to handle this specifically. [EnableIf=is_android]
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 327cb85..5d45513 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -18209,7 +18209,6 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "device_os_type": "userdebug", "os": "Ubuntu-14.04" } ]
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py index 7ec51f7..987f2ab4 100755 --- a/testing/buildbot/generate_buildbot_json.py +++ b/testing/buildbot/generate_buildbot_json.py
@@ -444,7 +444,7 @@ # build type was not specified. if 'swarming' in test and self.is_android(tester_config): for d in test['swarming'].get('dimension_sets', []): - if not d.get('device_os_type'): + if d.get('os') == 'Android' and not d.get('device_os_type'): d['device_os_type'] = 'userdebug' return test
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py index 99a7df7..a148b2e 100755 --- a/testing/buildbot/generate_buildbot_json_unittest.py +++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -441,6 +441,7 @@ { 'device_os': 'KTU84P', 'device_type': 'hammerhead', + 'os': 'Android', }, ], }, @@ -457,6 +458,7 @@ 'device_os': 'LMY41U', 'device_os_type': 'user', 'device_type': 'hammerhead', + 'os': 'Android', }, ], }, @@ -473,6 +475,7 @@ { 'device_os': 'MMB29Q', 'device_type': 'bullhead', + 'os': 'Android', }, ], }, @@ -1490,7 +1493,8 @@ "device_os": "KTU84P", "device_os_type": "userdebug", "device_type": "hammerhead", - "integrity": "high" + "integrity": "high", + "os": "Android" } ], "expiration": 120, @@ -1535,7 +1539,8 @@ "device_os": "LMY41U", "device_os_type": "user", "device_type": "hammerhead", - "integrity": "high" + "integrity": "high", + "os": "Android" } ], "expiration": 120 @@ -3250,7 +3255,8 @@ { "device_os": "LMY41U", "device_os_type": "user", - "device_type": "hammerhead" + "device_type": "hammerhead", + 'os': 'Android' } ], "can_use_on_swarming_builders": True @@ -3284,7 +3290,8 @@ { "device_os": "KTU84P", "device_os_type": "userdebug", - "device_type": "hammerhead" + "device_type": "hammerhead", + "os": "Android", } ], "can_use_on_swarming_builders": True, @@ -3340,7 +3347,8 @@ { "device_os": "LMY41U", "device_os_type": "user", - "device_type": "hammerhead" + "device_type": "hammerhead", + "os": "Android" } ], "can_use_on_swarming_builders": True @@ -3371,7 +3379,8 @@ { "device_os": "KTU84P", "device_os_type": "userdebug", - "device_type": "hammerhead" + "device_type": "hammerhead", + "os": "Android" } ], "can_use_on_swarming_builders": True, @@ -3414,8 +3423,9 @@ "dimension_sets": [ { "device_os": "KTU84P", - "device_os_type": "userdebug", - "device_type": "hammerhead" + "device_os_type": "userdebug", + "device_type": "hammerhead", + "os": "Android" } ], "can_use_on_swarming_builders": True, @@ -3455,7 +3465,8 @@ { "device_os": "LMY41U", "device_os_type": "user", - "device_type": "hammerhead" + "device_type": "hammerhead", + "os": "Android" } ], "can_use_on_swarming_builders": True
diff --git a/third_party/blink/public/mojom/background_sync/background_sync.mojom b/third_party/blink/public/mojom/background_sync/background_sync.mojom index 47cab22..3ba75ec15 100644 --- a/third_party/blink/public/mojom/background_sync/background_sync.mojom +++ b/third_party/blink/public/mojom/background_sync/background_sync.mojom
@@ -54,6 +54,6 @@ Register(SyncRegistrationOptions options, int64 service_worker_registration_id) => (BackgroundSyncError err, SyncRegistrationOptions options); DidResolveRegistration(BackgroundSyncRegistrationInfo registration_info); - GetRegistrations(int64 service_worker_registration_id) + GetOneShotSyncRegistrations(int64 service_worker_registration_id) => (BackgroundSyncError err, array<SyncRegistrationOptions> registrations); };
diff --git a/third_party/blink/public/mojom/credentialmanager/credential_manager.mojom b/third_party/blink/public/mojom/credentialmanager/credential_manager.mojom index b4963ea..f90ef44d 100644 --- a/third_party/blink/public/mojom/credentialmanager/credential_manager.mojom +++ b/third_party/blink/public/mojom/credentialmanager/credential_manager.mojom
@@ -27,7 +27,6 @@ NOT_ALLOWED, INVALID_DOMAIN, CREDENTIAL_EXCLUDED, - CREDENTIAL_NOT_RECOGNIZED, NOT_IMPLEMENTED, NOT_FOCUSED, RESIDENT_CREDENTIALS_UNSUPPORTED,
diff --git a/third_party/blink/public/mojom/webauthn/authenticator.mojom b/third_party/blink/public/mojom/webauthn/authenticator.mojom index 9cc5438..00ad52ff 100644 --- a/third_party/blink/public/mojom/webauthn/authenticator.mojom +++ b/third_party/blink/public/mojom/webauthn/authenticator.mojom
@@ -18,7 +18,6 @@ NOT_ALLOWED_ERROR, INVALID_DOMAIN, CREDENTIAL_EXCLUDED, - CREDENTIAL_NOT_RECOGNIZED, NOT_IMPLEMENTED, NOT_FOCUSED, RESIDENT_CREDENTIALS_UNSUPPORTED,
diff --git a/third_party/blink/public/platform/TaskTypes.md b/third_party/blink/public/platform/TaskTypes.md new file mode 100644 index 0000000..0df80cc --- /dev/null +++ b/third_party/blink/public/platform/TaskTypes.md
@@ -0,0 +1,68 @@ +# Task Queues + +Blink uses a series of task queues. + +All specified (in W3C, HTML, DOM, etc) task queues are pausable. Some internal task queues are not. + +| Task Queue | Pausable | Throttlable | Frozen | Deferred | +| -------------------- | -------- | ----------- | ------------ | -------- | +| DOM Manipulation | Yes | Yes | Android Only | Yes | +| User Interaction | Yes | Yes | Android Only | No | +| Networking | Yes | No | Yes | Yes | +| Networking (URL Ldr) | Yes | No | Yes | Yes | +| Networking (Ctrl) | Yes | No | Yes | Yes | +| History Traversal | Yes | Yes | Android Only | Yes | +| Embed | Yes | Yes | Android Only | Yes | +| Media Element | Yes | Yes | Android Only | No | +| Canvas Block Serial. | Yes | Yes | Android Only | Yes | +| Microtask | Yes | Yes | Android Only | Yes | +| Javascript Timer | Yes | Yes | Yes | Yes | +| Remote Event | Yes | Yes | Android Only | Yes | +| Web Socket | Yes | Yes | Android Only | Yes | +| Posted Message | Yes | Yes | Android Only | No | +| Unshipped Port Msg. | Yes | Yes | Android Only | Yes | +| File Reading | Yes | Yes | Android Only | Yes | +| Database Access | Yes | Yes | Android Only | No | +| Presentation | Yes | Yes | Android Only | Yes | +| Sensor | Yes | Yes | Android Only | Yes | +| Performance Timeline | Yes | Yes | Android Only | Yes | +| WebGL | Yes | Yes | Android Only | Yes | +| Idle Task | Yes | Yes | Android Only | Yes | +| Misc Platform API | Yes | Yes | Android Only | Yes | +| Worker Animation | Yes | Yes | Android Only | No | +| Web Schdlr User Int. | Yes | Yes | Yes | No | +| Web Schdlr Best Eff. | Yes | Yes | Yes | Yes | +| Font Loading | Yes | Yes | Android Only | Yes | +| Application Lifecycle| Yes | Yes | Android Only | Yes | +| Background Fetch | Yes | Yes | Android Only | Yes | +| Permission | Yes | Yes | Android Only | Yes | +| Service Worklet CMsg | Yes | Yes | Android Only | No | +| Internal Default | No | No | No | No | +| Internal Loading | No | No | No | No | +| Internal Test | No | No | No | No | +| Internal Web Crypto | Yes | Yes | Android Only | No | +| Internal Media | Yes | Yes | Android Only | No | +| Internal Media Rt. | Yes | Yes | Android Only | No | +| Internal IPC | No | No | No | No | +| Internal User Inter. | Yes | Yes | Android Only | No | +| Internal Inspector | No | No | No | No | +| Internal Worker | No | No | No | No | +| Internal Translation | No | No | No | No | +| Internal Intersec Obs| Yes | Yes | Android Only | No | +| Internal Content Cpt | Yes | Yes | Yes | Yes | +| Internal Nav | No | No | No | No | +| Main Thread V8 | No | No | No | No | +| Main Thread Composit.| No | No | No | No | +| Main Thread Default | No | No | No | No | +| Main Thread Input | No | No | No | No | +| Main Thread Idle | No | No | No | No | +| Main Thread Control | No | No | No | No | +| Main Thread Cleanup | No | No | No | No | +| Main Thread Mem Purge| No | No | No | No | +| Compositor Default | No | No | No | No | +| Compositor Input | No | No | No | No | +| Worker Default | No | No | No | No | +| Worker V8 | No | No | No | No | +| Worker Compositor | No | No | No | No | + +Internal Translation queue supports concept of it running only in the foreground. It is paused if page that owns it goes in background.
diff --git a/third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h b/third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h index 7b46d78..d05e3fd30d 100644 --- a/third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h +++ b/third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h
@@ -90,18 +90,18 @@ bool goog_experimental_auto_gain_control = true; }; -// Enables the echo cancellation in |audio_processing|. +// Enables the echo cancellation. BLINK_PLATFORM_EXPORT void EnableEchoCancellation( - AudioProcessing* audio_processing); + AudioProcessing::Config* apm_config); -// Enables the noise suppression in |audio_processing|. +// Enables the noise suppression with the given level. BLINK_PLATFORM_EXPORT void EnableNoiseSuppression( - AudioProcessing* audio_processing, - webrtc::NoiseSuppression::Level ns_level); + AudioProcessing::Config* apm_config, + AudioProcessing::Config::NoiseSuppression::Level ns_level); -// Enables the typing detection in |audio_processing|. +// Enables the typing detection with the given detector. BLINK_PLATFORM_EXPORT void EnableTypingDetection( - AudioProcessing* audio_processing, + AudioProcessing::Config* apm_config, webrtc::TypingDetection* typing_detector); // Starts the echo cancellation dump in @@ -127,7 +127,7 @@ // Enables automatic gain control with flags and optional configures. BLINK_PLATFORM_EXPORT void ConfigAutomaticGainControl( - webrtc::AudioProcessing::Config* apm_config, + AudioProcessing::Config* apm_config, bool agc_enabled, bool experimental_agc_enabled, bool use_hybrid_agc, @@ -137,7 +137,7 @@ // Enables pre-amplifier with given gain factor if the optional |factor| is set. BLINK_PLATFORM_EXPORT void ConfigPreAmplifier( - webrtc::AudioProcessing::Config* apm_config, + AudioProcessing::Config* apm_config, base::Optional<double> fixed_gain_factor); } // namespace blink
diff --git a/third_party/blink/public/platform/task_type.h b/third_party/blink/public/platform/task_type.h index 5b481f3f..fbffd11 100644 --- a/third_party/blink/public/platform/task_type.h +++ b/third_party/blink/public/platform/task_type.h
@@ -12,8 +12,10 @@ // // For the task type usage guideline, see https://bit.ly/2vMAsQ4 // -// When a new task type is created, use kCount value as a new value, -// the tools/metrics/histograms/enums.xml shall also be updated. +// When a new task type is created: +// * use kCount value as a new value, +// * update tools/metrics/histograms/enums.xml, +// * update TaskTypes.md enum class TaskType : unsigned char { /////////////////////////////////////// // Speced tasks should use one of the following task types
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h index 870c292..a1b8fb1 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -607,9 +607,6 @@ // made. virtual void WillSendRequest(WebURLRequest&) {} - // Response headers have been received. - virtual void DidReceiveResponse(const WebURLResponse&) {} - // The specified request was satified from WebCore's memory cache. virtual void DidLoadResourceFromMemoryCache(const WebURLRequest&, const WebURLResponse&) {}
diff --git a/third_party/blink/public/web/web_view_client.h b/third_party/blink/public/web/web_view_client.h index cb8f2c2..3bfbc776 100644 --- a/third_party/blink/public/web/web_view_client.h +++ b/third_party/blink/public/web/web_view_client.h
@@ -183,8 +183,7 @@ // Informs the browser that the page scale has changed and/or a pinch gesture // has started or ended. - virtual void PageScaleFactorChanged(float page_scale_factor, - bool is_pinch_gesture_active) {} + virtual void PageScaleFactorChanged(float page_scale_factor) {} // Gestures -------------------------------------------------------------
diff --git a/third_party/blink/public/web/web_widget_client.h b/third_party/blink/public/web/web_widget_client.h index b9f3e2f..552bbc9a 100644 --- a/third_party/blink/public/web/web_widget_client.h +++ b/third_party/blink/public/web/web_widget_client.h
@@ -259,9 +259,10 @@ // Sets the current page scale factor and minimum / maximum limits. Both // limits are initially 1 (no page scale allowed). - virtual void SetPageScaleFactorAndLimits(float page_scale_factor, - float minimum, - float maximum) {} + virtual void SetPageScaleStateAndLimits(float page_scale_factor, + bool is_pinch_gesture_active, + float minimum, + float maximum) {} // Starts an animation of the page scale to a target scale factor and scroll // offset.
diff --git a/third_party/blink/renderer/bindings/core/v8/dom_wrapper_world_test.cc b/third_party/blink/renderer/bindings/core/v8/dom_wrapper_world_test.cc index 129882af..de317702 100644 --- a/third_party/blink/renderer/bindings/core/v8/dom_wrapper_world_test.cc +++ b/third_party/blink/renderer/bindings/core/v8/dom_wrapper_world_test.cc
@@ -79,7 +79,7 @@ thread->ShutdownOnBackingThread(); PostCrossThreadTask(*main_thread_task_runner, FROM_HERE, - CrossThreadBind(&test::ExitRunLoop)); + CrossThreadBindOnce(&test::ExitRunLoop)); } TEST(DOMWrapperWorldTest, Basic) {
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc index b0bfc8a..28f8395 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
@@ -102,7 +102,7 @@ memcpy(copy_for_resource.get(), buffer, num_bytes); PostCrossThreadTask( *loading_task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( NotifyClientDidReceiveData, response_body_loader_client_, WTF::Passed(std::move(copy_for_resource)), num_bytes)); @@ -233,7 +233,7 @@ CHECK(!finished_); PostCrossThreadTask( *loading_task_runner_, FROM_HERE, - CrossThreadBind(callback, response_body_loader_client_)); + CrossThreadBindOnce(callback, response_body_loader_client_)); finished_ = true; } @@ -297,8 +297,8 @@ // notifyFinished might already be called, or it might be called in the // future (if the parsing finishes earlier because of a parse error). PostCrossThreadTask(*loading_task_runner_, FROM_HERE, - CrossThreadBind(&ScriptStreamer::StreamingComplete, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&ScriptStreamer::StreamingComplete, + WrapCrossThreadPersistent(this))); // The task might be the only remaining reference to the ScriptStreamer, and // there's no way to guarantee that this function has returned before the task
diff --git a/third_party/blink/renderer/core/animation/README.md b/third_party/blink/renderer/core/animation/README.md index 52b8e83b..25af3901 100644 --- a/third_party/blink/renderer/core/animation/README.md +++ b/third_party/blink/renderer/core/animation/README.md
@@ -208,6 +208,8 @@ ### Lifecycle of an Animation +![Lifecycle] + 1. An [Animation][] is created via CSS<sup>1</sup> or `element.animate()`. 2. At the start of the next frame the [Animation][] and its [AnimationEffect][] are updated with the currentTime of the [DocumentTimeline][]. @@ -232,6 +234,7 @@ resolution can cause style to get dirtied, this is currently a [code health bug](http://crbug.com/492887). +[Lifecycle]: images/lifecycle.png [SampledEffect]: https://cs.chromium.org/search/?q=class:blink::SampledEffect ### [KeyframeEffect][]
diff --git a/third_party/blink/renderer/core/animation/compositor_animations.cc b/third_party/blink/renderer/core/animation/compositor_animations.cc index eed891d5..8009b13 100644 --- a/third_party/blink/renderer/core/animation/compositor_animations.cc +++ b/third_party/blink/renderer/core/animation/compositor_animations.cc
@@ -347,6 +347,10 @@ // DCHECK(document().lifecycle().state() >= // DocumentLifecycle::PrePaintClean); DCHECK(layout_object); + + if (!layout_object->UniqueId()) + reasons |= kTargetHasInvalidCompositingState; + if (const auto* paint_properties = layout_object->FirstFragment().PaintProperties()) { const TransformPaintPropertyNode* transform_node =
diff --git a/third_party/blink/renderer/core/animation/images/lifecycle.png b/third_party/blink/renderer/core/animation/images/lifecycle.png new file mode 100644 index 0000000..72fdade2 --- /dev/null +++ b/third_party/blink/renderer/core/animation/images/lifecycle.png Binary files differ
diff --git a/third_party/blink/renderer/core/animation/images/lifecycle.png.dot b/third_party/blink/renderer/core/animation/images/lifecycle.png.dot new file mode 100644 index 0000000..133d0f83 --- /dev/null +++ b/third_party/blink/renderer/core/animation/images/lifecycle.png.dot
@@ -0,0 +1,51 @@ +// dot -Tpng third_party/blink/renderer/core/animation/images/lifecycle.png.dot > third_party/blink/renderer/core/animation/images/lifecycle.png +// When making modifications run the above command to regenerate the diagram. + +digraph G { + subgraph cluster_start { + label = "Create the animation"; + + TimelinePlay [ label = "DocumentTimeline::Play"; ] + AnimationPlay [ label = "Animation::play"; ] + SetOutdatedAnimation [ label="DocumentTimeline::SetOutdatedAnimation"; ] + ServiceOnNextFrame [ label="DocumentTimeline::ServiceOnNextFrame"; ] + + TimelinePlay -> AnimationPlay -> SetOutdatedAnimation -> ServiceOnNextFrame; + } + + subgraph cluster_chrome { + label = "Schedule an update"; + ScheduleAnimation [ label="LocalFrameView::ScheduleAnimation"; ] + SetNeedsBeginFrame [ label="LayerTreeView::SetNeedsBeginFrame"; ] + SetNeedsAnimate [ label="LayerTreeHost::SetNeedsAnimate"; ] + } + + ServiceOnNextFrame -> ScheduleAnimation -> SetNeedsBeginFrame -> SetNeedsAnimate; + + subgraph cluster_run { + label = "Update animations"; + LayerTreeHostBMF [ label="LayerTreeHost::BeginMainFrame"; ] + BeginFrame [ label="WebViewImpl::BeginFrame"; ] + Animate [ label="PageWidgetDelegate::Animate"; ] + ServiceScriptedAnimations [ label="PageAnimator::ServiceScriptedAnimations"; ] + + LayerTreeHostBMF -> BeginFrame -> Animate -> ServiceScriptedAnimations; + ServiceScriptedAnimations -> ScheduleAnimation; + } + SetNeedsAnimate -> LayerTreeHostBMF [ style="dashed"; ] + + subgraph cluster_apply { + label = "Apply an animation"; + UpdateAnimationTiming [ label="DocumentAnimations::UpdateAnimationTiming"; ] + Update [ label="Animation::Update"; ] + ApplyEffects [ label="KeyframeEffect::ApplyEffects"; ] + SetNeedsAnimationStyleRecalc [ label="Element::SetNeedsAnimationStyleRecalc"; ] + UpdateAnimationTiming -> Update + Update -> ApplyEffects -> SetNeedsAnimationStyleRecalc; + } + + ServiceScriptedAnimations -> UpdateAnimationTiming; + + ExecuteCallbacks [ label="FrameRequestCallbackCollection::ExecuteCallbacks"; ] + ServiceScriptedAnimations -> ExecuteCallbacks; +}
diff --git a/third_party/blink/renderer/core/css/invalidation/invalidation_set_test.cc b/third_party/blink/renderer/core/css/invalidation/invalidation_set_test.cc index 3d71430..de9261c 100644 --- a/third_party/blink/renderer/core/css/invalidation/invalidation_set_test.cc +++ b/third_party/blink/renderer/core/css/invalidation/invalidation_set_test.cc
@@ -54,6 +54,7 @@ ASSERT_FALSE(backing.IsHashSet(flags)); backing.Add(flags, AtomicString("test2")); ASSERT_TRUE(backing.IsHashSet(flags)); + backing.Clear(flags); } TEST(InvalidationSetTest, Backing_AddSame) { @@ -66,6 +67,7 @@ backing.Add(flags, AtomicString("test1")); // No need to upgrade to HashSet if we're adding the item we already have. ASSERT_FALSE(backing.IsHashSet(flags)); + backing.Clear(flags); } TEST(InvalidationSetTest, Backing_Independence) { @@ -131,6 +133,7 @@ ASSERT_TRUE(tag_names.IsHashSet(flags)); ASSERT_TRUE(HasAll(tag_names, flags, {"test3", "test6"})); ASSERT_FALSE(HasAny(tag_names, flags, {"test1", "test2", "test4", "test5"})); + tag_names.Clear(flags); } TEST(InvalidationSetTest, Backing_ClearContains) { @@ -214,6 +217,7 @@ strings.push_back(str); ASSERT_EQ(1u, strings.size()); ASSERT_TRUE(strings.Contains("test1")); + backing.Clear(flags); } // Iterate over set with multiple items. @@ -231,6 +235,7 @@ ASSERT_TRUE(strings.Contains("test1")); ASSERT_TRUE(strings.Contains("test2")); ASSERT_TRUE(strings.Contains("test3")); + backing.Clear(flags); } } @@ -242,6 +247,7 @@ EXPECT_EQ("a", AtomicString(backing.GetStringImpl(flags))); backing.Add(flags, "b"); EXPECT_FALSE(backing.GetStringImpl(flags)); + backing.Clear(flags); } TEST(InvalidationSetTest, Backing_GetHashSet) { @@ -252,6 +258,7 @@ EXPECT_FALSE(backing.GetHashSet(flags)); backing.Add(flags, "b"); EXPECT_TRUE(backing.GetHashSet(flags)); + backing.Clear(flags); } TEST(InvalidationSetTest, ClassInvalidatesElement) {
diff --git a/third_party/blink/renderer/core/css/threaded/multi_threaded_test_util.h b/third_party/blink/renderer/core/css/threaded/multi_threaded_test_util.h index 8c96f414..9f78845 100644 --- a/third_party/blink/renderer/core/css/threaded/multi_threaded_test_util.h +++ b/third_party/blink/renderer/core/css/threaded/multi_threaded_test_util.h
@@ -68,7 +68,7 @@ threads[i]->PlatformThread().GetTaskRunner().get(); PostCrossThreadTask(*task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](WebThreadSupportingGC* thread) { thread->InitializeOnThread(); }, @@ -76,12 +76,12 @@ for (int j = 0; j < callbacks_per_thread_; ++j) { PostCrossThreadTask(*task_runner, FROM_HERE, - CrossThreadBind(function, parameters...)); + CrossThreadBindOnce(function, parameters...)); } PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](WebThreadSupportingGC* thread, base::WaitableEvent* w) { thread->ShutdownOnThread(); w->Signal();
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index e7adb9c..96621159 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -6817,9 +6817,10 @@ if (!IsContextThread()) { PostCrossThreadTask( *GetTaskRunner(TaskType::kInternalInspector), FROM_HERE, - CrossThreadBind(&RunAddConsoleMessageTask, console_message->Source(), - console_message->Level(), console_message->Message(), - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&RunAddConsoleMessageTask, + console_message->Source(), console_message->Level(), + console_message->Message(), + WrapCrossThreadPersistent(this))); return; }
diff --git a/third_party/blink/renderer/core/execution_context/PausingAndFreezing.md b/third_party/blink/renderer/core/execution_context/PausingAndFreezing.md new file mode 100644 index 0000000..b9ebc9c9 --- /dev/null +++ b/third_party/blink/renderer/core/execution_context/PausingAndFreezing.md
@@ -0,0 +1,68 @@ +# Pausing and Freezing + +There are two main mechanisms to halt execution flow in a frame: + +* Pausing +* Freezing + +Pausing is generally only used for nested event loops (ie. synchronous print). All other types of halting should use freezing. + +# Execution Context States + +There are 4 lifecycle states [defined](https://cs.chromium.org/chromium/src/third_party/blink/public/mojom/frame/lifecycle.mojom): + +* kRunning - actively running context +* kPaused - Paused state. Does not fire frozen or resumed events on the document. +* kFrozen - Frozen state, pause all media. +* kFrozenAutoResumeMedia - Frozen state, resume media when resuming. + +## kPaused +* Used for synchronous mechanisms for a single thread, eg. window.print, V8 inspector debugging. +* Fires [ContextLifecycleStateObserver][ContextLifecycleStateObserver] changed for kPaused. +* Some [ContextLifecycleStateObserver][ContextLifecycleStateObserver] may drop mojo connections. +* Not visible to page in terms of state transitions. +* Does *not* [freeze](https://wicg.github.io/page-lifecycle/spec.html#freeze-steps) or [resume](https://wicg.github.io/page-lifecycle/spec.html#resume-steps) the document. +* Pauses execution of [pausable task queues][TaskQueues] in MainThreadScheduler. + +## kFrozen +* Used iframe feature policies, Resource Coordinator background policies. (Should be used for bfcache in the future) +* Fires [ContextLifecycleStateObserver][ContextLifecycleStateObserver] change for kFrozen. +* Executes [freeze](https://wicg.github.io/page-lifecycle/spec.html#freeze-steps) and [resume](https://wicg.github.io/page-lifecycle/spec.html#resume-steps) algorithms. +* [Dedicated workers][DedicatedWorker] freeze via a [ContextLifecycleStateObserver][ContextLifecycleStateObserver] callback. +* Freezes execution of [frozen task queues][TaskQueues] in MainThreadScheduler. +* Pauses execution of [pausable task queues][TaskQueues] in MainThreadScheduler. (This is a proposed feature, with it we would remove the definition of frozen +task queues in the scheduler). + +# Freezing IPCs + +Top level documents are frozen via [PageMsg_SetPageFrozen](https://cs.chromium.org/search/?q=PageMsg_SetPageFrozen&sq=package:chromium&type=cs) message. This +will freeze and entire frame tree. + +Individual frames may be frozen via [SetLifecycleState](https://cs.chromium.org/chromium/src/content/common/frame.mojom?g=0) freezing only an individual frame. +Subframes will need to be frozen independently with a separate IPC. + +Frame freezing can also be initiated by the [Page Scheduler][#Page Scheduler] under certain conditions. + +# Page Scheduler + +The [Page Scheduler][PageScheduler] also generates frozen state transitions. + +Note: These state transitions do not work correctly for OOPIFs because the information is not propagated to the entire frame tree. + +It is desirable to move all of these transitions to the browser side. + + +# Freezing Workers + +In order to freeze a worker/worklet an implementation will pauses execution of all [pausable task queues][# Task Queues] and tne enters a +nested event loop. Only the none pausable tasks will execute in the nested event loop. Explicitly the Internal Worker task queue will +be used to resume the worker. + +To freeze workers the Workers themselves are [ContextLifecycleStateObservers][ContextLifecycleStateObserver] and they listen to +the kFrozen/kResume state of the owning execution context and then propagate that to their own execution context. + + +[ContextLifecycleStateObserver]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/execution_context/context_lifecycle_state_observer.h +[DedicatedWorker]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/workers/dedicated_worker.h +[PageScheduler]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.h +[TaskQueues]: https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/public/platform/TaskTypes.md
diff --git a/third_party/blink/renderer/core/execution_context/README.md b/third_party/blink/renderer/core/execution_context/README.md index a94292d4..1ac7c1c 100644 --- a/third_party/blink/renderer/core/execution_context/README.md +++ b/third_party/blink/renderer/core/execution_context/README.md
@@ -11,6 +11,8 @@ HTML defines [environment settings object](https://html.spec.whatwg.org/C/webappapis.html#environment-settings-object), and ExecutionContext is somewhat similar to this object, however, there is unfortunately no exact correspondence between them because ExecutionContext has grown step by step since before environment settings object got defined as today's one. +An ExecutionContext may be [paused or frozen](https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/core/execution_context/PausingAndFreezing.md) + # SecurityContext
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc index 2eb07da..37c9f95 100644 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
@@ -376,14 +376,6 @@ } } -void LocalFrameClientImpl::DispatchDidReceiveResponse( - const ResourceResponse& response) { - if (web_frame_->Client()) { - WrappedResourceResponse webresp(response); - web_frame_->Client()->DidReceiveResponse(webresp); - } -} - void LocalFrameClientImpl::DispatchDidFinishDocumentLoad() { // TODO(dglazkov): Sadly, workers are WebLocalFrameClients, and they can // totally destroy themselves when didFinishDocumentLoad is invoked, and in
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h index 2027470..3e957d99 100644 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
@@ -89,7 +89,6 @@ void WillBeDetached() override; void Detached(FrameDetachType) override; void DispatchWillSendRequest(ResourceRequest&) override; - void DispatchDidReceiveResponse(const ResourceResponse&) override; void DispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const ResourceResponse&) override; void DispatchDidHandleOnloadEvents() override;
diff --git a/third_party/blink/renderer/core/exported/web_shared_worker_impl.cc b/third_party/blink/renderer/core/exported/web_shared_worker_impl.cc index e7768ec..9b46aea 100644 --- a/third_party/blink/renderer/core/exported/web_shared_worker_impl.cc +++ b/third_party/blink/renderer/core/exported/web_shared_worker_impl.cc
@@ -218,9 +218,9 @@ // https://html.spec.whatwg.org/C/#shared-workers-and-the-sharedworker-interface PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::ConnectTaskOnWorkerThread, - WTF::CrossThreadUnretained(this), - WTF::Passed(std::move(web_channel)))); + CrossThreadBindOnce(&WebSharedWorkerImpl::ConnectTaskOnWorkerThread, + WTF::CrossThreadUnretained(this), + WTF::Passed(std::move(web_channel)))); } void WebSharedWorkerImpl::ConnectTaskOnWorkerThread(
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index d4abf56..0203d2a 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2023,8 +2023,10 @@ if (does_composite_) { // When attaching a local main frame, set up any state on the compositor. AsWidget().client->SetBackgroundColor(BackgroundColor()); - AsWidget().client->SetPageScaleFactorAndLimits( - PageScaleFactor(), MinimumPageScaleFactor(), MaximumPageScaleFactor()); + auto& viewport = GetPage()->GetVisualViewport(); + AsWidget().client->SetPageScaleStateAndLimits( + viewport.Scale(), viewport.IsPinchGestureActive(), + MinimumPageScaleFactor(), MaximumPageScaleFactor()); } } @@ -2567,8 +2569,10 @@ // so we must update those even though SetPageScaleFactor() may do the same if // the scale factor is changed. if (does_composite_) { - AsWidget().client->SetPageScaleFactorAndLimits( - PageScaleFactor(), MinimumPageScaleFactor(), MaximumPageScaleFactor()); + auto& viewport = GetPage()->GetVisualViewport(); + AsWidget().client->SetPageScaleStateAndLimits( + viewport.Scale(), viewport.IsPinchGestureActive(), + MinimumPageScaleFactor(), MaximumPageScaleFactor()); } } @@ -2822,8 +2826,10 @@ // A resized main frame can change the page scale limits. if (does_composite_) { - AsWidget().client->SetPageScaleFactorAndLimits( - PageScaleFactor(), MinimumPageScaleFactor(), MaximumPageScaleFactor()); + auto& viewport = GetPage()->GetVisualViewport(); + AsWidget().client->SetPageScaleStateAndLimits( + viewport.Scale(), viewport.IsPinchGestureActive(), + MinimumPageScaleFactor(), MaximumPageScaleFactor()); } } @@ -3090,14 +3096,13 @@ DCHECK(does_composite_); GetPageScaleConstraintsSet().SetNeedsReset(false); - // Set up the compositor. - AsWidget().client->SetPageScaleFactorAndLimits( - PageScaleFactor(), MinimumPageScaleFactor(), MaximumPageScaleFactor()); - // Also inform the browser of the PageScaleFactor, which is tracked - // per-view. + // Set up the compositor and inform the browser of the PageScaleFactor, + // which is tracked per-view. auto& viewport = GetPage()->GetVisualViewport(); - AsView().client->PageScaleFactorChanged(viewport.Scale(), - viewport.IsPinchGestureActive()); + AsWidget().client->SetPageScaleStateAndLimits( + viewport.Scale(), viewport.IsPinchGestureActive(), + MinimumPageScaleFactor(), MaximumPageScaleFactor()); + AsView().client->PageScaleFactorChanged(viewport.Scale()); dev_tools_emulator_->MainFrameScrollOrScaleChanged(); }
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.cc b/third_party/blink/renderer/core/frame/frame_test_helpers.cc index 1a7112b28..ecd2932a 100644 --- a/third_party/blink/renderer/core/frame/frame_test_helpers.cc +++ b/third_party/blink/renderer/core/frame/frame_test_helpers.cc
@@ -641,9 +641,11 @@ layer_tree_host()->SetHasGpuRasterizationTrigger(allow); } -void TestWebWidgetClient::SetPageScaleFactorAndLimits(float page_scale_factor, - float minimum, - float maximum) { +void TestWebWidgetClient::SetPageScaleStateAndLimits( + float page_scale_factor, + bool is_pinch_gesture_active, + float minimum, + float maximum) { layer_tree_host()->SetPageScaleFactorAndLimits(page_scale_factor, minimum, maximum); }
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.h b/third_party/blink/renderer/core/frame/frame_test_helpers.h index c4b775ec..5e149178 100644 --- a/third_party/blink/renderer/core/frame/frame_test_helpers.h +++ b/third_party/blink/renderer/core/frame/frame_test_helpers.h
@@ -205,9 +205,10 @@ void RegisterSelection(const cc::LayerSelection& selection) override; void SetBackgroundColor(SkColor color) override; void SetAllowGpuRasterization(bool allow) override; - void SetPageScaleFactorAndLimits(float page_scale_factor, - float minimum, - float maximum) override; + void SetPageScaleStateAndLimits(float page_scale_factor, + bool is_pinch_gesture_active, + float minimum, + float maximum) override; void InjectGestureScrollEvent(WebGestureDevice device, const WebFloatSize& delta, WebScrollGranularity granularity,
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h index 422c217..baf37d001 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -137,7 +137,6 @@ virtual void WillBeDetached() = 0; virtual void DispatchWillSendRequest(ResourceRequest&) = 0; - virtual void DispatchDidReceiveResponse(const ResourceResponse&) = 0; virtual void DispatchDidLoadResourceFromMemoryCache( const ResourceRequest&, const ResourceResponse&) = 0;
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index c62aad9..6c47331d 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -2763,8 +2763,8 @@ } paint_artifact_compositor_->Update( - paint_controller_->GetPaintArtifactShared(), animation_element_ids_, - viewport_properties, settings); + paint_controller_->GetPaintArtifactShared(), viewport_properties, + settings); probe::LayerTreePainted(&GetFrame()); }
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.h b/third_party/blink/renderer/core/frame/local_frame_view.h index 9e26748..c024edce 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/third_party/blink/renderer/core/frame/local_frame_view.h
@@ -950,14 +950,6 @@ std::unique_ptr<PaintController> paint_controller_; std::unique_ptr<PaintArtifactCompositor> paint_artifact_compositor_; - // The set of ElementIds that were composited for animation by - // PaintArtifactCompositor during the Paint lifecycle phase. Only used by - // BlinkGenPropertyTrees and CompositeAfterPaint. These are stored here - // because sometimes PaintArtifactCompositor::Update() does not run (if the - // dirty bit is not set) and in that case, the element ids from the prior run - // are retained. - CompositorElementIdSet animation_element_ids_; - MainThreadScrollingReasons main_thread_scrolling_reasons_; scoped_refptr<LocalFrameUkmAggregator> ukm_aggregator_;
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc index ec350a64..d8a9895 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
@@ -228,9 +228,9 @@ // TODO(wjmaclean): This is updating when the size of the *child frame* // have changed which are completely independent of the WebView, and in an // OOPIF where the main frame is remote, are these limits even useful? - Client()->SetPageScaleFactorAndLimits(1.f, - View()->MinimumPageScaleFactor(), - View()->MaximumPageScaleFactor()); + Client()->SetPageScaleStateAndLimits( + 1.f, false /* is_pinch_gesture_active */, + View()->MinimumPageScaleFactor(), View()->MaximumPageScaleFactor()); } } } @@ -1037,8 +1037,9 @@ Client()->SetBackgroundColor(SK_ColorTRANSPARENT); // Pass the limits even though this is for subframes, as the limits will // be needed in setting the raster scale. - Client()->SetPageScaleFactorAndLimits(1.f, View()->MinimumPageScaleFactor(), - View()->MaximumPageScaleFactor()); + Client()->SetPageScaleStateAndLimits(1.f, false /* is_pinch_gesture_active */, + View()->MinimumPageScaleFactor(), + View()->MaximumPageScaleFactor()); // TODO(kenrb): Currently GPU rasterization is always enabled for OOPIFs. // This is okay because it is only necessarily to set the trigger to false
diff --git a/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc b/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc index b283207..4754856 100644 --- a/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc +++ b/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
@@ -431,8 +431,8 @@ } else { PostCrossThreadTask( *context_->GetTaskRunner(TaskType::kCanvasBlobSerialization), FROM_HERE, - CrossThreadBind(&CanvasAsyncBlobCreator::CreateBlobAndReturnResult, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&CanvasAsyncBlobCreator::CreateBlobAndReturnResult, + WrapCrossThreadPersistent(this))); } SignalAlternativeCodePathFinishedForTesting(); @@ -486,15 +486,15 @@ if (!EncodeImage(quality)) { PostCrossThreadTask( *parent_frame_task_runner_, FROM_HERE, - CrossThreadBind(&CanvasAsyncBlobCreator::CreateNullAndReturnResult, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&CanvasAsyncBlobCreator::CreateNullAndReturnResult, + WrapCrossThreadPersistent(this))); return; } PostCrossThreadTask( *parent_frame_task_runner_, FROM_HERE, - CrossThreadBind(&CanvasAsyncBlobCreator::CreateBlobAndReturnResult, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&CanvasAsyncBlobCreator::CreateBlobAndReturnResult, + WrapCrossThreadPersistent(this))); } bool CanvasAsyncBlobCreator::InitializeEncoder(double quality) {
diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc b/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc index 5792a97..be5a82a 100644 --- a/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc +++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc
@@ -958,11 +958,12 @@ } scoped_refptr<base::SingleThreadTaskRunner> task_runner = Thread::MainThread()->GetTaskRunner(); - PostCrossThreadTask(*task_runner, FROM_HERE, - CrossThreadBind(&ResolvePromiseOnOriginalThread, - WrapCrossThreadPersistent(resolver), - std::move(skia_image), origin_clean, - WTF::Passed(std::move(parsed_options)))); + PostCrossThreadTask( + *task_runner, FROM_HERE, + CrossThreadBindOnce(&ResolvePromiseOnOriginalThread, + WrapCrossThreadPersistent(resolver), + std::move(skia_image), origin_clean, + WTF::Passed(std::move(parsed_options)))); } ScriptPromise ImageBitmap::CreateAsync(ImageElementBase* image,
diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc index 8e22dee6..a884b0a 100644 --- a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc +++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc
@@ -348,9 +348,9 @@ } PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind(&ImageBitmapFactories::ImageBitmapLoader:: - ResolvePromiseOnOriginalThread, - WrapCrossThreadPersistent(this), std::move(frame))); + CrossThreadBindOnce(&ImageBitmapFactories::ImageBitmapLoader:: + ResolvePromiseOnOriginalThread, + WrapCrossThreadPersistent(this), std::move(frame))); } void ImageBitmapFactories::ImageBitmapLoader::ResolvePromiseOnOriginalThread(
diff --git a/third_party/blink/renderer/core/inspector/devtools_session.cc b/third_party/blink/renderer/core/inspector/devtools_session.cc index d74a114c..f4302a3d 100644 --- a/third_party/blink/renderer/core/inspector/devtools_session.cc +++ b/third_party/blink/renderer/core/inspector/devtools_session.cc
@@ -87,10 +87,10 @@ inspector_task_runner_(inspector_task_runner), session_(std::move(session)), binding_(this) { - PostCrossThreadTask( - *io_task_runner, FROM_HERE, - CrossThreadBind(&IOSession::BindInterface, CrossThreadUnretained(this), - WTF::Passed(std::move(request)))); + PostCrossThreadTask(*io_task_runner, FROM_HERE, + CrossThreadBindOnce(&IOSession::BindInterface, + CrossThreadUnretained(this), + WTF::Passed(std::move(request)))); } ~IOSession() override {}
diff --git a/third_party/blink/renderer/core/inspector/inspector_task_runner.cc b/third_party/blink/renderer/core/inspector/inspector_task_runner.cc index 656bff6..99dfd37 100644 --- a/third_party/blink/renderer/core/inspector/inspector_task_runner.cc +++ b/third_party/blink/renderer/core/inspector/inspector_task_runner.cc
@@ -50,8 +50,8 @@ condition_.Signal(); PostCrossThreadTask( *isolate_task_runner_, FROM_HERE, - CrossThreadBind(&InspectorTaskRunner::PerformSingleTaskDontWait, - WrapRefCounted(this))); + CrossThreadBindOnce(&InspectorTaskRunner::PerformSingleTaskDontWait, + WrapRefCounted(this))); if (isolate_) isolate_->RequestInterrupt(&V8InterruptCallback, this); }
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index 8b0d0bc9..b9826fef 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -3376,9 +3376,11 @@ const LayoutObject* layout_object, const ComputedStyle* style) { DCHECK(layout_object); - const LayoutObject* layout_object_for_first_line_style = layout_object; - if (layout_object->IsBeforeOrAfterContent()) - layout_object_for_first_line_style = layout_object->Parent(); + + const LayoutObject* layout_object_for_first_line_style = + (layout_object->IsBeforeOrAfterContent() && layout_object->Parent()) + ? layout_object->Parent() + : layout_object; if (layout_object_for_first_line_style->BehavesLikeBlockContainer()) { if (const LayoutBlock* first_line_block =
diff --git a/third_party/blink/renderer/core/layout/ng/exclusions/ng_line_layout_opportunity.h b/third_party/blink/renderer/core/layout/ng/exclusions/ng_line_layout_opportunity.h index 830ce49..a54a2c4 100644 --- a/third_party/blink/renderer/core/layout/ng/exclusions/ng_line_layout_opportunity.h +++ b/third_party/blink/renderer/core/layout/ng/exclusions/ng_line_layout_opportunity.h
@@ -60,6 +60,13 @@ DCHECK_GE(float_line_right_offset, float_line_left_offset); return float_line_right_offset - float_line_left_offset; } + + bool IsEqualToAvailableFloatInlineSize(LayoutUnit inline_size) const { + DCHECK_GE(float_line_right_offset, float_line_left_offset); + // Compare |line_right| isntead of |inline_size| to avoid returning |false| + // when |line_left + inline_size| exceeds |LayoutUnit::Max| and clamped. + return float_line_left_offset + inline_size == float_line_right_offset; + } }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc index 07d12352..3f5c0cda 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -793,6 +793,7 @@ NGExclusionSpace exclusion_space; const NGInlineBreakToken* break_token = BreakToken(); + bool is_line_created = false; LayoutUnit line_block_size; LayoutUnit block_delta; const auto* opportunities_it = opportunities.begin(); @@ -820,6 +821,7 @@ // Reset any state that may have been modified in a previous pass. container_builder_.Reset(); exclusion_space = initial_exclusion_space; + is_line_created = false; NGLineLayoutOpportunity line_opportunity = opportunity.ComputeLineLayoutOpportunity(ConstraintSpace(), @@ -836,8 +838,8 @@ // *and* the opportunity is smaller than the available inline-size, and the // container autowraps, continue to the next opportunity. if (line_info.HasOverflow() && - ConstraintSpace().AvailableSize().inline_size != - line_opportunity.AvailableFloatInlineSize() && + !line_opportunity.IsEqualToAvailableFloatInlineSize( + ConstraintSpace().AvailableSize().inline_size) && Node().Style().AutoWrap()) { // Shapes are *special*. We need to potentially increment the block-delta // by 1px each loop to properly test each potential position of the line. @@ -853,11 +855,15 @@ line_block_size = LayoutUnit(); ++opportunities_it; } + // There must be at least one more opportunity, or we fail to call + // |CreateLine()|. + DCHECK_NE(opportunities_it, opportunities.end()); continue; } PrepareBoxStates(line_info, break_token); CreateLine(line_opportunity, &line_info, &exclusion_space); + is_line_created = true; // We now can check the block-size of the fragment, and it fits within the // opportunity. @@ -915,6 +921,7 @@ break; } + CHECK(is_line_created); container_builder_.SetExclusionSpace(std::move(exclusion_space)); container_builder_.MoveOutOfFlowDescendantCandidatesToDescendants(); return container_builder_.ToLineBoxFragment();
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc index d266a65..ee9c006e 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc
@@ -48,6 +48,8 @@ kFragmentLineBox, builder->line_box_type_), metrics_(builder->metrics_) { + // A line box must have a metrics unless it's an empty line box. + DCHECK(!metrics_.IsEmpty() || IsEmptyLineBox()); style_ = std::move(builder->style_); base_direction_ = static_cast<unsigned>(builder->base_direction_); has_propagated_descendants_ = has_floating_descendants_ ||
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc index 30c0d99..fabbb6d3 100644 --- a/third_party/blink/renderer/core/loader/document_loader.cc +++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -1208,8 +1208,6 @@ } GetFrameLoader().Progress().IncrementProgress(main_resource_identifier_, response_); - // TODO(dgozman): remove this client call, it is only used in tests. - GetLocalFrameClient().DispatchDidReceiveResponse(response_); probe::DidReceiveResourceResponse(probe::ToCoreProbeSink(GetFrame()), main_resource_identifier_, this, response_, nullptr /* resource */);
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h index 22bad34..bad424f0c 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -256,7 +256,6 @@ void FrameFocused() const override {} void DispatchWillSendRequest(ResourceRequest&) override {} - void DispatchDidReceiveResponse(const ResourceResponse&) override {} void DispatchDidLoadResourceFromMemoryCache( const ResourceRequest&, const ResourceResponse&) override {}
diff --git a/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc b/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc index b43e4a7..c08d392e 100644 --- a/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc +++ b/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc
@@ -149,7 +149,6 @@ } frame.Loader().Progress().IncrementProgress(identifier, response); - frame_client->DispatchDidReceiveResponse(response); probe::DidReceiveResourceResponse(GetProbe(), identifier, &document_loader, response, resource); // It is essential that inspector gets resource response BEFORE console.
diff --git a/third_party/blink/renderer/core/loader/worker_resource_timing_notifier_impl.cc b/third_party/blink/renderer/core/loader/worker_resource_timing_notifier_impl.cc index 5cc070f7..b33694e 100644 --- a/third_party/blink/renderer/core/loader/worker_resource_timing_notifier_impl.cc +++ b/third_party/blink/renderer/core/loader/worker_resource_timing_notifier_impl.cc
@@ -60,7 +60,7 @@ } else { PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &WorkerResourceTimingNotifierImpl::AddCrossThreadResourceTiming, WrapCrossThreadWeakPersistent(this), info, initiator_type.GetString()));
diff --git a/third_party/blink/renderer/core/mojo/mojo_watcher.cc b/third_party/blink/renderer/core/mojo/mojo_watcher.cc index aab35c5b..a5ab3f8 100644 --- a/third_party/blink/renderer/core/mojo/mojo_watcher.cc +++ b/third_party/blink/renderer/core/mojo/mojo_watcher.cc
@@ -145,8 +145,9 @@ MojoWatcher* watcher = reinterpret_cast<MojoWatcher*>(event->trigger_context); PostCrossThreadTask( *watcher->task_runner_, FROM_HERE, - CrossThreadBind(&MojoWatcher::RunReadyCallback, - WrapCrossThreadWeakPersistent(watcher), event->result)); + CrossThreadBindOnce(&MojoWatcher::RunReadyCallback, + WrapCrossThreadWeakPersistent(watcher), + event->result)); } void MojoWatcher::RunReadyCallback(MojoResult result) {
diff --git a/third_party/blink/renderer/core/timing/performance.cc b/third_party/blink/renderer/core/timing/performance.cc index b999276..4f80ea2 100644 --- a/third_party/blink/renderer/core/timing/performance.cc +++ b/third_party/blink/renderer/core/timing/performance.cc
@@ -824,8 +824,8 @@ } const PerformanceMeasureOptions* options = start_or_options.GetAsPerformanceMeasureOptions(); - return MeasureWithDetail(script_state, measure_name, options->startTime(), - options->endTime(), options->detail(), + return MeasureWithDetail(script_state, measure_name, options->start(), + options->end(), options->detail(), exception_state); } else { // measure("name", "mark1", *)
diff --git a/third_party/blink/renderer/core/timing/performance_measure_options.idl b/third_party/blink/renderer/core/timing/performance_measure_options.idl index e8d663f..c8f8466 100644 --- a/third_party/blink/renderer/core/timing/performance_measure_options.idl +++ b/third_party/blink/renderer/core/timing/performance_measure_options.idl
@@ -6,7 +6,7 @@ // https://docs.google.com/document/d/1hltt8z9C4PaI5Qu1YMIp1wOGdbJPJPoJwBarEeCY6xQ/edit# dictionary PerformanceMeasureOptions { any detail; - (DOMString or DOMHighResTimeStamp)? startTime; + (DOMString or DOMHighResTimeStamp) start; // TODO(crbug.com/758385): add |duration| for better ergonomics. - (DOMString or DOMHighResTimeStamp)? endTime; -}; \ No newline at end of file + (DOMString or DOMHighResTimeStamp) end; +};
diff --git a/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc b/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc index d661bc67..52d59084 100644 --- a/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc +++ b/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
@@ -112,7 +112,7 @@ } PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kPostedMessage), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &DedicatedWorkerObjectProxy::ProcessMessageFromWorkerObject, CrossThreadUnretained(&WorkerObjectProxy()), WTF::Passed(std::move(message)), @@ -166,7 +166,7 @@ for (auto& task : tasks) { PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kPostedMessage), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &DedicatedWorkerObjectProxy::ProcessMessageFromWorkerObject, CrossThreadUnretained(&WorkerObjectProxy()), WTF::Passed(std::move(task)), @@ -223,9 +223,10 @@ // https://html.spec.whatwg.org/C/#runtime-script-errors-2 PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind(&DedicatedWorkerObjectProxy::ProcessUnhandledException, - CrossThreadUnretained(worker_object_proxy_.get()), - exception_id, CrossThreadUnretained(GetWorkerThread()))); + CrossThreadBindOnce( + &DedicatedWorkerObjectProxy::ProcessUnhandledException, + CrossThreadUnretained(worker_object_proxy_.get()), exception_id, + CrossThreadUnretained(GetWorkerThread()))); // Propagate an unhandled error to the parent context. const auto mute_script_errors = SanitizeScriptErrors::kDoNotSanitize;
diff --git a/third_party/blink/renderer/core/workers/dedicated_worker_object_proxy.cc b/third_party/blink/renderer/core/workers/dedicated_worker_object_proxy.cc index 548fc07..ae7793c 100644 --- a/third_party/blink/renderer/core/workers/dedicated_worker_object_proxy.cc +++ b/third_party/blink/renderer/core/workers/dedicated_worker_object_proxy.cc
@@ -60,9 +60,9 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kPostedMessage), FROM_HERE, - CrossThreadBind(&DedicatedWorkerMessagingProxy::PostMessageToWorkerObject, - messaging_proxy_weak_ptr_, - WTF::Passed(std::move(message)))); + CrossThreadBindOnce( + &DedicatedWorkerMessagingProxy::PostMessageToWorkerObject, + messaging_proxy_weak_ptr_, WTF::Passed(std::move(message)))); } void DedicatedWorkerObjectProxy::ProcessMessageFromWorkerObject( @@ -87,41 +87,41 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&DedicatedWorkerMessagingProxy::DispatchErrorEvent, - messaging_proxy_weak_ptr_, error_message, - WTF::Passed(location->Clone()), exception_id)); + CrossThreadBindOnce(&DedicatedWorkerMessagingProxy::DispatchErrorEvent, + messaging_proxy_weak_ptr_, error_message, + WTF::Passed(location->Clone()), exception_id)); } void DedicatedWorkerObjectProxy::DidFailToFetchClassicScript() { PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&DedicatedWorkerMessagingProxy::DidFailToFetchScript, - messaging_proxy_weak_ptr_)); + CrossThreadBindOnce(&DedicatedWorkerMessagingProxy::DidFailToFetchScript, + messaging_proxy_weak_ptr_)); } void DedicatedWorkerObjectProxy::DidFailToFetchModuleScript() { PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&DedicatedWorkerMessagingProxy::DidFailToFetchScript, - messaging_proxy_weak_ptr_)); + CrossThreadBindOnce(&DedicatedWorkerMessagingProxy::DidFailToFetchScript, + messaging_proxy_weak_ptr_)); } void DedicatedWorkerObjectProxy::DidEvaluateClassicScript(bool success) { PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&DedicatedWorkerMessagingProxy::DidEvaluateScript, - messaging_proxy_weak_ptr_, success)); + CrossThreadBindOnce(&DedicatedWorkerMessagingProxy::DidEvaluateScript, + messaging_proxy_weak_ptr_, success)); } void DedicatedWorkerObjectProxy::DidEvaluateModuleScript(bool success) { PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&DedicatedWorkerMessagingProxy::DidEvaluateScript, - messaging_proxy_weak_ptr_, success)); + CrossThreadBindOnce(&DedicatedWorkerMessagingProxy::DidEvaluateScript, + messaging_proxy_weak_ptr_, success)); } DedicatedWorkerObjectProxy::DedicatedWorkerObjectProxy(
diff --git a/third_party/blink/renderer/core/workers/dedicated_worker_test.cc b/third_party/blink/renderer/core/workers/dedicated_worker_test.cc index 1aa8d00..ec90d54a 100644 --- a/third_party/blink/renderer/core/workers/dedicated_worker_test.cc +++ b/third_party/blink/renderer/core/workers/dedicated_worker_test.cc
@@ -55,7 +55,7 @@ GlobalScope()->CountFeature(feature); PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } // Emulates deprecated API use on DedicatedWorkerGlobalScope. @@ -70,7 +70,7 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } void TestTaskRunner() { @@ -80,7 +80,7 @@ EXPECT_TRUE(task_runner->RunsTasksInCurrentSequence()); PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } }; @@ -226,8 +226,8 @@ EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature1)); PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&DedicatedWorkerThreadForTest::CountFeature, - CrossThreadUnretained(GetWorkerThread()), kFeature1)); + CrossThreadBindOnce(&DedicatedWorkerThreadForTest::CountFeature, + CrossThreadUnretained(GetWorkerThread()), kFeature1)); test::EnterRunLoop(); EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature1)); @@ -235,8 +235,8 @@ // DedicatedWorkerObjectProxyForTest::CountFeature. PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&DedicatedWorkerThreadForTest::CountFeature, - CrossThreadUnretained(GetWorkerThread()), kFeature1)); + CrossThreadBindOnce(&DedicatedWorkerThreadForTest::CountFeature, + CrossThreadUnretained(GetWorkerThread()), kFeature1)); test::EnterRunLoop(); // This feature is randomly selected from Deprecation::deprecationMessage(). @@ -247,8 +247,8 @@ EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature2)); PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&DedicatedWorkerThreadForTest::CountDeprecation, - CrossThreadUnretained(GetWorkerThread()), kFeature2)); + CrossThreadBindOnce(&DedicatedWorkerThreadForTest::CountDeprecation, + CrossThreadUnretained(GetWorkerThread()), kFeature2)); test::EnterRunLoop(); EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature2)); @@ -256,8 +256,8 @@ // DedicatedWorkerObjectProxyForTest::CountDeprecation. PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&DedicatedWorkerThreadForTest::CountDeprecation, - CrossThreadUnretained(GetWorkerThread()), kFeature2)); + CrossThreadBindOnce(&DedicatedWorkerThreadForTest::CountDeprecation, + CrossThreadUnretained(GetWorkerThread()), kFeature2)); test::EnterRunLoop(); } @@ -267,8 +267,8 @@ PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&DedicatedWorkerThreadForTest::TestTaskRunner, - CrossThreadUnretained(GetWorkerThread()))); + CrossThreadBindOnce(&DedicatedWorkerThreadForTest::TestTaskRunner, + CrossThreadUnretained(GetWorkerThread()))); test::EnterRunLoop(); }
diff --git a/third_party/blink/renderer/core/workers/experimental/task.cc b/third_party/blink/renderer/core/workers/experimental/task.cc index 66025f8..470430a 100644 --- a/third_party/blink/renderer/core/workers/experimental/task.cc +++ b/third_party/blink/renderer/core/workers/experimental/task.cc
@@ -167,9 +167,10 @@ PostCrossThreadTask( *prerequisite->worker_thread_->GetTaskRunner(task_type_), FROM_HERE, - CrossThreadBind(&TaskBase::PassResultToDependentOnWorkerThread, - WrapCrossThreadPersistent(prerequisite), - prerequisite_index, WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&TaskBase::PassResultToDependentOnWorkerThread, + WrapCrossThreadPersistent(prerequisite), + prerequisite_index, + WrapCrossThreadPersistent(this))); } } @@ -241,8 +242,8 @@ return; DCHECK(state_ == State::kPending || state_ == State::kCancelPending); PostCrossThreadTask(*worker_thread_->GetTaskRunner(task_type_), FROM_HERE, - CrossThreadBind(&TaskBase::StartTaskOnWorkerThread, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&TaskBase::StartTaskOnWorkerThread, + WrapCrossThreadPersistent(this))); } bool TaskBase::WillStartTaskOnWorkerThread() { @@ -288,8 +289,9 @@ *worker_thread_->GetParentExecutionContextTaskRunners()->Get( TaskType::kInternalWorker), FROM_HERE, - CrossThreadBind(&TaskBase::TaskCompleted, WrapCrossThreadPersistent(this), - state == State::kCompleted)); + CrossThreadBindOnce(&TaskBase::TaskCompleted, + WrapCrossThreadPersistent(this), + state == State::kCompleted)); } void TaskBase::RunTaskOnWorkerThread() {
diff --git a/third_party/blink/renderer/core/workers/shared_worker_reporting_proxy.cc b/third_party/blink/renderer/core/workers/shared_worker_reporting_proxy.cc index 2e0974b..c89c9dd 100644 --- a/third_party/blink/renderer/core/workers/shared_worker_reporting_proxy.cc +++ b/third_party/blink/renderer/core/workers/shared_worker_reporting_proxy.cc
@@ -30,8 +30,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::CountFeature, - CrossThreadUnretained(worker_), feature)); + CrossThreadBindOnce(&WebSharedWorkerImpl::CountFeature, + CrossThreadUnretained(worker_), feature)); } void SharedWorkerReportingProxy::CountDeprecation(WebFeature feature) { @@ -71,8 +71,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::DidFetchScript, - CrossThreadUnretained(worker_))); + CrossThreadBindOnce(&WebSharedWorkerImpl::DidFetchScript, + CrossThreadUnretained(worker_))); } void SharedWorkerReportingProxy::DidFailToFetchClassicScript() { @@ -83,8 +83,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::DidFailToFetchClassicScript, - CrossThreadUnretained(worker_))); + CrossThreadBindOnce(&WebSharedWorkerImpl::DidFailToFetchClassicScript, + CrossThreadUnretained(worker_))); } void SharedWorkerReportingProxy::DidFailToFetchModuleScript() { @@ -99,8 +99,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::DidEvaluateClassicScript, - CrossThreadUnretained(worker_), success)); + CrossThreadBindOnce(&WebSharedWorkerImpl::DidEvaluateClassicScript, + CrossThreadUnretained(worker_), success)); } void SharedWorkerReportingProxy::DidEvaluateModuleScript(bool success) { @@ -115,8 +115,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::DidCloseWorkerGlobalScope, - CrossThreadUnretained(worker_))); + CrossThreadBindOnce(&WebSharedWorkerImpl::DidCloseWorkerGlobalScope, + CrossThreadUnretained(worker_))); } void SharedWorkerReportingProxy::DidTerminateWorkerThread() { @@ -124,8 +124,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebSharedWorkerImpl::DidTerminateWorkerThread, - CrossThreadUnretained(worker_))); + CrossThreadBindOnce(&WebSharedWorkerImpl::DidTerminateWorkerThread, + CrossThreadUnretained(worker_))); } void SharedWorkerReportingProxy::Trace(blink::Visitor* visitor) {
diff --git a/third_party/blink/renderer/core/workers/threaded_object_proxy_base.cc b/third_party/blink/renderer/core/workers/threaded_object_proxy_base.cc index bb727e3..512cf5a4 100644 --- a/third_party/blink/renderer/core/workers/threaded_object_proxy_base.cc +++ b/third_party/blink/renderer/core/workers/threaded_object_proxy_base.cc
@@ -19,16 +19,16 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&ThreadedMessagingProxyBase::CountFeature, - MessagingProxyWeakPtr(), feature)); + CrossThreadBindOnce(&ThreadedMessagingProxyBase::CountFeature, + MessagingProxyWeakPtr(), feature)); } void ThreadedObjectProxyBase::CountDeprecation(WebFeature feature) { PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&ThreadedMessagingProxyBase::CountDeprecation, - MessagingProxyWeakPtr(), feature)); + CrossThreadBindOnce(&ThreadedMessagingProxyBase::CountDeprecation, + MessagingProxyWeakPtr(), feature)); } void ThreadedObjectProxyBase::ReportConsoleMessage( @@ -39,17 +39,17 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&ThreadedMessagingProxyBase::ReportConsoleMessage, - MessagingProxyWeakPtr(), source, level, message, - WTF::Passed(location->Clone()))); + CrossThreadBindOnce(&ThreadedMessagingProxyBase::ReportConsoleMessage, + MessagingProxyWeakPtr(), source, level, message, + WTF::Passed(location->Clone()))); } void ThreadedObjectProxyBase::DidCloseWorkerGlobalScope() { PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&ThreadedMessagingProxyBase::TerminateGlobalScope, - MessagingProxyWeakPtr())); + CrossThreadBindOnce(&ThreadedMessagingProxyBase::TerminateGlobalScope, + MessagingProxyWeakPtr())); } void ThreadedObjectProxyBase::DidTerminateWorkerThread() { @@ -57,8 +57,8 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&ThreadedMessagingProxyBase::WorkerThreadTerminated, - MessagingProxyWeakPtr())); + CrossThreadBindOnce(&ThreadedMessagingProxyBase::WorkerThreadTerminated, + MessagingProxyWeakPtr())); } ParentExecutionContextTaskRunners*
diff --git a/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc b/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc index 77a84e6..42a3190 100644 --- a/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc +++ b/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc
@@ -96,7 +96,7 @@ DCHECK(IsMainThread()); PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalLoading), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ThreadedWorkletObjectProxy::FetchAndInvokeScript, CrossThreadUnretained(worklet_object_proxy_.get()), module_url_record, credentials_mode, WTF::Passed(outside_settings_object.CopyData()),
diff --git a/third_party/blink/renderer/core/workers/threaded_worklet_test.cc b/third_party/blink/renderer/core/workers/threaded_worklet_test.cc index fef6446..d75f930da 100644 --- a/third_party/blink/renderer/core/workers/threaded_worklet_test.cc +++ b/third_party/blink/renderer/core/workers/threaded_worklet_test.cc
@@ -91,7 +91,7 @@ EXPECT_FALSE(global_scope->DocumentSecurityOrigin()->IsOpaque()); PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } void TestContentSecurityPolicy() { @@ -114,7 +114,7 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } // Test that having an invalid CSP does not result in an exception. @@ -131,7 +131,7 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } // Emulates API use on threaded WorkletGlobalScope. @@ -140,7 +140,7 @@ GlobalScope()->CountFeature(feature); PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } // Emulates deprecated API use on threaded WorkletGlobalScope. @@ -155,7 +155,7 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } void TestTaskRunner() { @@ -165,7 +165,7 @@ EXPECT_TRUE(task_runner->RunsTasksInCurrentSequence()); PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } private: @@ -268,8 +268,8 @@ PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::TestSecurityOrigin, - CrossThreadUnretained(GetWorkerThread()))); + CrossThreadBindOnce(&ThreadedWorkletThreadForTest::TestSecurityOrigin, + CrossThreadUnretained(GetWorkerThread()))); test::EnterRunLoop(); } @@ -286,8 +286,9 @@ PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::TestContentSecurityPolicy, - CrossThreadUnretained(GetWorkerThread()))); + CrossThreadBindOnce( + &ThreadedWorkletThreadForTest::TestContentSecurityPolicy, + CrossThreadUnretained(GetWorkerThread()))); test::EnterRunLoop(); } @@ -301,7 +302,7 @@ PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ThreadedWorkletThreadForTest::TestInvalidContentSecurityPolicy, CrossThreadUnretained(GetWorkerThread()))); test::EnterRunLoop(); @@ -319,8 +320,8 @@ EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature1)); PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::CountFeature, - CrossThreadUnretained(GetWorkerThread()), kFeature1)); + CrossThreadBindOnce(&ThreadedWorkletThreadForTest::CountFeature, + CrossThreadUnretained(GetWorkerThread()), kFeature1)); test::EnterRunLoop(); EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature1)); @@ -328,8 +329,8 @@ // ThreadedWorkletObjectProxyForTest::CountFeature. PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::CountFeature, - CrossThreadUnretained(GetWorkerThread()), kFeature1)); + CrossThreadBindOnce(&ThreadedWorkletThreadForTest::CountFeature, + CrossThreadUnretained(GetWorkerThread()), kFeature1)); test::EnterRunLoop(); // This feature is randomly selected from Deprecation::deprecationMessage(). @@ -340,8 +341,8 @@ EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature2)); PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::CountDeprecation, - CrossThreadUnretained(GetWorkerThread()), kFeature2)); + CrossThreadBindOnce(&ThreadedWorkletThreadForTest::CountDeprecation, + CrossThreadUnretained(GetWorkerThread()), kFeature2)); test::EnterRunLoop(); EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature2)); @@ -349,8 +350,8 @@ // ThreadedWorkletObjectProxyForTest::CountDeprecation. PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::CountDeprecation, - CrossThreadUnretained(GetWorkerThread()), kFeature2)); + CrossThreadBindOnce(&ThreadedWorkletThreadForTest::CountDeprecation, + CrossThreadUnretained(GetWorkerThread()), kFeature2)); test::EnterRunLoop(); } @@ -359,8 +360,8 @@ PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&ThreadedWorkletThreadForTest::TestTaskRunner, - CrossThreadUnretained(GetWorkerThread()))); + CrossThreadBindOnce(&ThreadedWorkletThreadForTest::TestTaskRunner, + CrossThreadUnretained(GetWorkerThread()))); test::EnterRunLoop(); }
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.cc b/third_party/blink/renderer/core/workers/worker_global_scope.cc index 54abbb7..b16111af 100644 --- a/third_party/blink/renderer/core/workers/worker_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worker_global_scope.cc
@@ -473,10 +473,10 @@ } void WorkerGlobalScope::RemoveURLFromMemoryCache(const KURL& url) { - PostCrossThreadTask(*thread_->GetParentExecutionContextTaskRunners()->Get( - TaskType::kNetworking), - FROM_HERE, - CrossThreadBind(&RemoveURLFromMemoryCacheInternal, url)); + PostCrossThreadTask( + *thread_->GetParentExecutionContextTaskRunners()->Get( + TaskType::kNetworking), + FROM_HERE, CrossThreadBindOnce(&RemoveURLFromMemoryCacheInternal, url)); } NOINLINE void WorkerGlobalScope::InitializeURL(const KURL& url) {
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc index 1942130..70358532 100644 --- a/third_party/blink/renderer/core/workers/worker_thread.cc +++ b/third_party/blink/renderer/core/workers/worker_thread.cc
@@ -188,9 +188,9 @@ DCHECK_CALLED_ON_VALID_THREAD(parent_thread_checker_); PostCrossThreadTask( *GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind(&WorkerThread::EvaluateClassicScriptOnWorkerThread, - CrossThreadUnretained(this), script_url, source_code, - WTF::Passed(std::move(cached_meta_data)), stack_id)); + CrossThreadBindOnce(&WorkerThread::EvaluateClassicScriptOnWorkerThread, + CrossThreadUnretained(this), script_url, source_code, + WTF::Passed(std::move(cached_meta_data)), stack_id)); } void WorkerThread::FetchAndRunClassicScript( @@ -201,7 +201,7 @@ DCHECK_CALLED_ON_VALID_THREAD(parent_thread_checker_); PostCrossThreadTask( *GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &WorkerThread::FetchAndRunClassicScriptOnWorkerThread, CrossThreadUnretained(this), script_url, WTF::Passed(outside_settings_object.CopyData()), @@ -217,7 +217,7 @@ DCHECK_CALLED_ON_VALID_THREAD(parent_thread_checker_); PostCrossThreadTask( *GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &WorkerThread::FetchAndRunModuleScriptOnWorkerThread, CrossThreadUnretained(this), script_url, WTF::Passed(outside_settings_object.CopyData()),
diff --git a/third_party/blink/renderer/core/workers/worker_thread.h b/third_party/blink/renderer/core/workers/worker_thread.h index e23ab0a..f093762c 100644 --- a/third_party/blink/renderer/core/workers/worker_thread.h +++ b/third_party/blink/renderer/core/workers/worker_thread.h
@@ -195,8 +195,8 @@ for (WorkerThread* thread : WorkerThreads()) { PostCrossThreadTask( *thread->GetTaskRunner(task_type), FROM_HERE, - CrossThreadBind(function, WTF::CrossThreadUnretained(thread), - parameters...)); + CrossThreadBindOnce(function, WTF::CrossThreadUnretained(thread), + parameters...)); } }
diff --git a/third_party/blink/renderer/core/workers/worker_thread_test.cc b/third_party/blink/renderer/core/workers/worker_thread_test.cc index 70943fb..e33f106 100644 --- a/third_party/blink/renderer/core/workers/worker_thread_test.cc +++ b/third_party/blink/renderer/core/workers/worker_thread_test.cc
@@ -41,7 +41,7 @@ PostCrossThreadTask( *worker_thread->GetParentExecutionContextTaskRunners()->Get( TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); waitable_event->Wait(); worker_thread->DebuggerTaskFinished(); } @@ -112,9 +112,9 @@ *parent_thread->GetParentExecutionContextTaskRunners()->Get( TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&TerminateParentOfNestedWorker, - CrossThreadUnretained(parent_thread), - CrossThreadUnretained(&child_waitable))); + CrossThreadBindOnce(&TerminateParentOfNestedWorker, + CrossThreadUnretained(parent_thread), + CrossThreadUnretained(&child_waitable))); child_waitable.Wait(); EXPECT_EQ(ExitCode::kNotTerminated, parent_thread->GetExitCodeForTesting()); @@ -123,7 +123,7 @@ PostCrossThreadTask( *parent_thread->GetParentExecutionContextTaskRunners()->Get( TaskType::kInternalTest), - FROM_HERE, CrossThreadBind(&test::ExitRunLoop)); + FROM_HERE, CrossThreadBindOnce(&test::ExitRunLoop)); } void VerifyParentAndChildAreTerminated(WorkerThread* parent_thread, @@ -407,9 +407,9 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *worker_thread_->GetTaskRunner(TaskType::kInternalInspector), FROM_HERE, - CrossThreadBind(&WaitForSignalTask, - CrossThreadUnretained(worker_thread_.get()), - CrossThreadUnretained(&waitable_event))); + CrossThreadBindOnce(&WaitForSignalTask, + CrossThreadUnretained(worker_thread_.get()), + CrossThreadUnretained(&waitable_event))); // Wait for the debugger task. test::EnterRunLoop(); @@ -453,9 +453,9 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *worker_thread_->GetTaskRunner(TaskType::kInternalInspector), FROM_HERE, - CrossThreadBind(&WaitForSignalTask, - CrossThreadUnretained(worker_thread_.get()), - CrossThreadUnretained(&waitable_event))); + CrossThreadBindOnce(&WaitForSignalTask, + CrossThreadUnretained(worker_thread_.get()), + CrossThreadUnretained(&waitable_event))); // Wait for the debugger task. test::EnterRunLoop(); @@ -496,9 +496,9 @@ // Create a nested worker from the worker thread. PostCrossThreadTask( *worker_thread_->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&CreateNestedWorkerThenTerminateParent, - CrossThreadUnretained(worker_thread_.get()), - CrossThreadUnretained(&nested_worker_helper))); + CrossThreadBindOnce(&CreateNestedWorkerThenTerminateParent, + CrossThreadUnretained(worker_thread_.get()), + CrossThreadUnretained(&nested_worker_helper))); test::EnterRunLoop(); base::WaitableEvent waitable_event; @@ -541,10 +541,10 @@ reporting_proxy_->WaitUntilScriptEvaluation(); base::WaitableEvent child_waitable; - PostCrossThreadTask(*worker_thread_->GetTaskRunner(TaskType::kInternalTest), - FROM_HERE, - CrossThreadBind(&base::WaitableEvent::Signal, - CrossThreadUnretained(&child_waitable))); + PostCrossThreadTask( + *worker_thread_->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, + CrossThreadBindOnce(&base::WaitableEvent::Signal, + CrossThreadUnretained(&child_waitable))); // Freeze() enters a nested event loop where the kInternalTest should run. worker_thread_->Freeze(); @@ -569,10 +569,10 @@ reporting_proxy_->WaitUntilScriptEvaluation(); base::WaitableEvent child_waitable; - PostCrossThreadTask(*worker_thread_->GetTaskRunner(TaskType::kInternalTest), - FROM_HERE, - CrossThreadBind(&base::WaitableEvent::Signal, - CrossThreadUnretained(&child_waitable))); + PostCrossThreadTask( + *worker_thread_->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, + CrossThreadBindOnce(&base::WaitableEvent::Signal, + CrossThreadUnretained(&child_waitable))); // Pause() enters a nested event loop where the kInternalTest should run. worker_thread_->Pause(); @@ -607,17 +607,17 @@ Start(); base::WaitableEvent child_waitable; - PostCrossThreadTask(*worker_thread_->GetTaskRunner(TaskType::kInternalTest), - FROM_HERE, - CrossThreadBind(&base::WaitableEvent::Signal, - CrossThreadUnretained(&child_waitable))); + PostCrossThreadTask( + *worker_thread_->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, + CrossThreadBindOnce(&base::WaitableEvent::Signal, + CrossThreadUnretained(&child_waitable))); child_waitable.Wait(); base::WaitableEvent child_waitable2; - PostCrossThreadTask(*worker_thread_->GetTaskRunner(TaskType::kInternalTest), - FROM_HERE, - CrossThreadBind(&base::WaitableEvent::Signal, - CrossThreadUnretained(&child_waitable2))); + PostCrossThreadTask( + *worker_thread_->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, + CrossThreadBindOnce(&base::WaitableEvent::Signal, + CrossThreadUnretained(&child_waitable2))); // Pause() enters a nested event loop where the kInternalTest should run. worker_thread_->Pause();
diff --git a/third_party/blink/renderer/core/workers/worklet_module_responses_map.cc b/third_party/blink/renderer/core/workers/worklet_module_responses_map.cc index 940a822..d2db5f21 100644 --- a/third_party/blink/renderer/core/workers/worklet_module_responses_map.cc +++ b/third_party/blink/renderer/core/workers/worklet_module_responses_map.cc
@@ -45,8 +45,8 @@ for (auto& it : clients_) { PostCrossThreadTask( *it.value, FROM_HERE, - CrossThreadBind(&ModuleScriptFetcher::Client::OnFetched, it.key, - *params)); + CrossThreadBindOnce(&ModuleScriptFetcher::Client::OnFetched, it.key, + *params)); } } else { state_ = State::kFailed; @@ -54,7 +54,7 @@ for (auto& it : clients_) { PostCrossThreadTask( *it.value, FROM_HERE, - CrossThreadBind(&ModuleScriptFetcher::Client::OnFailed, it.key)); + CrossThreadBindOnce(&ModuleScriptFetcher::Client::OnFailed, it.key)); } }
diff --git a/third_party/blink/renderer/core/workers/worklet_module_tree_client.cc b/third_party/blink/renderer/core/workers/worklet_module_tree_client.cc index 4f5cd5f..94f824f 100644 --- a/third_party/blink/renderer/core/workers/worklet_module_tree_client.cc +++ b/third_party/blink/renderer/core/workers/worklet_module_tree_client.cc
@@ -35,8 +35,8 @@ // The steps are implemented in WorkletPendingTasks::Abort(). PostCrossThreadTask( *outside_settings_task_runner_, FROM_HERE, - CrossThreadBind(&WorkletPendingTasks::Abort, - WrapCrossThreadPersistent(pending_tasks_.Get()))); + CrossThreadBindOnce(&WorkletPendingTasks::Abort, + WrapCrossThreadPersistent(pending_tasks_.Get()))); return; } @@ -53,8 +53,8 @@ if (module_script->HasErrorToRethrow()) { PostCrossThreadTask( *outside_settings_task_runner_, FROM_HERE, - CrossThreadBind(&WorkletPendingTasks::Abort, - WrapCrossThreadPersistent(pending_tasks_.Get()))); + CrossThreadBindOnce(&WorkletPendingTasks::Abort, + WrapCrossThreadPersistent(pending_tasks_.Get()))); return; } @@ -72,8 +72,8 @@ // The steps are implemented in WorkletPendingTasks::DecrementCounter(). PostCrossThreadTask( *outside_settings_task_runner_, FROM_HERE, - CrossThreadBind(&WorkletPendingTasks::DecrementCounter, - WrapCrossThreadPersistent(pending_tasks_.Get()))); + CrossThreadBindOnce(&WorkletPendingTasks::DecrementCounter, + WrapCrossThreadPersistent(pending_tasks_.Get()))); } void WorkletModuleTreeClient::Trace(blink::Visitor* visitor) {
diff --git a/third_party/blink/renderer/devtools/front_end/Images/mediumIcons.png b/third_party/blink/renderer/devtools/front_end/Images/mediumIcons.png index c4f61103..2352349 100644 --- a/third_party/blink/renderer/devtools/front_end/Images/mediumIcons.png +++ b/third_party/blink/renderer/devtools/front_end/Images/mediumIcons.png Binary files differ
diff --git a/third_party/blink/renderer/devtools/front_end/Images/mediumIcons_2x.png b/third_party/blink/renderer/devtools/front_end/Images/mediumIcons_2x.png index 3435809..866dd0b 100644 --- a/third_party/blink/renderer/devtools/front_end/Images/mediumIcons_2x.png +++ b/third_party/blink/renderer/devtools/front_end/Images/mediumIcons_2x.png Binary files differ
diff --git a/third_party/blink/renderer/devtools/front_end/Images/src/mediumIcons.svg b/third_party/blink/renderer/devtools/front_end/Images/src/mediumIcons.svg index d65878c..02c7356 100644 --- a/third_party/blink/renderer/devtools/front_end/Images/src/mediumIcons.svg +++ b/third_party/blink/renderer/devtools/front_end/Images/src/mediumIcons.svg
@@ -8,8 +8,8 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="80" - height="80" + width="96" + height="96" id="svg4775" version="1.1" inkscape:version="0.92.3 (2405546, 2018-03-11)" @@ -100,8 +100,8 @@ id="namedview4913" showgrid="true" inkscape:zoom="5.2149126" - inkscape:cx="-45.137344" - inkscape:cy="72.509528" + inkscape:cx="-63.677407" + inkscape:cy="76.536441" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="0" @@ -120,32 +120,32 @@ </sodipodi:namedview> <g id="g4777" - transform="translate(0,16)"> + transform="translate(0,32)"> <path - d="m 3,4 h 10 v 9.008 C 13,14.1082 12.11257,15 11.0004,15 H 4.9996 C 3.8952,15 3,14.09982 3,13.008 V 4 z M 2,2 H 14 V 3 H 2 V 2 z M 5,1 h 6 V 2 H 5 V 1 z" + d="m 3,4 h 10 v 9.008 C 13,14.1082 12.11257,15 11.0004,15 H 4.9996 C 3.8952,15 3,14.09982 3,13.008 Z M 2,2 H 14 V 3 H 2 Z M 5,1 h 6 V 2 H 5 Z" id="path4781" inkscape:connector-curvature="0" style="fill:#212121" /> </g> <g - transform="translate(16,16)" + transform="translate(16,32)" id="g4783"> <path - d="M 13.526,6.25 H 12.0523 V 5.5 c 0,-0.414 -0.33011,-0.75 -0.73684,-0.75 H 9.84176 V 4 c 0,-0.414 -0.33011,-0.75 -0.73684,-0.75 H 8.36808 V 1.75 C 8.36808,1.423 8.16029,1.153 7.87366,1.0495 7.81987,1.021 7.74913,1 7.63124,1 c -3.6628,0 -6.6316,3.0218 -6.6316,6.75 0,3.7275 2.9687,6.75 6.6316,6.75 3.6629,0 6.6316,-3.0225 6.6316,-6.75 V 7 c 0,-0.414 -0.3301,-0.75 -0.73684,-0.75 z M 3.5786,8.5 C 2.96784,8.5 2.4733,7.99667 2.4733,7.375 2.4733,6.75333 2.9678,6.25 3.5786,6.25 4.1894,6.25 4.6839,6.75333 4.6839,7.375 4.6839,7.99667 4.1894,8.5 3.5786,8.5 z M 4.6839,4.375 c 0,-0.62175 0.49516,-1.125 1.1053,-1.125 0.61084,0 1.1053,0.50325 1.1053,1.125 C 6.8945,4.996 6.40008,5.5 5.7892,5.5 5.17909,5.5 4.6839,4.996 4.6839,4.375 z M 6.8944,13 c -0.61059,0 -1.1053,-0.50334 -1.1053,-1.1246 0,-0.62129 0.49467,-1.1254 1.1053,-1.1254 0.61063,0 1.1053,0.50409 1.1053,1.1254 C 7.9997,12.49668 7.50503,13 6.8944,13 z M 7.26282,9.25 C 6.65271,9.25 6.15752,8.746 6.15752,8.125 6.15752,7.504 6.65268,7 7.26282,7 c 0.61014,0 1.1053,0.504 1.1053,1.125 0,0.621 -0.49516,1.125 -1.1053,1.125 z m 3.6842,1.5 c -0.6101,0 -1.1053,-0.504 -1.1053,-1.125 0,-0.621 0.49516,-1.125 1.1053,-1.125 0.61011,0 1.1053,0.504 1.1053,1.125 0,0.621 -0.49516,1.125 -1.1053,1.125 z" + d="M 13.526,6.25 H 12.0523 V 5.5 c 0,-0.414 -0.33011,-0.75 -0.73684,-0.75 H 9.84176 V 4 c 0,-0.414 -0.33011,-0.75 -0.73684,-0.75 H 8.36808 V 1.75 C 8.36808,1.423 8.16029,1.153 7.87366,1.0495 7.81987,1.021 7.74913,1 7.63124,1 c -3.6628,0 -6.6316,3.0218 -6.6316,6.75 0,3.7275 2.9687,6.75 6.6316,6.75 3.6629,0 6.6316,-3.0225 6.6316,-6.75 V 7 c 0,-0.414 -0.3301,-0.75 -0.73684,-0.75 z M 3.5786,8.5 C 2.96784,8.5 2.4733,7.99667 2.4733,7.375 2.4733,6.75333 2.9678,6.25 3.5786,6.25 4.1894,6.25 4.6839,6.75333 4.6839,7.375 4.6839,7.99667 4.1894,8.5 3.5786,8.5 Z M 4.6839,4.375 c 0,-0.62175 0.49516,-1.125 1.1053,-1.125 0.61084,0 1.1053,0.50325 1.1053,1.125 C 6.8945,4.996 6.40008,5.5 5.7892,5.5 5.17909,5.5 4.6839,4.996 4.6839,4.375 Z M 6.8944,13 c -0.61059,0 -1.1053,-0.50334 -1.1053,-1.1246 0,-0.62129 0.49467,-1.1254 1.1053,-1.1254 0.61063,0 1.1053,0.50409 1.1053,1.1254 C 7.9997,12.49668 7.50503,13 6.8944,13 Z M 7.26282,9.25 C 6.65271,9.25 6.15752,8.746 6.15752,8.125 6.15752,7.504 6.65268,7 7.26282,7 c 0.61014,0 1.1053,0.504 1.1053,1.125 0,0.621 -0.49516,1.125 -1.1053,1.125 z m 3.6842,1.5 c -0.6101,0 -1.1053,-0.504 -1.1053,-1.125 0,-0.621 0.49516,-1.125 1.1053,-1.125 0.61011,0 1.1053,0.504 1.1053,1.125 0,0.621 -0.49516,1.125 -1.1053,1.125 z" id="path4787" inkscape:connector-curvature="0" style="fill:#212121" /> </g> <g - transform="translate(32,16)" + transform="translate(32,32)" id="g4789"> <path - d="M 8,6 C 11.3137,6 14,5.10457 14,4 14,2.89543 11.3137,2 8,2 4.6863,2 2,2.89543 2,4 2,5.10457 4.6863,6 8,6 z m -6,7 c 0,1.1046 2.6863,2 6,2 3.3137,0 6,-0.89543 6,-2 v -2 c 0,1.1046 -2.6863,2 -6,2 -3.3137,0 -6,-0.89543 -6,-2 v 2 z m 0,-3 c 0,1.1046 2.6863,2 6,2 3.3137,0 6,-0.89543 6,-2 V 8 C 14,9.1046 11.3137,10 8,10 4.6863,10 2,9.10457 2,8 v 2 z M 2,7 c 0,1.1046 2.6863,2 6,2 3.3137,0 6,-0.89543 6,-2 V 5 C 14,6.1046 11.3137,7 8,7 4.6863,7 2,6.10457 2,5 v 2 z" + d="M 8,6 C 11.3137,6 14,5.10457 14,4 14,2.89543 11.3137,2 8,2 4.6863,2 2,2.89543 2,4 2,5.10457 4.6863,6 8,6 Z m -6,7 c 0,1.1046 2.6863,2 6,2 3.3137,0 6,-0.89543 6,-2 v -2 c 0,1.1046 -2.6863,2 -6,2 -3.3137,0 -6,-0.89543 -6,-2 z m 0,-3 c 0,1.1046 2.6863,2 6,2 3.3137,0 6,-0.89543 6,-2 V 8 C 14,9.1046 11.3137,10 8,10 4.6863,10 2,9.10457 2,8 Z M 2,7 c 0,1.1046 2.6863,2 6,2 3.3137,0 6,-0.89543 6,-2 V 5 C 14,6.1046 11.3137,7 8,7 4.6863,7 2,6.10457 2,5 Z" id="path4793" inkscape:connector-curvature="0" /> </g> <g - transform="translate(48,16)" + transform="translate(48,32)" id="g4795"> <g id="g4799"> @@ -153,12 +153,12 @@ id="g4801" style="fill:none"> <path - d="M 0,0 H 16 V 16 H 0 z" + d="M 0,0 H 16 V 16 H 0 Z" id="path4803" inkscape:connector-curvature="0" /> <path transform="translate(3,1)" - d="M 6,0 H 0.9954 C 0.45567,0 0,0.45078 0,1.0068 v 11.986 c 0,0.5569 0.44565,1.0068 0.9954,1.0068 H 9.0046 C 9.54433,13.9996 10,13.54882 10,12.9928 V 3.9996 l -4,-4 z M 9.29,4 H 6 V 0.71 L 9.29,4 z" + d="M 6,0 H 0.9954 C 0.45567,0 0,0.45078 0,1.0068 v 11.986 c 0,0.5569 0.44565,1.0068 0.9954,1.0068 H 9.0046 C 9.54433,13.9996 10,13.54882 10,12.9928 V 3.9996 l -4,-4 z M 9.29,4 H 6 V 0.71 Z" id="path4805" inkscape:connector-curvature="0" style="fill:#000000" /> @@ -166,34 +166,34 @@ </g> </g> <g - transform="translate(0,32)" + transform="translate(0,48)" id="g4807"> <path - d="M 6.5,3.2289 V 1 h 3 v 2.2289 c 0.70763,0.22225 1.3475,0.59759 1.8807,1.0872 l 1.9315,-1.1151 1.5,2.5981 -1.9305,1.1146 c 0.07749,0.34976 0.11835,0.71329 0.11835,1.0864 0,0.37311 -0.04086,0.73661 -0.11835,1.0864 l 1.9305,1.1146 -1.5,2.5981 -1.9315,-1.1151 C 10.84746,12.17371 10.2076,12.54904 9.5,12.7713 v 2.2289 h -3 V 12.7713 C 5.79237,12.54905 5.1525,12.17371 4.6193,11.6841 l -1.9315,1.1151 -1.5,-2.5981 1.9305,-1.1146 C 3.04081,8.73674 2.99995,8.37321 2.99995,8.0001 2.99995,7.62699 3.04081,7.26349 3.1183,6.9137 L 1.1878,5.7991 2.6878,3.201 4.6193,4.3161 C 5.15253,3.82649 5.7924,3.45116 6.5,3.2289 z M 8,10.5 C 9.3807,10.5 10.5,9.3807 10.5,8 10.5,6.6193 9.3807,5.5 8,5.5 6.6193,5.5 5.5,6.6193 5.5,8 c 0,1.3807 1.1193,2.5 2.5,2.5 z" + d="M 6.5,3.2289 V 1 h 3 v 2.2289 c 0.70763,0.22225 1.3475,0.59759 1.8807,1.0872 l 1.9315,-1.1151 1.5,2.5981 -1.9305,1.1146 c 0.07749,0.34976 0.11835,0.71329 0.11835,1.0864 0,0.37311 -0.04086,0.73661 -0.11835,1.0864 l 1.9305,1.1146 -1.5,2.5981 -1.9315,-1.1151 C 10.84746,12.17371 10.2076,12.54904 9.5,12.7713 v 2.2289 h -3 V 12.7713 C 5.79237,12.54905 5.1525,12.17371 4.6193,11.6841 l -1.9315,1.1151 -1.5,-2.5981 1.9305,-1.1146 C 3.04081,8.73674 2.99995,8.37321 2.99995,8.0001 2.99995,7.62699 3.04081,7.26349 3.1183,6.9137 L 1.1878,5.7991 2.6878,3.201 4.6193,4.3161 C 5.15253,3.82649 5.7924,3.45116 6.5,3.2289 Z M 8,10.5 C 9.3807,10.5 10.5,9.3807 10.5,8 10.5,6.6193 9.3807,5.5 8,5.5 6.6193,5.5 5.5,6.6193 5.5,8 c 0,1.3807 1.1193,2.5 2.5,2.5 z" id="path4811" inkscape:connector-curvature="0" style="fill:#212121" /> </g> <g - transform="translate(16,32)" + transform="translate(16,48)" id="g4813"> <path - d="M 2,3.999 C 2,3.44729 2.45098,3.00004 2.99078,3.00004 h 5.0092 v 3 h -6 v -2.001 z M 2,11 h 6 v 3 H 2.9908 C 2.44361,14 2.00002,13.55734 2.00002,13.00104 v -2.001 z M 2,7 h 6 v 3 H 2 V 7 z M 9,3 h 5.0092 c 0.54719,0 0.99078,0.44266 0.99078,0.99896 v 2.001 h -6 v -3 z m 0,8 h 6 v 2.001 c 0,0.55171 -0.45098,0.99896 -0.99078,0.99896 h -5.0092 v -3 z M 9,7 h 6 v 3 H 9 V 7 z" + d="M 2,3.999 C 2,3.44729 2.45098,3.00004 2.99078,3.00004 h 5.0092 v 3 h -6 v -2.001 z M 2,11 h 6 v 3 H 2.9908 C 2.44361,14 2.00002,13.55734 2.00002,13.00104 v -2.001 z M 2,7 h 6 v 3 H 2 Z M 9,3 h 5.0092 c 0.54719,0 0.99078,0.44266 0.99078,0.99896 v 2.001 h -6 v -3 z m 0,8 h 6 v 2.001 c 0,0.55171 -0.45098,0.99896 -0.99078,0.99896 h -5.0092 v -3 z M 9,7 h 6 v 3 H 9 Z" id="path4817" inkscape:connector-curvature="0" style="fill:#212121" /> </g> <g - transform="translate(34,34)" + transform="translate(34,50)" id="g4819"> <path transform="matrix(1.1,0,0,1.1,-3.3,-3.3)" - d="m 8,13 c 2.7614,0 5,-2.2386 5,-5 C 13,5.2386 10.7614,3 8,3 5.2386,3 3,5.2386 3,8 c 0,2.7614 2.2386,5 5,5 z M 8,11 V 9 H 5 V 7 H 8 V 5 l 3,3 -3,3 z" + d="m 8,13 c 2.7614,0 5,-2.2386 5,-5 C 13,5.2386 10.7614,3 8,3 5.2386,3 3,5.2386 3,8 c 0,2.7614 2.2386,5 5,5 z M 8,11 V 9 H 5 V 7 H 8 V 5 l 3,3 z" id="path4823" inkscape:connector-curvature="0" /> </g> <g - transform="translate(50,33)" + transform="translate(50,49)" id="g4825"> <g transform="translate(-76,-24)" @@ -204,10 +204,6 @@ cy="11.5" r="2.5" id="circle4831" - sodipodi:cx="10.5" - sodipodi:cy="11.5" - sodipodi:rx="2.5" - sodipodi:ry="2.5" style="fill:#009802" /> <path d="m 78,25 c -0.54399,0 -1,0.45026 -1,1 v 8 c 0,0.53973 0.44936,1 1,1 h 3.0312 c -0.02335,-0.1633 -0.03125,-0.33024 -0.03125,-0.5 0,-0.16976 0.0079,-0.3367 0.03125,-0.5 H 78 v -8 h 3 v 3 h 3 v 1.5 c 0.1633,-0.02335 0.33024,0 0.5,0 0.16976,0 0.3367,-0.02335 0.5,0 V 28 l -3,-3 z m 4,1 2,2 h -2 z" @@ -216,16 +212,16 @@ </g> </g> <g - transform="translate(2,49)" + transform="translate(2,65)" id="g4835"> <path transform="translate(-65.625,-24.5)" - d="m 71.625,25.5 h -4.003 c -0.54399,0 -0.99703,0.44566 -0.99703,0.9954 v 8.0092 c 0,0.53973 0.44639,0.9954 0.99703,0.9954 h 6.0059 c 0.54399,0 0.99703,-0.44566 0.99703,-0.9954 V 28.5 l -3,-3 z m 0,1 2,2 h -2 v -2 z m -4,0 h 3 v 3 h 3 v 5 h -6 v -8 z" + d="m 71.625,25.5 h -4.003 c -0.54399,0 -0.99703,0.44566 -0.99703,0.9954 v 8.0092 c 0,0.53973 0.44639,0.9954 0.99703,0.9954 h 6.0059 c 0.54399,0 0.99703,-0.44566 0.99703,-0.9954 V 28.5 l -3,-3 z m 0,1 2,2 h -2 z m -4,0 h 3 v 3 h 3 v 5 h -6 z" id="path4839" inkscape:connector-curvature="0" /> </g> <g - transform="translate(17,49)" + transform="translate(17,65)" id="g4841"> <path transform="translate(-160,-96)" @@ -235,19 +231,19 @@ style="fill:#9f9f9f" /> <path transform="translate(-160,-96)" - d="m 170,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="m 170,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4847" inkscape:connector-curvature="0" style="fill-opacity:0.36000001" /> <path transform="translate(-160,-96)" - d="M 170,99.93 169.07,99 166.5,101.57 163.93,99 163,99.93 l 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="M 170,99.93 169.07,99 166.5,101.57 163.93,99 163,99.93 l 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4849" inkscape:connector-curvature="0" style="fill:#ffffff" /> </g> <g - transform="translate(33,49)" + transform="translate(33,65)" id="g4851"> <path transform="translate(-143,-96)" @@ -257,19 +253,19 @@ style="fill:#bebebe" /> <path transform="translate(-143,-96)" - d="m 153,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="m 153,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4857" inkscape:connector-curvature="0" style="fill-opacity:0.37000002" /> <path transform="translate(-143,-96)" - d="M 153,99.93 152.07,99 149.5,101.57 146.93,99 146,99.93 l 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="M 153,99.93 152.07,99 149.5,101.57 146.93,99 146,99.93 l 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4859" inkscape:connector-curvature="0" style="fill:#ffffff" /> </g> <g - transform="translate(49,49)" + transform="translate(49,65)" id="g4861"> <path transform="translate(-111,-96)" @@ -285,13 +281,13 @@ style="fill:#f27d82" /> <path transform="translate(-111,-96)" - d="m 121.5,100.93 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="m 121.5,100.93 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4869" inkscape:connector-curvature="0" style="fill-opacity:0.36000001" /> <path transform="translate(-111,-96)" - d="m 121.5,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="m 121.5,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4871" inkscape:connector-curvature="0" style="fill:#ffffff" /> @@ -317,7 +313,7 @@ </defs> </g> <g - transform="translate(1,65)" + transform="translate(1,81)" id="g4881"> <path transform="translate(-96,-96)" @@ -333,13 +329,13 @@ style="fill:url(#sprite13_b)" /> <path transform="translate(-96,-96)" - d="m 106.5,100.93 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="m 106.5,100.93 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4889" inkscape:connector-curvature="0" style="fill:#993c35" /> <path transform="translate(-96,-96)" - d="m 106.5,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 2.57,-2.57 z" + d="m 106.5,100.43 -0.93,-0.93 -2.57,2.57 -2.57,-2.57 -0.93,0.93 2.57,2.57 -2.57,2.57 0.93,0.93 2.57,-2.57 2.57,2.57 0.93,-0.93 -2.57,-2.57 z" id="path4891" inkscape:connector-curvature="0" style="fill:#ffffff" /> @@ -351,7 +347,7 @@ x2="109.5" y1="103" y2="103" - gradientTransform="matrix(0,1,-1,0,206,0)" + gradientTransform="rotate(90,103,103)" gradientUnits="userSpaceOnUse" xlink:href="#sprite13_q" /> <linearGradient @@ -371,7 +367,7 @@ x2="127" y1="104" y2="104" - gradientTransform="matrix(0,1,-1,0,207,-17)" + gradientTransform="rotate(90,112,95)" gradientUnits="userSpaceOnUse" xlink:href="#sprite13_r" /> <linearGradient @@ -388,7 +384,7 @@ </defs> </g> <g - transform="translate(18,66)" + transform="translate(18,82)" id="g4907"> <path transform="translate(-234,-30)" @@ -401,121 +397,121 @@ xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="-11.403088" - y="75.207672" + y="91.207672" id="text4355"><tspan sodipodi:role="line" id="tspan4357" x="-11.403088" - y="75.207672" + y="91.207672" style="font-size:10px;line-height:1.25;font-family:sans-serif">1</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="-11.144299" - y="59.675297" + y="75.675293" id="text4355-8"><tspan sodipodi:role="line" id="tspan4357-8" x="-11.144299" - y="59.675297" + y="75.675293" style="font-size:10px;line-height:1.25;font-family:sans-serif">2</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="-11.066174" - y="44.142918" + y="60.142918" id="text4355-4"><tspan sodipodi:role="line" id="tspan4357-3" x="-11.066174" - y="44.142918" + y="60.142918" style="font-size:10px;line-height:1.25;font-family:sans-serif">3</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="-11.266369" - y="28.610538" + y="44.610538" id="text4355-1"><tspan sodipodi:role="line" id="tspan4357-4" x="-11.266369" - y="28.610538" + y="44.610538" style="font-size:10px;line-height:1.25;font-family:sans-serif">4</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="5.9353299" - y="92.082359" + y="108.08236" id="text4355-9"><tspan sodipodi:role="line" id="tspan4357-2" x="5.9353299" - y="92.082359" + y="108.08236" style="font-size:10px;line-height:1.25;font-family:sans-serif">a</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="21.659466" - y="92.082359" + y="108.08236" id="text4355-0"><tspan sodipodi:role="line" id="tspan4357-6" x="21.659466" - y="92.082359" + y="108.08236" style="font-size:10px;line-height:1.25;font-family:sans-serif">b</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="37.383606" - y="92.082359" + y="108.08236" id="text4355-89"><tspan sodipodi:role="line" id="tspan4357-26" x="37.383606" - y="92.082359" + y="108.08236" style="font-size:10px;line-height:1.25;font-family:sans-serif">c</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none" x="53.107742" - y="92.082359" + y="108.08236" id="text4355-6"><tspan sodipodi:role="line" id="tspan4357-49" x="53.107742" - y="92.082359" + y="108.08236" style="font-size:10px;line-height:1.25;font-family:sans-serif">d</tspan></text> <g style="fill:none;stroke:none" id="g6346" - transform="translate(32,64)"> + transform="translate(32,80)"> <polygon - points="0,0 16,0 16,16 0,16 " + points="16,16 0,16 0,0 16,0 " id="polygon6348" /> <path style="fill:#000000" inkscape:connector-curvature="0" id="path6350" - d="M 8,1 C 4.136,1 1,4.136 1,8 c 0,3.864 3.136,7 7,7 3.864,0 7,-3.136 7,-7 C 15,4.136 11.864,1 8,1 L 8,1 z M 2.5,8 C 2.5,4.968125 4.968125,2.5 8,2.5 c 3.031875,0 5.5,2.468125 5.5,5.5 0,3.031875 -2.468125,5.5 -5.5,5.5 C 4.968125,13.5 2.5,11.031875 2.5,8 z M 9,12 9,7 7,7 7,12 9,12 z M 7,6 9,6 9,4 7,4 7,6 7,6 z" /> + d="M 8,1 C 4.136,1 1,4.136 1,8 c 0,3.864 3.136,7 7,7 3.864,0 7,-3.136 7,-7 C 15,4.136 11.864,1 8,1 Z M 2.5,8 C 2.5,4.968125 4.968125,2.5 8,2.5 c 3.031875,0 5.5,2.468125 5.5,5.5 0,3.031875 -2.468125,5.5 -5.5,5.5 C 4.968125,13.5 2.5,11.031875 2.5,8 Z M 9,12 V 7 H 7 v 5 z M 7,6 H 9 V 4 H 7 Z" /> </g> <g id="g4443-7" - transform="matrix(1.3997356,0,0,1.3934295,65.053843,65.020556)" + transform="matrix(1.3997356,0,0,1.3934295,65.053843,81.020556)" mask="url(#path4453-6-mask)"> <path - transform="translate(-60,0)" + transform="translate(-60)" d="m 61,9 4,-8 4,8 z" id="path4447-5" inkscape:connector-curvature="0" style="stroke:#c19600;stroke-width:2;stroke-linejoin:round" /> <path - transform="translate(-60,0)" + transform="translate(-60)" d="m 61,9 4,-8 4,8 z" id="path4449-3" inkscape:connector-curvature="0" style="fill:#f4bd00;stroke:#f5bd00;stroke-width:1.5;stroke-linejoin:round" /> <path - transform="translate(-60,0)" + transform="translate(-60)" d="m 63.75,2.75 h 2.5 v 2.5 L 65.75,7 h -1.5 l -0.5,-1.75 v -2.5 m 0,5.25 h 2.5 v 1.25 h -2.5" id="path4451-5" inkscape:connector-curvature="0" @@ -523,7 +519,7 @@ <mask id="path4453-6-mask"> <path - transform="translate(-60,0)" + transform="translate(-60)" d="m 64,3 h 2 V 5.25 L 65.5,7 h -1 L 64,5.25 V 3 m 0,5 h 2 v 1 h -2" id="path4453-6" inkscape:connector-curvature="0" @@ -539,16 +535,16 @@ </g> <g id="g4279-7" - transform="matrix(1.36,0,0,1.34,65.3,49.5)" + transform="matrix(1.36,0,0,1.34,65.3,65.5)" mask="url(#path4287-3-mask)"> <path - transform="translate(-80,0)" + transform="translate(-80)" d="m 85,-4.7795e-7 c -2.76,0 -5,2.23999997795 -5,4.99999997795 0,2.76 2.24,5 5,5 2.76,0 5,-2.24 5,-5 C 90,2.2399995 87.76,-4.7795e-7 85,-4.7795e-7" id="path4283-0" inkscape:connector-curvature="0" style="fill:url(#linearGradient5057)" /> <path - transform="translate(-80,0)" + transform="translate(-80)" d="m 80.36,5 c 0,2.56 2.08,4.64 4.64,4.64 2.56,0 4.64,-2.08 4.64,-4.64 0,-2.56 -2.08,-4.64 -4.64,-4.64 -2.56,0 -4.64,2.08 -4.64,4.64" id="path4285-9" inkscape:connector-curvature="0" @@ -556,8 +552,8 @@ <mask id="path4287-3-mask"> <path - transform="translate(-80,0)" - d="m 83.93,2.14 c -0.03,-0.53 0.55,-0.97 1.06,-0.83 0.5,0.12 0.79,0.73 0.56,1.18 -0.2,0.44 -0.79,0.61 -1.2,0.36 C 84.09,2.71 83.93,2.43 83.93,2.14 z m 1.7,5.46 H 86.3 V 8.13 H 83.41 V 7.6 h 0.66 V 3.99 H 83.41 V 3.46 h 2.22 V 7.6 z" + transform="translate(-80)" + d="m 83.93,2.14 c -0.03,-0.53 0.55,-0.97 1.06,-0.83 0.5,0.12 0.79,0.73 0.56,1.18 -0.2,0.44 -0.79,0.61 -1.2,0.36 C 84.09,2.71 83.93,2.43 83.93,2.14 Z m 1.7,5.46 H 86.3 V 8.13 H 83.41 V 7.6 h 0.66 V 3.99 H 83.41 V 3.46 h 2.22 z" id="path4287-3" inkscape:connector-curvature="0" style="fill:#000000" /> @@ -595,16 +591,16 @@ </g> <g id="g4221-1" - transform="matrix(1.37,0,0,1.36,65.2,33.3)" + transform="matrix(1.37,0,0,1.36,65.2,49.3)" mask="url(#path4229-9-path4231-2-mask)"> <path - transform="translate(-20,0)" + transform="translate(-20)" d="m 25,-4.7795e-7 c -2.76,0 -5,2.23999997795 -5,4.99999997795 0,2.76 2.24,5 5,5 2.76,0 5,-2.24 5,-5 C 30,2.2399995 27.76,-4.7795e-7 25,-4.7795e-7" id="path4225-8" inkscape:connector-curvature="0" style="fill:url(#linearGradient5055)" /> <path - transform="translate(-20,0)" + transform="translate(-20)" d="m 20.36,5 c 0,2.56 2.08,4.64 4.64,4.64 2.56,0 4.64,-2.08 4.64,-4.64 0,-2.56 -2.08,-4.64 -4.64,-4.64 -2.56,0 -4.64,2.08 -4.64,4.64" id="path4227-7" inkscape:connector-curvature="0" @@ -612,13 +608,13 @@ <mask id="path4229-9-path4231-2-mask"> <path - transform="translate(-20,0)" + transform="translate(-20)" d="m 23,3 4,4" id="path4229-9" inkscape:connector-curvature="0" style="stroke:#000000" /> <path - transform="translate(-20,0)" + transform="translate(-20)" d="M 27,3 23,7" id="path4231-2" inkscape:connector-curvature="0" @@ -655,14 +651,14 @@ <g style="fill:#000000" id="g9271" - transform="matrix(0.66666667,0,0,0.66666667,64,16)"> + transform="matrix(0.66666667,0,0,0.66666667,64,32)"> <path id="path9261" - d="M 12,2 C 6.48,2 2,6.48 2,12 2,17.52 6.48,22 12,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 12,2 z m 0,3 c 1.66,0 3,1.34 3,3 0,1.66 -1.34,3 -3,3 C 10.34,11 9,9.66 9,8 9,6.34 10.34,5 12,5 z m 0,14.2 c -2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22 z" + d="M 12,2 C 6.48,2 2,6.48 2,12 2,17.52 6.48,22 12,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 12,2 Z m 0,3 c 1.66,0 3,1.34 3,3 0,1.66 -1.34,3 -3,3 C 10.34,11 9,9.66 9,8 9,6.34 10.34,5 12,5 Z m 0,14.2 c -2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22 z" inkscape:connector-curvature="0" /> <path id="path9263" - d="M 0,0 H 24 V 24 H 0 z" + d="M 0,0 H 24 V 24 H 0 Z" inkscape:connector-curvature="0" style="fill:none" /> </g> @@ -670,56 +666,56 @@ xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0.37333332;stroke:none" x="-10.738436" - y="12.11775" + y="28.11775" id="text5090"><tspan sodipodi:role="line" id="tspan5092" x="-10.738436" - y="12.11775" + y="28.11775" style="font-size:10px;line-height:1.25;font-family:sans-serif">5</tspan></text> <text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0.35111114;stroke:none" x="68.649277" - y="91.69722" + y="107.69722" id="text5862"><tspan sodipodi:role="line" id="tspan5864" x="68.649277" - y="91.69722" + y="107.69722" style="font-size:10px;line-height:1.25;font-family:sans-serif">e</tspan></text> <g style="fill:#000000" id="g5994" - transform="matrix(0.75,0,0,0.75,63,-1)"> + transform="matrix(0.75,0,0,0.75,63,15)"> <path id="path5984" - d="M 3,13 H 5 V 11 H 3 v 2 z m 0,4 H 5 V 15 H 3 v 2 z M 3,9 H 5 V 7 H 3 v 2 z m 4,4 H 21 V 11 H 7 v 2 z m 0,4 H 21 V 15 H 7 v 2 z M 7,7 V 9 H 21 V 7 H 7 z" + d="M 3,13 H 5 V 11 H 3 Z m 0,4 H 5 V 15 H 3 Z M 3,9 H 5 V 7 H 3 Z m 4,4 H 21 V 11 H 7 Z m 0,4 H 21 V 15 H 7 Z M 7,7 V 9 H 21 V 7 Z" inkscape:connector-curvature="0" /> <path id="path5986" - d="M 0,0 H 24 V 24 H 0 z" + d="M 0,0 H 24 V 24 H 0 Z" inkscape:connector-curvature="0" style="fill:none" /> </g> <g style="fill:#000000" id="g6079" - transform="matrix(0.75,0,0,0.75,47,63)"> + transform="matrix(0.75,0,0,0.75,47,79)"> <path id="path6069" - d="M 0,0 H 24 V 24 H 0 z" + d="M 0,0 H 24 V 24 H 0 Z" inkscape:connector-curvature="0" style="fill:none" /> <path id="path6071" - d="M 20,8 H 17.19 C 16.74,7.22 16.12,6.55 15.37,6.04 L 17,4.41 15.59,3 13.42,5.17 C 12.96,5.06 12.49,5 12,5 11.51,5 11.04,5.06 10.59,5.17 L 8.41,3 7,4.41 8.62,6.04 C 7.88,6.55 7.26,7.22 6.81,8 H 4 v 2 H 6.09 C 6.04,10.33 6,10.66 6,11 v 1 H 4 v 2 h 2 v 1 c 0,0.34 0.04,0.67 0.09,1 H 4 v 2 h 2.81 c 1.04,1.79 2.97,3 5.19,3 2.22,0 4.15,-1.21 5.19,-3 H 20 V 16 H 17.91 C 17.96,15.67 18,15.34 18,15 v -1 h 2 v -2 h -2 v -1 c 0,-0.34 -0.04,-0.67 -0.09,-1 H 20 V 8 z m -6,8 h -4 v -2 h 4 v 2 z m 0,-4 h -4 v -2 h 4 v 2 z" + d="M 20,8 H 17.19 C 16.74,7.22 16.12,6.55 15.37,6.04 L 17,4.41 15.59,3 13.42,5.17 C 12.96,5.06 12.49,5 12,5 11.51,5 11.04,5.06 10.59,5.17 L 8.41,3 7,4.41 8.62,6.04 C 7.88,6.55 7.26,7.22 6.81,8 H 4 v 2 H 6.09 C 6.04,10.33 6,10.66 6,11 v 1 H 4 v 2 h 2 v 1 c 0,0.34 0.04,0.67 0.09,1 H 4 v 2 h 2.81 c 1.04,1.79 2.97,3 5.19,3 2.22,0 4.15,-1.21 5.19,-3 H 20 V 16 H 17.91 C 17.96,15.67 18,15.34 18,15 v -1 h 2 v -2 h -2 v -1 c 0,-0.34 -0.04,-0.67 -0.09,-1 H 20 Z m -6,8 h -4 v -2 h 4 z m 0,-4 h -4 v -2 h 4 z" inkscape:connector-curvature="0" /> </g> <g style="fill:none;stroke:none" id="g6340" - transform="translate(48,0)"> + transform="translate(48,16)"> <rect style="opacity:0.2" height="16" @@ -731,39 +727,39 @@ style="fill:#000000" inkscape:connector-curvature="0" id="path6344" - d="m 0.5,14 15,0 L 8,1 0.5,14 l 0,0 z m 8.5,-2 -2,0 0,-2 2,0 0,2 0,0 z M 9,9 7,9 7,6 9,6 9,9 9,9 z" /> + d="m 0.5,14 h 15 L 8,1 Z M 9,12 H 7 V 10 H 9 Z M 9,9 H 7 V 6 h 2 z" /> </g> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" x="32.469646" - y="7.902472" + y="23.902472" id="text3111"><tspan sodipodi:role="line" id="tspan3113" x="32.469646" - y="7.902472" + y="23.902472" style="font-weight:bold;font-size:10px;line-height:1.25;font-family:sans-serif">A</tspan></text> <text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" x="40.362782" - y="15.525424" + y="31.525425" id="text3115"><tspan sodipodi:role="line" id="tspan3117" x="40.362782" - y="15.525424" + y="31.525425" style="font-weight:bold;font-size:10px;line-height:1.25;font-family:sans-serif">B</tspan></text> <path - d="m 37.955041,13.088794 c -1.914609,-0.291809 -2.119489,-0.899233 -2.237,-4.129445 l -1.219783,0 c 0.04662,3.855641 0.06137,5.297137 5.735435,5.257508 l 0.316769,-0.01434 -2.595652,-2.995518 c -0.01446,0.611794 -0.01486,1.270551 2.31e-4,1.881795 z" + d="m 37.955041,29.088794 c -1.914609,-0.291809 -2.119489,-0.899233 -2.237,-4.129445 h -1.219783 c 0.04662,3.855641 0.06137,5.297137 5.735435,5.257508 l 0.316769,-0.01434 -2.595652,-2.995518 c -0.01446,0.611794 -0.01486,1.270551 2.31e-4,1.881795 z" id="path448" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccc" /> <g id="BackgroundSyncIcon" style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1" - transform="scale(0.32)"> + transform="matrix(0.32,0,0,0.32,0,16)"> <g id="Sync-Icon"> <rect @@ -781,11 +777,11 @@ d="m 21.939098,33.353403 4.42699,4.044699 C 23.680429,39.200531 20.460997,40.25 17,40.25 7.6111592,40.25 0,32.526912 0,23 c 0,-2.865443 0.68854129,-5.567703 1.9068985,-7.945722 3.722e-4,-7.26e-4 7.445e-4,-0.0015 0.00112,-0.0022 L 6.335865,19.097583 C 5.9027264,20.316125 5.6666667,21.63009 5.6666667,23 c 0,6.351275 5.0741063,11.5 11.3333333,11.5 1.770533,0 3.446239,-0.411971 4.939098,-1.146597 z m 5.704636,-6.394068 C 28.08984,25.724919 28.333333,24.391313 28.333333,23 28.333333,16.648725 23.259227,11.5 17,11.5 c -1.791763,0 -3.486411,0.42191 -4.992721,1.173162 L 7.5863091,8.6339629 C 10.281491,6.811921 13.518531,5.75 17,5.75 c 9.388841,0 17,7.723088 17,17.25 0,2.886982 -0.698932,5.60832 -1.934464,7.999293 z" inkscape:connector-curvature="0" /> <polygon - points="26.444444,28.75 17,37.375 26.444444,46 " + points="26.444444,46 26.444444,28.75 17,37.375 " transform="rotate(180,21.722222,37.375)" id="Shape" /> <polygon - points="17,0 7.5555556,8.625 17,17.25 " + points="17,17.25 17,0 7.5555556,8.625 " id="polygon4215" /> </g> </g> @@ -793,7 +789,7 @@ <g id="Page-1" style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1" - transform="matrix(0.66666667,0,0,0.66666667,17.333333,0.66666659)"> + transform="matrix(0.66666667,0,0,0.66666667,17.333333,16.666667)"> <g transform="translate(-2,-1)" id="3px-Fetch"> @@ -814,11 +810,11 @@ id="rect4301" style="fill:#000000" /> <polygon - points="7.5,1 2,7 6.125,7 8.875,7 13,7 " + points="13,7 7.5,1 2,7 6.125,7 8.875,7 " id="Path" style="fill:#000000;fill-rule:nonzero" /> <polygon - points="16.5,17 11,23 15.125,23 17.875,23 22,23 " + points="22,23 16.5,17 11,23 15.125,23 17.875,23 " transform="rotate(-180,16.5,20)" id="polygon4304" style="fill:#000000;fill-rule:nonzero" /> @@ -831,4 +827,49 @@ </g> </g> </g> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0.37333332;stroke:none" + x="-10.546678" + y="11.352402" + id="text5090-3"><tspan + sodipodi:role="line" + id="tspan5092-6" + x="-10.546678" + y="11.352402" + style="font-size:10px;line-height:1.25;font-family:sans-serif">6</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0.35111114;stroke:none" + x="85.724823" + y="108.23496" + id="text5862-7"><tspan + sodipodi:role="line" + id="tspan5864-5" + x="85.724823" + y="108.23496" + style="font-size:10px;line-height:1.25;font-family:sans-serif">f</tspan></text> + <g + style="fill:#000000" + id="g259" + transform="matrix(0.58333333,0,0,0.58333333,1,1.0000001)"> + <path + id="path245" + d="M 0,0 H 24 V 24 H 0 Z" + inkscape:connector-curvature="0" + style="fill:none" /> + <path + id="path247" + d="M 19.35,10.04 C 18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14 c 0,3.31 2.69,6 6,6 h 13 c 2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96 z" + inkscape:connector-curvature="0" /> + </g> + <g + style="fill:#000000" + id="g320" + transform="matrix(0.71794872,0,0,0.71794872,15.428205,-0.79487184)"> + <path + id="path309" + d="m 12,22 c 1.1,0 2,-0.9 2,-2 h -4 c 0,1.1 0.89,2 2,2 z m 6,-6 V 11 C 18,7.93 16.36,5.36 13.5,4.68 V 4 C 13.5,3.17 12.83,2.5 12,2.5 11.17,2.5 10.5,3.17 10.5,4 V 4.68 C 7.63,5.36 6,7.92 6,11 v 5 l -2,2 v 1 h 16 v -1 z" + inkscape:connector-curvature="0" /> + </g> </svg>
diff --git a/third_party/blink/renderer/devtools/front_end/Images/src/optimize_png.hashes b/third_party/blink/renderer/devtools/front_end/Images/src/optimize_png.hashes index 8f041d6..83ab1497 100644 --- a/third_party/blink/renderer/devtools/front_end/Images/src/optimize_png.hashes +++ b/third_party/blink/renderer/devtools/front_end/Images/src/optimize_png.hashes
@@ -5,7 +5,7 @@ "checkboxCheckmark.svg": "f039bf85cee42ad5c30ca3bfdce7912a", "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45", "smallIcons.svg": "40aefe4606ebba939725954ff9f908ef", - "mediumIcons.svg": "8bf2b48e8b9ff662567c52d2e466edf3", + "mediumIcons.svg": "e2878b1c2a8e27c52d146c8942a153cb", "breakpoint.svg": "69cd92d807259c022791112809b97799", "treeoutlineTriangles.svg": "2d26ab85d919f83d5021f2f385dffd0b", "chevrons.svg": "79b4b527771e30b6388ce664077b3409"
diff --git a/third_party/blink/renderer/devtools/front_end/Images/src/svg2png.hashes b/third_party/blink/renderer/devtools/front_end/Images/src/svg2png.hashes index 8f041d6..83ab1497 100644 --- a/third_party/blink/renderer/devtools/front_end/Images/src/svg2png.hashes +++ b/third_party/blink/renderer/devtools/front_end/Images/src/svg2png.hashes
@@ -5,7 +5,7 @@ "checkboxCheckmark.svg": "f039bf85cee42ad5c30ca3bfdce7912a", "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45", "smallIcons.svg": "40aefe4606ebba939725954ff9f908ef", - "mediumIcons.svg": "8bf2b48e8b9ff662567c52d2e466edf3", + "mediumIcons.svg": "e2878b1c2a8e27c52d146c8942a153cb", "breakpoint.svg": "69cd92d807259c022791112809b97799", "treeoutlineTriangles.svg": "2d26ab85d919f83d5021f2f385dffd0b", "chevrons.svg": "79b4b527771e30b6388ce664077b3409"
diff --git a/third_party/blink/renderer/devtools/front_end/ui/Icon.js b/third_party/blink/renderer/devtools/front_end/ui/Icon.js index 91d610e..0b17d41 100644 --- a/third_party/blink/renderer/devtools/front_end/ui/Icon.js +++ b/third_party/blink/renderer/devtools/front_end/ui/Icon.js
@@ -167,6 +167,8 @@ 'mediumicon-warning': {position: 'd5', spritesheet: 'mediumicons', isMask: true}, 'mediumicon-sync': {position: 'a5', spritesheet: 'mediumicons', isMask: true}, 'mediumicon-fetch': {position: 'b5', spritesheet: 'mediumicons', isMask: true}, + 'mediumicon-cloud': {position: 'a6', spritesheet: 'mediumicons', isMask: true}, + 'mediumicon-bell': {position: 'b6', spritesheet: 'mediumicons', isMask: true}, 'badge-navigator-file-sync': {position: 'a9', spritesheet: 'largeicons'}, 'largeicon-activate-breakpoints': {position: 'b9', spritesheet: 'largeicons', isMask: true},
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc b/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc index ef8ad00..f6bd94a 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc
@@ -84,9 +84,9 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *worklet->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(callback, CrossThreadUnretained(this), - CrossThreadUnretained(worklet.get()), - CrossThreadUnretained(&waitable_event))); + CrossThreadBindOnce(callback, CrossThreadUnretained(this), + CrossThreadUnretained(worklet.get()), + CrossThreadUnretained(&waitable_event))); waitable_event.Wait(); worklet->Terminate(); @@ -485,11 +485,11 @@ )JS"; PostCrossThreadTask( *worklet->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&AnimationWorkletGlobalScopeTest::RunScriptOnWorklet, - CrossThreadUnretained(this), - Passed(std::move(source_code)), - CrossThreadUnretained(worklet.get()), - CrossThreadUnretained(&waitable_event))); + CrossThreadBindOnce(&AnimationWorkletGlobalScopeTest::RunScriptOnWorklet, + CrossThreadUnretained(this), + Passed(std::move(source_code)), + CrossThreadUnretained(worklet.get()), + CrossThreadUnretained(&waitable_event))); waitable_event.Wait(); // AWGS should register itself first time an animator is registered with it.
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client.cc b/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client.cc index 5c07675bd..e49ed909 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client.cc +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client.cc
@@ -86,7 +86,7 @@ for (auto& mutator_item : mutator_items_) { PostCrossThreadTask( *mutator_item.mutator_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AnimationWorkletMutatorDispatcherImpl::SynchronizeAnimatorName, mutator_item.mutator_dispatcher, animator_name)); } @@ -118,10 +118,11 @@ for (auto& mutator_item : mutator_items_) { PostCrossThreadTask( *mutator_item.mutator_runner, FROM_HERE, - CrossThreadBind(&AnimationWorkletMutatorDispatcherImpl:: - RegisterAnimationWorkletMutator, - mutator_item.mutator_dispatcher, - WrapCrossThreadPersistent(this), global_scope_runner)); + CrossThreadBindOnce(&AnimationWorkletMutatorDispatcherImpl:: + RegisterAnimationWorkletMutator, + mutator_item.mutator_dispatcher, + WrapCrossThreadPersistent(this), + global_scope_runner)); } } @@ -132,10 +133,10 @@ for (auto& mutator_item : mutator_items_) { PostCrossThreadTask( *mutator_item.mutator_runner, FROM_HERE, - CrossThreadBind(&AnimationWorkletMutatorDispatcherImpl:: - UnregisterAnimationWorkletMutator, - mutator_item.mutator_dispatcher, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&AnimationWorkletMutatorDispatcherImpl:: + UnregisterAnimationWorkletMutator, + mutator_item.mutator_dispatcher, + WrapCrossThreadPersistent(this))); } } state_ = RunState::kDisposed;
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_test.cc b/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_test.cc index 82ac234..80131dda 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_test.cc +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_test.cc
@@ -82,7 +82,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *first_worklet->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AnimationWorkletProxyClientTest::AddGlobalScopeForTesting, CrossThreadUnretained(this), CrossThreadUnretained(first_worklet.get()), @@ -93,7 +93,7 @@ waitable_event.Reset(); PostCrossThreadTask( *second_worklet->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AnimationWorkletProxyClientTest::AddGlobalScopeForTesting, CrossThreadUnretained(this), CrossThreadUnretained(second_worklet.get()), @@ -103,7 +103,7 @@ PostCrossThreadTask( *first_worklet->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( callback, CrossThreadUnretained(this), CrossThreadPersistent<AnimationWorkletProxyClient>(proxy_client_), CrossThreadUnretained(&waitable_event)));
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.cc index e8150b40..699e28e 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.cc +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.cc
@@ -214,10 +214,11 @@ } } - PostCrossThreadTask(*task_runner, FROM_HERE, - CrossThreadBind(&BackgroundFetchIconLoader::RunCallback, - WrapCrossThreadPersistent(this), - ideal_to_chosen_icon_size_times_hundred)); + PostCrossThreadTask( + *task_runner, FROM_HERE, + CrossThreadBindOnce(&BackgroundFetchIconLoader::RunCallback, + WrapCrossThreadPersistent(this), + ideal_to_chosen_icon_size_times_hundred)); } void BackgroundFetchIconLoader::DidFail(const ResourceError& error) {
diff --git a/third_party/blink/renderer/modules/background_sync/sync_manager.cc b/third_party/blink/renderer/modules/background_sync/sync_manager.cc index 2fd5b3a3f..ac40268 100644 --- a/third_party/blink/renderer/modules/background_sync/sync_manager.cc +++ b/third_party/blink/renderer/modules/background_sync/sync_manager.cc
@@ -51,7 +51,7 @@ auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); ScriptPromise promise = resolver->Promise(); - GetBackgroundSyncServicePtr()->GetRegistrations( + GetBackgroundSyncServicePtr()->GetOneShotSyncRegistrations( registration_->RegistrationId(), WTF::Bind(&SyncManager::GetRegistrationsCallback, WrapPersistent(resolver))); @@ -131,7 +131,7 @@ case mojom::blink::BackgroundSyncError::NOT_ALLOWED: case mojom::blink::BackgroundSyncError::PERMISSION_DENIED: // These errors should never be returned from - // BackgroundSyncManager::GetRegistrations + // BackgroundSyncManager::GetOneShotSyncRegistrations NOTREACHED(); break; case mojom::blink::BackgroundSyncError::STORAGE:
diff --git a/third_party/blink/renderer/modules/clipboard/clipboard_writer.cc b/third_party/blink/renderer/modules/clipboard/clipboard_writer.cc index 760f0d8..6b4fdcb5 100644 --- a/third_party/blink/renderer/modules/clipboard/clipboard_writer.cc +++ b/third_party/blink/renderer/modules/clipboard/clipboard_writer.cc
@@ -47,7 +47,7 @@ PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ClipboardImageWriter::Write, /* This unretained is safe because the ClipboardImageWriter must remain alive when returning to its main thread. */ @@ -84,7 +84,7 @@ DCHECK(wtf_string.IsSafeToSendToAnotherThread()); PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ClipboardTextWriter::Write, /* This unretained is safe because the ClipboardTextWriter must remain alive when returning to its main thread. */
diff --git a/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc b/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc index 54e44c5..d92f850 100644 --- a/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc +++ b/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc
@@ -127,8 +127,6 @@ return CredentialManagerError::INVALID_DOMAIN; case blink::mojom::blink::AuthenticatorStatus::CREDENTIAL_EXCLUDED: return CredentialManagerError::CREDENTIAL_EXCLUDED; - case blink::mojom::blink::AuthenticatorStatus::CREDENTIAL_NOT_RECOGNIZED: - return CredentialManagerError::CREDENTIAL_NOT_RECOGNIZED; case blink::mojom::blink::AuthenticatorStatus::NOT_IMPLEMENTED: return CredentialManagerError::NOT_IMPLEMENTED; case blink::mojom::blink::AuthenticatorStatus::NOT_FOCUSED:
diff --git a/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc b/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc index 53534ce..9b4c3e3 100644 --- a/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc +++ b/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc
@@ -237,11 +237,6 @@ DOMExceptionCode::kInvalidStateError, "The user attempted to register an authenticator that contains one " "of the credentials already registered with the relying party."); - case CredentialManagerError::CREDENTIAL_NOT_RECOGNIZED: - return DOMException::Create(DOMExceptionCode::kInvalidStateError, - "The user attempted to use an authenticator " - "that recognized none of the provided " - "credentials."); case CredentialManagerError::NOT_IMPLEMENTED: return DOMException::Create(DOMExceptionCode::kNotSupportedError, "Not implemented");
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope_test.cc b/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope_test.cc index 393825a8..62db1ef 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope_test.cc +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope_test.cc
@@ -54,7 +54,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *worklet->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( callback, CrossThreadUnretained(this), CrossThreadUnretained(worklet.get()), CrossThreadPersistent<PaintWorkletProxyClient>(proxy_client_),
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.cc b/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.cc index 9efa0d91..3868da7b 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.cc +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.cc
@@ -112,7 +112,7 @@ passed_custom_properties.push_back(property.GetString()); PostCrossThreadTask( *main_thread_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &PaintWorklet::RegisterMainThreadDocumentPaintDefinition, paint_worklet_, name, definition->NativeInvalidationProperties(), WTF::Passed(std::move(passed_custom_properties)),
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client_test.cc b/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client_test.cc index 081c7722..6969ff34 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client_test.cc +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client_test.cc
@@ -71,7 +71,7 @@ PostCrossThreadTask( *worklet_threads[i]->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &PaintWorkletProxyClientTest::AddGlobalScopeOnWorkletThread, CrossThreadUnretained(this), CrossThreadUnretained(worklet_threads[i].get()), @@ -85,7 +85,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *worklet_threads[0]->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( callback, CrossThreadUnretained(worklet_threads[0].get()), CrossThreadPersistent<PaintWorkletProxyClient>(proxy_client_), CrossThreadUnretained(&waitable_event))); @@ -158,7 +158,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *worklet_thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &RunAddGlobalScopesTestOnWorklet, CrossThreadUnretained(worklet_thread.get()), CrossThreadPersistent<PaintWorkletProxyClient>(proxy_client_),
diff --git a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.cc b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.cc index bfe2b0e..2653e58 100644 --- a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.cc +++ b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.cc
@@ -56,7 +56,7 @@ void OnVideoFrameOnIOThread( SkImageDeliverCB callback, scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks current_time); private: @@ -72,7 +72,7 @@ void ImageCaptureFrameGrabber::SingleShotFrameHandler::OnVideoFrameOnIOThread( SkImageDeliverCB callback, scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks /* current_time */) { DCHECK(frame->format() == media::PIXEL_FORMAT_I420 || frame->format() == media::PIXEL_FORMAT_I420A);
diff --git a/third_party/blink/renderer/modules/media_controls/resources/modernMediaControls.css b/third_party/blink/renderer/modules/media_controls/resources/modernMediaControls.css index 830a2a0..20422c5 100644 --- a/third_party/blink/renderer/modules/media_controls/resources/modernMediaControls.css +++ b/third_party/blink/renderer/modules/media_controls/resources/modernMediaControls.css
@@ -927,6 +927,18 @@ text-overflow: ellipsis; } +label[pseudo="-internal-media-controls-text-track-list-item"] span { + line-height: normal; + overflow: hidden; + text-overflow: ellipsis; + /* + * We need to make sure the blue tick has enough space to render. The blue tick needs at least 18px + * so the max width the span can go is 200(text-track-list) - 58(left-padding of list-item) + * - 16(right-padding of list-item) -30(left and right margin of the checkbox) - 18(blue tick) = 78px + */ + max-width: 78px; +} + label[pseudo="-internal-media-controls-overflow-menu-list-item"] div span.subtitle { color: rgba(0,0,0,0.54); }
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc index a0445aa..ae74b94 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc
@@ -68,10 +68,10 @@ // Necessary callbacks and MOCK_METHODS for VideoCapturerSource. MOCK_METHOD2(DoOnDeliverFrame, - void(const scoped_refptr<media::VideoFrame>&, base::TimeTicks)); - void OnDeliverFrame(const scoped_refptr<media::VideoFrame>& video_frame, + void(scoped_refptr<media::VideoFrame>, base::TimeTicks)); + void OnDeliverFrame(scoped_refptr<media::VideoFrame> video_frame, base::TimeTicks estimated_capture_time) { - DoOnDeliverFrame(video_frame, estimated_capture_time); + DoOnDeliverFrame(std::move(video_frame), estimated_capture_time); } MOCK_METHOD1(DoOnRunning, void(bool)); @@ -88,12 +88,11 @@ return SkImage::MakeFromBitmap(testBitmap); } - void OnVerifyDeliveredFrame( - bool opaque, - int expected_width, - int expected_height, - const scoped_refptr<media::VideoFrame>& video_frame, - base::TimeTicks estimated_capture_time) { + void OnVerifyDeliveredFrame(bool opaque, + int expected_width, + int expected_height, + scoped_refptr<media::VideoFrame> video_frame, + base::TimeTicks estimated_capture_time) { if (opaque) EXPECT_EQ(media::PIXEL_FORMAT_I420, video_frame->format()); else
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc index 3094b3ca..f054ad08 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc
@@ -83,7 +83,7 @@ void DisconnectFromTrack() { MediaStreamVideoSink::DisconnectFromTrack(); } - void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame, + void OnVideoFrame(scoped_refptr<media::VideoFrame> frame, base::TimeTicks capture_time) { *capture_time_ = capture_time; metadata_->Clear();
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_track.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_track.cc index a62302663..f612579 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_track.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_track.cc
@@ -28,7 +28,7 @@ // Empty method used for keeping a reference to the original media::VideoFrame. // The reference to |frame| is kept in the closure that calls this method. -void ReleaseOriginalFrame(const scoped_refptr<media::VideoFrame>& frame) {} +void ReleaseOriginalFrame(scoped_refptr<media::VideoFrame> frame) {} } // namespace @@ -63,7 +63,7 @@ // Triggers all registered callbacks with |frame|, |format| and // |estimated_capture_time| as parameters. Must be called on the IO-thread. - void DeliverFrameOnIO(const scoped_refptr<media::VideoFrame>& frame, + void DeliverFrameOnIO(scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time); private: @@ -80,7 +80,7 @@ // Returns a black frame where the size and time stamp is set to the same as // as in |reference_frame|. scoped_refptr<media::VideoFrame> GetBlackFrame( - const scoped_refptr<media::VideoFrame>& reference_frame); + const media::VideoFrame& reference_frame); // Used to DCHECK that AddCallback and RemoveCallback are called on the main // Render Thread. @@ -184,7 +184,7 @@ } void MediaStreamVideoTrack::FrameDeliverer::DeliverFrameOnIO( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time) { DCHECK(io_task_runner_->BelongsToCurrentThread()); if (!enabled_ && main_render_task_runner_ && emit_frame_drop_events_) { @@ -196,20 +196,19 @@ media::VideoCaptureFrameDropReason:: kVideoTrackFrameDelivererNotEnabledReplacingWithBlackFrame)); } - const scoped_refptr<media::VideoFrame>& video_frame = - enabled_ ? frame : GetBlackFrame(frame); + auto video_frame = enabled_ ? std::move(frame) : GetBlackFrame(*frame); for (const auto& entry : callbacks_) entry.second.Run(video_frame, estimated_capture_time); } scoped_refptr<media::VideoFrame> MediaStreamVideoTrack::FrameDeliverer::GetBlackFrame( - const scoped_refptr<media::VideoFrame>& reference_frame) { + const media::VideoFrame& reference_frame) { DCHECK(io_task_runner_->BelongsToCurrentThread()); if (!black_frame_.get() || - black_frame_->natural_size() != reference_frame->natural_size()) { + black_frame_->natural_size() != reference_frame.natural_size()) { black_frame_ = - media::VideoFrame::CreateBlackFrame(reference_frame->natural_size()); + media::VideoFrame::CreateBlackFrame(reference_frame.natural_size()); } // Wrap |black_frame_| so we get a fresh timestamp we can modify. Frames @@ -223,9 +222,9 @@ wrapped_black_frame->AddDestructionObserver( base::BindOnce(&ReleaseOriginalFrame, black_frame_)); - wrapped_black_frame->set_timestamp(reference_frame->timestamp()); + wrapped_black_frame->set_timestamp(reference_frame.timestamp()); base::TimeTicks reference_time; - if (reference_frame->metadata()->GetTimeTicks( + if (reference_frame.metadata()->GetTimeTicks( media::VideoFrameMetadata::REFERENCE_TIME, &reference_time)) { wrapped_black_frame->metadata()->SetTimeTicks( media::VideoFrameMetadata::REFERENCE_TIME, reference_time);
diff --git a/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc b/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc index 302cac0..d892e251 100644 --- a/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc +++ b/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc
@@ -61,7 +61,7 @@ // Empty method used for keeping a reference to the original media::VideoFrame // in VideoFrameResolutionAdapter::DeliverFrame if cropping is needed. // The reference to |frame| is kept in the closure that calls this method. -void TrackReleaseOriginalFrame(const scoped_refptr<media::VideoFrame>& frame) {} +void TrackReleaseOriginalFrame(scoped_refptr<media::VideoFrame> frame) {} int ClampToValidDimension(int dimension) { return std::min(static_cast<int>(media::limits::kMaxDimension), @@ -164,7 +164,7 @@ // callbacks if |track| was not present in the adapter. VideoTrackCallbacks RemoveAndGetCallbacks(const MediaStreamVideoTrack* track); - void DeliverFrame(const scoped_refptr<media::VideoFrame>& frame, + void DeliverFrame(scoped_refptr<media::VideoFrame> frame, const base::TimeTicks& estimated_capture_time, bool is_device_rotated); @@ -180,13 +180,13 @@ virtual ~VideoFrameResolutionAdapter(); friend class WTF::ThreadSafeRefCounted<VideoFrameResolutionAdapter>; - void DoDeliverFrame(const scoped_refptr<media::VideoFrame>& frame, + void DoDeliverFrame(scoped_refptr<media::VideoFrame> frame, const base::TimeTicks& estimated_capture_time); // Returns |true| if the input frame rate is higher that the requested max // frame rate and |frame| should be dropped. If it returns true, |reason| is // assigned to indicate the particular reason for the decision. - bool MaybeDropFrame(const scoped_refptr<media::VideoFrame>& frame, + bool MaybeDropFrame(const media::VideoFrame& frame, float source_frame_rate, media::VideoCaptureFrameDropReason* reason); @@ -194,11 +194,11 @@ // changed since last update. void MaybeUpdateTrackSettings( const VideoTrackSettingsInternalCallback& settings_callback, - const scoped_refptr<media::VideoFrame>& frame); + const media::VideoFrame& frame); // Updates computed source format for all tracks if either frame width, height // or frame rate have changed since last update. - void MaybeUpdateTracksFormat(const scoped_refptr<media::VideoFrame>& frame); + void MaybeUpdateTracksFormat(const media::VideoFrame& frame); void PostFrameDroppedToMainTaskRunner( media::VideoCaptureFrameDropReason reason); @@ -289,7 +289,7 @@ } void VideoTrackAdapter::VideoFrameResolutionAdapter::DeliverFrame( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, const base::TimeTicks& estimated_capture_time, bool is_device_rotated) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); @@ -303,7 +303,7 @@ ComputeFrameRate(frame->timestamp(), &source_format_settings_.frame_rate, &source_format_settings_.prev_frame_timestamp); - MaybeUpdateTracksFormat(frame); + MaybeUpdateTracksFormat(*frame); double frame_rate; if (!frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, @@ -312,7 +312,7 @@ } auto frame_drop_reason = media::VideoCaptureFrameDropReason::kNone; - if (MaybeDropFrame(frame, frame_rate, &frame_drop_reason)) { + if (MaybeDropFrame(*frame, frame_rate, &frame_drop_reason)) { PostFrameDroppedToMainTaskRunner(frame_drop_reason); return; } @@ -320,7 +320,7 @@ // TODO(perkj): Allow cropping / scaling of textures once // https://crbug/362521 is fixed. if (frame->HasTextures()) { - DoDeliverFrame(frame, estimated_capture_time); + DoDeliverFrame(std::move(frame), estimated_capture_time); return; } scoped_refptr<media::VideoFrame> video_frame(frame); @@ -353,7 +353,7 @@ << " output visible rect " << video_frame->visible_rect().ToString(); } - DoDeliverFrame(video_frame, estimated_capture_time); + DoDeliverFrame(std::move(video_frame), estimated_capture_time); } bool VideoTrackAdapter::VideoFrameResolutionAdapter::SettingsMatch( @@ -368,7 +368,7 @@ } void VideoTrackAdapter::VideoFrameResolutionAdapter::DoDeliverFrame( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, const base::TimeTicks& estimated_capture_time) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); if (callbacks_.empty()) { @@ -376,13 +376,13 @@ media::VideoCaptureFrameDropReason::kResolutionAdapterHasNoCallbacks); } for (const auto& callback : callbacks_) { - MaybeUpdateTrackSettings(callback.second.settings_callback, frame); + MaybeUpdateTrackSettings(callback.second.settings_callback, *frame); callback.second.frame_callback.Run(frame, estimated_capture_time); } } bool VideoTrackAdapter::VideoFrameResolutionAdapter::MaybeDropFrame( - const scoped_refptr<media::VideoFrame>& frame, + const media::VideoFrame& frame, float source_frame_rate, media::VideoCaptureFrameDropReason* reason) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); @@ -396,12 +396,12 @@ } const double delta_ms = - (frame->timestamp() - last_time_stamp_).InMillisecondsF(); + (frame.timestamp() - last_time_stamp_).InMillisecondsF(); // Check if the time since the last frame is completely off. if (delta_ms < 0 || delta_ms > kMaxTimeInMsBetweenFrames) { // Reset |last_time_stamp_| and fps calculation. - last_time_stamp_ = frame->timestamp(); + last_time_stamp_ = frame.timestamp(); frame_rate_ = MediaStreamVideoSource::kDefaultFrameRate; keep_frame_counter_ = 0.0; return false; @@ -422,7 +422,7 @@ kResolutionAdapterTimestampTooCloseToPrevious; return true; } - last_time_stamp_ = frame->timestamp(); + last_time_stamp_ = frame.timestamp(); // Calculate the frame rate using a simple AR filter. // Use a simple filter with 0.1 weight of the current sample. frame_rate_ = 100 / delta_ms + 0.9 * frame_rate_; @@ -447,23 +447,23 @@ void VideoTrackAdapter::VideoFrameResolutionAdapter::MaybeUpdateTrackSettings( const VideoTrackSettingsInternalCallback& settings_callback, - const scoped_refptr<media::VideoFrame>& frame) { + const media::VideoFrame& frame) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); - ComputeFrameRate(frame->timestamp(), &track_settings_.frame_rate, + ComputeFrameRate(frame.timestamp(), &track_settings_.frame_rate, &track_settings_.prev_frame_timestamp); if (MaybeUpdateFrameRate(&track_settings_) || - frame->natural_size() != track_settings_.frame_size) { - track_settings_.frame_size = frame->natural_size(); + frame.natural_size() != track_settings_.frame_size) { + track_settings_.frame_size = frame.natural_size(); settings_callback.Run(track_settings_.frame_size, track_settings_.frame_rate); } } void VideoTrackAdapter::VideoFrameResolutionAdapter::MaybeUpdateTracksFormat( - const scoped_refptr<media::VideoFrame>& frame) { + const media::VideoFrame& frame) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); if (MaybeUpdateFrameRate(&source_format_settings_) || - frame->natural_size() != track_settings_.frame_size) { - source_format_settings_.frame_size = frame->natural_size(); + frame.natural_size() != track_settings_.frame_size) { + source_format_settings_.frame_size = frame.natural_size(); media::VideoCaptureFormat source_format; source_format.frame_size = source_format_settings_.frame_size; source_format.frame_rate = source_format_settings_.frame_rate; @@ -513,7 +513,7 @@ PostCrossThreadTask( *io_task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &VideoTrackAdapter::AddTrackOnIO, CrossThreadUnretained(this), CrossThreadUnretained(track), WTF::Passed(CrossThreadBind(std::move(frame_callback))), @@ -550,8 +550,8 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *io_task_runner_, FROM_HERE, - CrossThreadBind(&VideoTrackAdapter::RemoveTrackOnIO, WrapRefCounted(this), - CrossThreadUnretained(track))); + CrossThreadBindOnce(&VideoTrackAdapter::RemoveTrackOnIO, + WrapRefCounted(this), CrossThreadUnretained(track))); } void VideoTrackAdapter::ReconfigureTrack( @@ -559,10 +559,11 @@ const VideoTrackAdapterSettings& settings) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask(*io_task_runner_, FROM_HERE, - CrossThreadBind(&VideoTrackAdapter::ReconfigureTrackOnIO, - WrapRefCounted(this), - CrossThreadUnretained(track), settings)); + PostCrossThreadTask( + *io_task_runner_, FROM_HERE, + CrossThreadBindOnce(&VideoTrackAdapter::ReconfigureTrackOnIO, + WrapRefCounted(this), CrossThreadUnretained(track), + settings)); } void VideoTrackAdapter::StartFrameMonitoring( @@ -575,7 +576,7 @@ PostCrossThreadTask( *io_task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &VideoTrackAdapter::StartFrameMonitoringOnIO, WrapRefCounted(this), WTF::Passed(CrossThreadBind(std::move(bound_on_muted_callback))), source_frame_rate)); @@ -585,16 +586,16 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *io_task_runner_, FROM_HERE, - CrossThreadBind(&VideoTrackAdapter::StopFrameMonitoringOnIO, - WrapRefCounted(this))); + CrossThreadBindOnce(&VideoTrackAdapter::StopFrameMonitoringOnIO, + WrapRefCounted(this))); } void VideoTrackAdapter::SetSourceFrameSize(const IntSize& source_frame_size) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *io_task_runner_, FROM_HERE, - CrossThreadBind(&VideoTrackAdapter::SetSourceFrameSizeOnIO, - WrapRefCounted(this), source_frame_size)); + CrossThreadBindOnce(&VideoTrackAdapter::SetSourceFrameSizeOnIO, + WrapRefCounted(this), source_frame_size)); } bool VideoTrackAdapter::CalculateDesiredSize( @@ -730,7 +731,7 @@ } void VideoTrackAdapter::DeliverFrameOnIO( - const scoped_refptr<media::VideoFrame>& frame, + scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time) { DCHECK(io_task_runner_->BelongsToCurrentThread()); TRACE_EVENT0("media", "VideoTrackAdapter::DeliverFrameOnIO"); @@ -778,7 +779,7 @@ PostDelayedCrossThreadTask( *io_task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &VideoTrackAdapter::CheckFramesReceivedOnIO, WrapRefCounted(this), WTF::Passed(std::move(set_muted_state_callback)), frame_counter_), base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals /
diff --git a/third_party/blink/renderer/modules/mediastream/video_track_adapter.h b/third_party/blink/renderer/modules/mediastream/video_track_adapter.h index 41f56ec20..651c7db 100644 --- a/third_party/blink/renderer/modules/mediastream/video_track_adapter.h +++ b/third_party/blink/renderer/modules/mediastream/video_track_adapter.h
@@ -61,7 +61,7 @@ // Delivers |frame| to all tracks that have registered a callback. // Must be called on the IO-thread. - void DeliverFrameOnIO(const scoped_refptr<media::VideoFrame>& frame, + void DeliverFrameOnIO(scoped_refptr<media::VideoFrame> frame, base::TimeTicks estimated_capture_time); base::SingleThreadTaskRunner* io_task_runner() const { @@ -97,7 +97,7 @@ // VideoTrackSettingsCallback and VideoTrackFormatCallback respectively. using VideoCaptureDeliverFrameInternalCallback = WTF::CrossThreadFunction<void( - const scoped_refptr<media::VideoFrame>& video_frame, + scoped_refptr<media::VideoFrame> video_frame, base::TimeTicks estimated_capture_time)>; using VideoTrackSettingsInternalCallback = WTF::CrossThreadFunction<void(gfx::Size frame_size, double frame_rate)>;
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/dtls_transport_proxy.cc b/third_party/blink/renderer/modules/peerconnection/adapters/dtls_transport_proxy.cc index 8f31beb..1aea0228 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/dtls_transport_proxy.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/dtls_transport_proxy.cc
@@ -25,9 +25,10 @@ dtls_transport, delegate)); // TODO(hta): Delete this thread jump once creation can be initiated // from the host thread (=webrtc signalling thread). - PostCrossThreadTask(*host_thread, FROM_HERE, - CrossThreadBind(&DtlsTransportProxy::StartOnHostThread, - CrossThreadUnretained(proxy.get()))); + PostCrossThreadTask( + *host_thread, FROM_HERE, + CrossThreadBindOnce(&DtlsTransportProxy::StartOnHostThread, + CrossThreadUnretained(proxy.get()))); return proxy; } @@ -45,9 +46,10 @@ void DtlsTransportProxy::StartOnHostThread() { DCHECK(host_thread_->BelongsToCurrentThread()); dtls_transport_->RegisterObserver(this); - PostCrossThreadTask(*proxy_thread_, FROM_HERE, - CrossThreadBind(&Delegate::OnStartCompleted, delegate_, - dtls_transport_->Information())); + PostCrossThreadTask( + *proxy_thread_, FROM_HERE, + CrossThreadBindOnce(&Delegate::OnStartCompleted, delegate_, + dtls_transport_->Information())); } void DtlsTransportProxy::OnStateChange(webrtc::DtlsTransportInformation info) { @@ -60,7 +62,7 @@ } PostCrossThreadTask( *proxy_thread_, FROM_HERE, - CrossThreadBind(&Delegate::OnStateChange, delegate_, info)); + CrossThreadBindOnce(&Delegate::OnStateChange, delegate_, info)); if (info.state() == webrtc::DtlsTransportState::kClosed) { delegate_ = nullptr; }
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_host.cc b/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_host.cc index 80450da..f79c623 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_host.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_host.cc
@@ -105,23 +105,24 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *proxy_thread_, FROM_HERE, - CrossThreadBind(&IceTransportProxy::OnGatheringStateChanged, proxy_, - new_state)); + CrossThreadBindOnce(&IceTransportProxy::OnGatheringStateChanged, proxy_, + new_state)); } void IceTransportHost::OnCandidateGathered( const cricket::Candidate& candidate) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask(*proxy_thread_, FROM_HERE, - CrossThreadBind(&IceTransportProxy::OnCandidateGathered, - proxy_, candidate)); + PostCrossThreadTask( + *proxy_thread_, FROM_HERE, + CrossThreadBindOnce(&IceTransportProxy::OnCandidateGathered, proxy_, + candidate)); } void IceTransportHost::OnStateChanged(webrtc::IceTransportState new_state) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask( - *proxy_thread_, FROM_HERE, - CrossThreadBind(&IceTransportProxy::OnStateChanged, proxy_, new_state)); + PostCrossThreadTask(*proxy_thread_, FROM_HERE, + CrossThreadBindOnce(&IceTransportProxy::OnStateChanged, + proxy_, new_state)); } void IceTransportHost::OnSelectedCandidatePairChanged( @@ -130,8 +131,8 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *proxy_thread_, FROM_HERE, - CrossThreadBind(&IceTransportProxy::OnSelectedCandidatePairChanged, - proxy_, selected_candidate_pair)); + CrossThreadBindOnce(&IceTransportProxy::OnSelectedCandidatePairChanged, + proxy_, selected_candidate_pair)); } } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_proxy.cc b/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_proxy.cc index e317e4d..6a0555b 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_proxy.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_proxy.cc
@@ -38,10 +38,11 @@ // (configured above) will ensure it gets deleted on the host thread. host_.reset(new IceTransportHost(proxy_thread_, host_thread_, weak_ptr_factory_.GetWeakPtr())); - PostCrossThreadTask(*host_thread_, FROM_HERE, - CrossThreadBind(&IceTransportHost::Initialize, - CrossThreadUnretained(host_.get()), - WTF::Passed(std::move(adapter_factory)))); + PostCrossThreadTask( + *host_thread_, FROM_HERE, + CrossThreadBindOnce(&IceTransportHost::Initialize, + CrossThreadUnretained(host_.get()), + WTF::Passed(std::move(adapter_factory)))); } IceTransportProxy::~IceTransportProxy() { @@ -70,9 +71,9 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *host_thread_, FROM_HERE, - CrossThreadBind(&IceTransportHost::StartGathering, - CrossThreadUnretained(host_.get()), local_parameters, - stun_servers, turn_servers, policy)); + CrossThreadBindOnce(&IceTransportHost::StartGathering, + CrossThreadUnretained(host_.get()), local_parameters, + stun_servers, turn_servers, policy)); } void IceTransportProxy::Start( @@ -82,18 +83,19 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *host_thread_, FROM_HERE, - CrossThreadBind(&IceTransportHost::Start, - CrossThreadUnretained(host_.get()), remote_parameters, - role, initial_remote_candidates)); + CrossThreadBindOnce(&IceTransportHost::Start, + CrossThreadUnretained(host_.get()), remote_parameters, + role, initial_remote_candidates)); } void IceTransportProxy::HandleRemoteRestart( const cricket::IceParameters& new_remote_parameters) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask(*host_thread_, FROM_HERE, - CrossThreadBind(&IceTransportHost::HandleRemoteRestart, - CrossThreadUnretained(host_.get()), - new_remote_parameters)); + PostCrossThreadTask( + *host_thread_, FROM_HERE, + CrossThreadBindOnce(&IceTransportHost::HandleRemoteRestart, + CrossThreadUnretained(host_.get()), + new_remote_parameters)); } void IceTransportProxy::AddRemoteCandidate( @@ -101,8 +103,8 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *host_thread_, FROM_HERE, - CrossThreadBind(&IceTransportHost::AddRemoteCandidate, - CrossThreadUnretained(host_.get()), candidate)); + CrossThreadBindOnce(&IceTransportHost::AddRemoteCandidate, + CrossThreadUnretained(host_.get()), candidate)); } bool IceTransportProxy::HasConsumer() const {
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_host.cc b/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_host.cc index 6bafeb04..e6cb798 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_host.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_host.cc
@@ -72,15 +72,15 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask( *proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicStreamProxy::OnRemoteReset, stream_proxy_)); + CrossThreadBindOnce(&QuicStreamProxy::OnRemoteReset, stream_proxy_)); Delete(); } void QuicStreamHost::OnDataReceived(Vector<uint8_t> data, bool fin) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask(*proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicStreamProxy::OnDataReceived, - stream_proxy_, std::move(data), fin)); + CrossThreadBindOnce(&QuicStreamProxy::OnDataReceived, + stream_proxy_, std::move(data), fin)); if (fin) { readable_ = false; if (!readable_ && !writable_) { @@ -92,8 +92,8 @@ void QuicStreamHost::OnWriteDataConsumed(uint32_t amount) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask(*proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicStreamProxy::OnWriteDataConsumed, - stream_proxy_, amount)); + CrossThreadBindOnce(&QuicStreamProxy::OnWriteDataConsumed, + stream_proxy_, amount)); } void QuicStreamHost::Delete() {
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_proxy.cc b/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_proxy.cc index 2d3df4a..bef186c2b 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_proxy.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_proxy.cc
@@ -46,23 +46,25 @@ void QuicStreamProxy::Reset() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask(*host_thread(), FROM_HERE, - CrossThreadBind(&QuicStreamHost::Reset, stream_host_)); + PostCrossThreadTask( + *host_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicStreamHost::Reset, stream_host_)); Delete(); } void QuicStreamProxy::MarkReceivedDataConsumed(uint32_t amount) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask(*host_thread(), FROM_HERE, - CrossThreadBind(&QuicStreamHost::MarkReceivedDataConsumed, - stream_host_, amount)); + PostCrossThreadTask( + *host_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicStreamHost::MarkReceivedDataConsumed, + stream_host_, amount)); } void QuicStreamProxy::WriteData(Vector<uint8_t> data, bool fin) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask(*host_thread(), FROM_HERE, - CrossThreadBind(&QuicStreamHost::WriteData, stream_host_, - std::move(data), fin)); + CrossThreadBindOnce(&QuicStreamHost::WriteData, + stream_host_, std::move(data), fin)); if (fin) { writable_ = false; if (!readable_ && !writable_) {
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_host.cc b/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_host.cc index 53f4b814..521a0233 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_host.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_host.cc
@@ -91,9 +91,9 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); P2PQuicTransportStats stats = quic_transport_->GetStats(); - PostCrossThreadTask( - *proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnStats, proxy_, request_id, stats)); + PostCrossThreadTask(*proxy_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicTransportProxy::OnStats, proxy_, + request_id, stats)); } void QuicTransportHost::OnRemoveStream(QuicStreamHost* stream_host_to_remove) { @@ -109,23 +109,24 @@ stream_hosts_.clear(); PostCrossThreadTask( *proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnRemoteStopped, proxy_)); + CrossThreadBindOnce(&QuicTransportProxy::OnRemoteStopped, proxy_)); } void QuicTransportHost::OnConnectionFailed(const std::string& error_details, bool from_remote) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); stream_hosts_.clear(); - PostCrossThreadTask(*proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnConnectionFailed, - proxy_, error_details, from_remote)); + PostCrossThreadTask( + *proxy_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicTransportProxy::OnConnectionFailed, proxy_, + error_details, from_remote)); } void QuicTransportHost::OnConnected(P2PQuicNegotiatedParams negotiated_params) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask(*proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnConnected, proxy_, - negotiated_params)); + CrossThreadBindOnce(&QuicTransportProxy::OnConnected, + proxy_, negotiated_params)); } void QuicTransportHost::OnStream(P2PQuicStream* p2p_stream) { @@ -142,9 +143,10 @@ stream_hosts_.insert( std::make_pair(stream_host.get(), std::move(stream_host))); - PostCrossThreadTask(*proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnStream, proxy_, - WTF::Passed(std::move(stream_proxy)))); + PostCrossThreadTask( + *proxy_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicTransportProxy::OnStream, proxy_, + WTF::Passed(std::move(stream_proxy)))); } void QuicTransportHost::OnDatagramSent() { @@ -152,15 +154,16 @@ PostCrossThreadTask( *proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnDatagramSent, proxy_)); + CrossThreadBindOnce(&QuicTransportProxy::OnDatagramSent, proxy_)); } void QuicTransportHost::OnDatagramReceived(Vector<uint8_t> datagram) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask(*proxy_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportProxy::OnDatagramReceived, - proxy_, std::move(datagram))); + PostCrossThreadTask( + *proxy_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicTransportProxy::OnDatagramReceived, proxy_, + std::move(datagram))); } } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_proxy.cc b/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_proxy.cc index d1e81163..a1e97fd 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_proxy.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_proxy.cc
@@ -48,9 +48,9 @@ ice_transport_proxy->ConnectConsumer(this); PostCrossThreadTask( *host_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportHost::Initialize, - CrossThreadUnretained(host_.get()), - CrossThreadUnretained(ice_transport_host), config)); + CrossThreadBindOnce(&QuicTransportHost::Initialize, + CrossThreadUnretained(host_.get()), + CrossThreadUnretained(ice_transport_host), config)); } QuicTransportProxy::~QuicTransportProxy() { @@ -74,16 +74,16 @@ void QuicTransportProxy::Start(P2PQuicTransport::StartConfig config) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask(*host_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportHost::Start, - CrossThreadUnretained(host_.get()), - WTF::Passed(std::move(config)))); + CrossThreadBindOnce(&QuicTransportHost::Start, + CrossThreadUnretained(host_.get()), + WTF::Passed(std::move(config)))); } void QuicTransportProxy::Stop() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); PostCrossThreadTask(*host_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportHost::Stop, - CrossThreadUnretained(host_.get()))); + CrossThreadBindOnce(&QuicTransportHost::Stop, + CrossThreadUnretained(host_.get()))); } QuicStreamProxy* QuicTransportProxy::CreateStream() { @@ -97,9 +97,9 @@ stream_proxy->Initialize(this); PostCrossThreadTask(*host_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportHost::CreateStream, - CrossThreadUnretained(host_.get()), - WTF::Passed(std::move(stream_host)))); + CrossThreadBindOnce(&QuicTransportHost::CreateStream, + CrossThreadUnretained(host_.get()), + WTF::Passed(std::move(stream_host)))); QuicStreamProxy* stream_proxy_ptr = stream_proxy.get(); stream_proxies_.insert( @@ -110,10 +110,10 @@ void QuicTransportProxy::SendDatagram(Vector<uint8_t> datagram) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - PostCrossThreadTask( - *host_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportHost::SendDatagram, - CrossThreadUnretained(host_.get()), std::move(datagram))); + PostCrossThreadTask(*host_thread(), FROM_HERE, + CrossThreadBindOnce(&QuicTransportHost::SendDatagram, + CrossThreadUnretained(host_.get()), + std::move(datagram))); } void QuicTransportProxy::GetStats(uint32_t request_id) { @@ -121,8 +121,8 @@ PostCrossThreadTask( *host_thread(), FROM_HERE, - CrossThreadBind(&QuicTransportHost::GetStats, - CrossThreadUnretained(host_.get()), request_id)); + CrossThreadBindOnce(&QuicTransportHost::GetStats, + CrossThreadUnretained(host_.get()), request_id)); } void QuicTransportProxy::OnRemoveStream(
diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/sctp_transport_proxy.cc b/third_party/blink/renderer/modules/peerconnection/adapters/sctp_transport_proxy.cc index a9bfffe..287fe40 100644 --- a/third_party/blink/renderer/modules/peerconnection/adapters/sctp_transport_proxy.cc +++ b/third_party/blink/renderer/modules/peerconnection/adapters/sctp_transport_proxy.cc
@@ -26,9 +26,10 @@ std::unique_ptr<SctpTransportProxy> proxy = base::WrapUnique(new SctpTransportProxy(frame, proxy_thread, host_thread, sctp_transport, delegate)); - PostCrossThreadTask(*host_thread, FROM_HERE, - CrossThreadBind(&SctpTransportProxy::StartOnHostThread, - CrossThreadUnretained(proxy.get()))); + PostCrossThreadTask( + *host_thread, FROM_HERE, + CrossThreadBindOnce(&SctpTransportProxy::StartOnHostThread, + CrossThreadUnretained(proxy.get()))); return proxy; } @@ -46,9 +47,10 @@ void SctpTransportProxy::StartOnHostThread() { DCHECK(host_thread_->BelongsToCurrentThread()); sctp_transport_->RegisterObserver(this); - PostCrossThreadTask(*proxy_thread_, FROM_HERE, - CrossThreadBind(&Delegate::OnStartCompleted, delegate_, - sctp_transport_->Information())); + PostCrossThreadTask( + *proxy_thread_, FROM_HERE, + CrossThreadBindOnce(&Delegate::OnStartCompleted, delegate_, + sctp_transport_->Information())); } void SctpTransportProxy::OnStateChange(webrtc::SctpTransportInformation info) { @@ -62,7 +64,7 @@ } PostCrossThreadTask( *proxy_thread_, FROM_HERE, - CrossThreadBind(&Delegate::OnStateChange, delegate_, info)); + CrossThreadBindOnce(&Delegate::OnStateChange, delegate_, info)); if (info.state() == webrtc::SctpTransportState::kClosed) { // Don't hold on to |delegate| any more. delegate_ = nullptr;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_data_channel.cc b/third_party/blink/renderer/modules/peerconnection/rtc_data_channel.cc index 934facd..35bab96 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_data_channel.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_data_channel.cc
@@ -153,16 +153,17 @@ void RTCDataChannel::Observer::OnStateChange() { PostCrossThreadTask( *main_thread_, FROM_HERE, - CrossThreadBind(&RTCDataChannel::Observer::OnStateChangeImpl, - scoped_refptr<Observer>(this), webrtc_channel_->state())); + CrossThreadBindOnce(&RTCDataChannel::Observer::OnStateChangeImpl, + scoped_refptr<Observer>(this), + webrtc_channel_->state())); } void RTCDataChannel::Observer::OnBufferedAmountChange(uint64_t sent_data_size) { PostCrossThreadTask( *main_thread_, FROM_HERE, - CrossThreadBind(&RTCDataChannel::Observer::OnBufferedAmountChangeImpl, - scoped_refptr<Observer>(this), - SafeCast<unsigned>(sent_data_size))); + CrossThreadBindOnce(&RTCDataChannel::Observer::OnBufferedAmountChangeImpl, + scoped_refptr<Observer>(this), + SafeCast<unsigned>(sent_data_size))); } void RTCDataChannel::Observer::OnMessage(const webrtc::DataBuffer& buffer) { @@ -170,10 +171,11 @@ // having to create a copy. See webrtc bug 3967. std::unique_ptr<webrtc::DataBuffer> new_buffer( new webrtc::DataBuffer(buffer)); - PostCrossThreadTask(*main_thread_, FROM_HERE, - CrossThreadBind(&RTCDataChannel::Observer::OnMessageImpl, - scoped_refptr<Observer>(this), - WTF::Passed(std::move(new_buffer)))); + PostCrossThreadTask( + *main_thread_, FROM_HERE, + CrossThreadBindOnce(&RTCDataChannel::Observer::OnMessageImpl, + scoped_refptr<Observer>(this), + WTF::Passed(std::move(new_buffer)))); } void RTCDataChannel::Observer::OnStateChangeImpl(
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc index 86e80b0..dafa718 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc
@@ -34,7 +34,7 @@ base::WaitableEvent::InitialState::NOT_SIGNALED); PostCrossThreadTask( *thread, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](WTF::CrossThreadClosure closure, base::WaitableEvent* event) { std::move(closure).Run(); event->Signal();
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc index 628117f5..c71a6691 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc
@@ -769,8 +769,8 @@ PostCrossThreadTask( *parent_execution_context_task_runners_->Get(TaskType::kInternalDefault), FROM_HERE, - CrossThreadBind(&WebEmbeddedWorkerImpl::TerminateWorkerContext, - CrossThreadUnretained(embedded_worker_))); + CrossThreadBindOnce(&WebEmbeddedWorkerImpl::TerminateWorkerContext, + CrossThreadUnretained(embedded_worker_))); // NOTE: WorkerThread calls WillDestroyWorkerGlobalScope() synchronously after // this function returns, since it calls DidCloseWorkerGlobalScope() then
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager.cc b/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager.cc index f3360379..345e45d 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager.cc
@@ -261,8 +261,9 @@ installed_urls_.insert(url.Copy()); PostCrossThreadTask( *io_task_runner, FROM_HERE, - CrossThreadBind(&Internal::Create, script_container_, - WTF::Passed(std::move(manager_request)), io_task_runner)); + CrossThreadBindOnce(&Internal::Create, script_container_, + WTF::Passed(std::move(manager_request)), + io_task_runner)); } bool ServiceWorkerInstalledScriptsManager::IsScriptInstalled(
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc b/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc index e266f99..e0d048a3 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc
@@ -150,7 +150,7 @@ bool* out_installed) { PostCrossThreadTask( *worker_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](ServiceWorkerInstalledScriptsManager* installed_scripts_manager, const String& script_url, bool* out_installed, base::WaitableEvent* waiter) { @@ -169,7 +169,7 @@ std::unique_ptr<RawScriptData>* out_data) { PostCrossThreadTask( *worker_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ServiceWorkerInstalledScriptsManagerTest::CallGetRawScriptData, CrossThreadUnretained(this), script_url, CrossThreadUnretained(out_data),
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_thread.cc b/third_party/blink/renderer/modules/service_worker/service_worker_thread.cc index c0c6a49..76ce15b8 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_thread.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_thread.cc
@@ -81,7 +81,7 @@ // WorkerThread::EvaluateClassicScript(). PostCrossThreadTask( *GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ServiceWorkerThread::RunInstalledClassicScriptOnWorkerThread, CrossThreadUnretained(this), script_url, stack_id)); } @@ -92,7 +92,7 @@ network::mojom::FetchCredentialsMode credentials_mode) { PostCrossThreadTask( *GetTaskRunner(TaskType::kDOMManipulation), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ServiceWorkerThread::RunInstalledModuleScriptOnWorkerThread, CrossThreadUnretained(this), module_url_record, WTF::Passed(outside_settings_object.CopyData()), credentials_mode));
diff --git a/third_party/blink/renderer/modules/service_worker/thread_safe_script_container_test.cc b/third_party/blink/renderer/modules/service_worker/thread_safe_script_container_test.cc index d4bb1e03..bca611d 100644 --- a/third_party/blink/renderer/modules/service_worker/thread_safe_script_container_test.cc +++ b/third_party/blink/renderer/modules/service_worker/thread_safe_script_container_test.cc
@@ -42,7 +42,7 @@ ThreadSafeScriptContainer::RawScriptData** out_data) { PostCrossThreadTask( *writer_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](scoped_refptr<ThreadSafeScriptContainer> container, ThreadSafeScriptContainer::RawScriptData** out_data, base::WaitableEvent* waiter) { @@ -63,7 +63,7 @@ base::WaitableEvent* OnAllDataAddedOnWriterThread() { PostCrossThreadTask( *writer_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](scoped_refptr<ThreadSafeScriptContainer> container, base::WaitableEvent* waiter) { container->OnAllDataAddedOnIOThread(); @@ -76,7 +76,7 @@ base::WaitableEvent* GetStatusOnReaderThread(ScriptStatus* out_status) { PostCrossThreadTask( *reader_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](scoped_refptr<ThreadSafeScriptContainer> container, ScriptStatus* out_status, base::WaitableEvent* waiter) { *out_status = container->GetStatusOnWorkerThread(KURL(kKeyUrl)); @@ -90,7 +90,7 @@ base::WaitableEvent* WaitOnReaderThread(bool* out_exists) { PostCrossThreadTask( *reader_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](scoped_refptr<ThreadSafeScriptContainer> container, bool* out_exists, base::WaitableEvent* waiter) { *out_exists = container->WaitOnWorkerThread(KURL(kKeyUrl)); @@ -105,7 +105,7 @@ ThreadSafeScriptContainer::RawScriptData** out_data) { PostCrossThreadTask( *reader_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](scoped_refptr<ThreadSafeScriptContainer> container, ThreadSafeScriptContainer::RawScriptData** out_data, base::WaitableEvent* waiter) {
diff --git a/third_party/blink/renderer/modules/storage/storage_controller_test.cc b/third_party/blink/renderer/modules/storage/storage_controller_test.cc index c12a92a..85e9c6f 100644 --- a/third_party/blink/renderer/modules/storage/storage_controller_test.cc +++ b/third_party/blink/renderer/modules/storage/storage_controller_test.cc
@@ -62,7 +62,7 @@ mojom::blink::StoragePartitionServicePtr storage_partition_service_ptr; PostCrossThreadTask( *base::CreateSequencedTaskRunnerWithTraits({}), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](mojom::blink::StoragePartitionServiceRequest request) { mojo::MakeStrongBinding( std::make_unique<MockStoragePartitionService>(), @@ -124,7 +124,7 @@ mojom::blink::StoragePartitionServicePtr storage_partition_service_ptr; PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](std::unique_ptr<MockStoragePartitionService> storage_partition_ptr, mojom::blink::StoragePartitionServiceRequest request) { mojo::MakeStrongBinding(std::move(storage_partition_ptr),
diff --git a/third_party/blink/renderer/modules/storage/storage_namespace_test.cc b/third_party/blink/renderer/modules/storage/storage_namespace_test.cc index 24ed63a..f3a40c4 100644 --- a/third_party/blink/renderer/modules/storage/storage_namespace_test.cc +++ b/third_party/blink/renderer/modules/storage/storage_namespace_test.cc
@@ -59,7 +59,7 @@ mojom::blink::StoragePartitionServicePtr storage_partition_service_ptr; PostCrossThreadTask( *base::CreateSequencedTaskRunnerWithTraits({}), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](mojom::blink::StoragePartitionServiceRequest request) { mojo::MakeStrongBinding( std::make_unique<NoopStoragePartitionService>(),
diff --git a/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc b/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc index 54aa151..af05c226 100644 --- a/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc +++ b/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc
@@ -87,13 +87,13 @@ if (context) { PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind(&AsyncAudioDecoder::NotifyComplete, - WrapCrossThreadPersistent(audio_data), - WrapCrossThreadPersistent(success_callback), - WrapCrossThreadPersistent(error_callback), - WTF::RetainedRef(std::move(bus)), - WrapCrossThreadPersistent(resolver), - WrapCrossThreadPersistent(context))); + CrossThreadBindOnce(&AsyncAudioDecoder::NotifyComplete, + WrapCrossThreadPersistent(audio_data), + WrapCrossThreadPersistent(success_callback), + WrapCrossThreadPersistent(error_callback), + WTF::RetainedRef(std::move(bus)), + WrapCrossThreadPersistent(resolver), + WrapCrossThreadPersistent(context))); } }
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc index cd440cac..7d7c230 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_context.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
@@ -614,13 +614,13 @@ if (is_audible) { PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind(&AudioContext::NotifyAudibleAudioStarted, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&AudioContext::NotifyAudibleAudioStarted, + WrapCrossThreadPersistent(this))); } else { PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind(&AudioContext::NotifyAudibleAudioStopped, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&AudioContext::NotifyAudibleAudioStopped, + WrapCrossThreadPersistent(this))); } } }
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope_test.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope_test.cc index f7e47cbf..e3a04a6 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope_test.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope_test.cc
@@ -89,7 +89,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AudioWorkletGlobalScopeTest::RunBasicTestOnWorkletThread, CrossThreadUnretained(this), CrossThreadUnretained(thread), CrossThreadUnretained(&waitable_event))); @@ -100,7 +100,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AudioWorkletGlobalScopeTest::RunSimpleProcessTestOnWorkletThread, CrossThreadUnretained(this), CrossThreadUnretained(thread), CrossThreadUnretained(&waitable_event))); @@ -111,7 +111,7 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AudioWorkletGlobalScopeTest::RunParsingTestOnWorkletThread, CrossThreadUnretained(this), CrossThreadUnretained(thread), CrossThreadUnretained(&waitable_event))); @@ -122,11 +122,11 @@ base::WaitableEvent waitable_event; PostCrossThreadTask( *thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, - CrossThreadBind(&AudioWorkletGlobalScopeTest:: - RunParsingParameterDescriptorTestOnWorkletThread, - CrossThreadUnretained(this), - CrossThreadUnretained(thread), - CrossThreadUnretained(&waitable_event))); + CrossThreadBindOnce( + &AudioWorkletGlobalScopeTest:: + RunParsingParameterDescriptorTestOnWorkletThread, + CrossThreadUnretained(this), CrossThreadUnretained(thread), + CrossThreadUnretained(&waitable_event))); waitable_event.Wait(); }
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_messaging_proxy.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_messaging_proxy.cc index 63750f23..8b4ecad 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_messaging_proxy.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_messaging_proxy.cc
@@ -31,14 +31,11 @@ DCHECK(IsMainThread()); PostCrossThreadTask( *GetWorkerThread()->GetTaskRunner(TaskType::kMiscPlatformAPI), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AudioWorkletMessagingProxy::CreateProcessorOnRenderingThread, WrapCrossThreadPersistent(this), - CrossThreadUnretained(GetWorkerThread()), - handler, - handler->Name(), - std::move(message_port_channel), - std::move(node_options))); + CrossThreadUnretained(GetWorkerThread()), handler, handler->Name(), + std::move(message_port_channel), std::move(node_options))); } void AudioWorkletMessagingProxy::CreateProcessorOnRenderingThread(
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc index 34a491b..862afac 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc
@@ -176,9 +176,9 @@ } else { PostCrossThreadTask( *main_thread_task_runner_, FROM_HERE, - CrossThreadBind(&AudioWorkletHandler::NotifyProcessorError, - WrapRefCounted(this), - AudioWorkletProcessorErrorState::kConstructionError)); + CrossThreadBindOnce( + &AudioWorkletHandler::NotifyProcessorError, WrapRefCounted(this), + AudioWorkletProcessorErrorState::kConstructionError)); } } @@ -191,9 +191,8 @@ if (error_state == AudioWorkletProcessorErrorState::kProcessError) { PostCrossThreadTask( *main_thread_task_runner_, FROM_HERE, - CrossThreadBind(&AudioWorkletHandler::NotifyProcessorError, - WrapRefCounted(this), - error_state)); + CrossThreadBindOnce(&AudioWorkletHandler::NotifyProcessorError, + WrapRefCounted(this), error_state)); } // TODO(hongchan): After this point, The handler has no more pending activity
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_object_proxy.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_object_proxy.cc index e9567d2..ea87fa3a 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_object_proxy.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_object_proxy.cc
@@ -44,7 +44,7 @@ PostCrossThreadTask( *GetParentExecutionContextTaskRunners()->Get(TaskType::kInternalMedia), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AudioWorkletMessagingProxy::SynchronizeWorkletProcessorInfoList, GetAudioWorkletMessagingProxyWeakPtr(), WTF::Passed(std::move(processor_info_list))));
diff --git a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc index 6865f4cd..9abf7ed6 100644 --- a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc +++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
@@ -742,8 +742,8 @@ return; PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind(&BaseAudioContext::PerformCleanupOnMainThread, - WrapCrossThreadPersistent(this))); + CrossThreadBindOnce(&BaseAudioContext::PerformCleanupOnMainThread, + WrapCrossThreadPersistent(this))); has_posted_cleanup_task_ = true; }
diff --git a/third_party/blink/renderer/modules/webaudio/deferred_task_handler.cc b/third_party/blink/renderer/modules/webaudio/deferred_task_handler.cc index 2cba3a6..e8fe36a 100644 --- a/third_party/blink/renderer/modules/webaudio/deferred_task_handler.cc +++ b/third_party/blink/renderer/modules/webaudio/deferred_task_handler.cc
@@ -337,8 +337,8 @@ rendering_orphan_handlers_.clear(); PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind(&DeferredTaskHandler::DeleteHandlersOnMainThread, - scoped_refptr<DeferredTaskHandler>(this))); + CrossThreadBindOnce(&DeferredTaskHandler::DeleteHandlersOnMainThread, + scoped_refptr<DeferredTaskHandler>(this))); } void DeferredTaskHandler::DeleteHandlersOnMainThread() {
diff --git a/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc b/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc index cb15f3e..dc49288a 100644 --- a/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc +++ b/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc
@@ -116,8 +116,9 @@ is_rendering_started_ = true; PostCrossThreadTask( *render_thread_task_runner_, FROM_HERE, - CrossThreadBind(&OfflineAudioDestinationHandler::StartOfflineRendering, - WrapRefCounted(this))); + CrossThreadBindOnce( + &OfflineAudioDestinationHandler::StartOfflineRendering, + WrapRefCounted(this))); return; } @@ -125,8 +126,8 @@ // rendering by calling |doOfflineRendering| on the render thread. PostCrossThreadTask( *render_thread_task_runner_, FROM_HERE, - CrossThreadBind(&OfflineAudioDestinationHandler::DoOfflineRendering, - WrapRefCounted(this))); + CrossThreadBindOnce(&OfflineAudioDestinationHandler::DoOfflineRendering, + WrapRefCounted(this))); } void OfflineAudioDestinationHandler::StopRendering() { @@ -247,8 +248,9 @@ // The actual rendering has been suspended. Notify the context. PostCrossThreadTask( *main_thread_task_runner_, FROM_HERE, - CrossThreadBind(&OfflineAudioDestinationHandler::NotifySuspend, - WrapRefCounted(this), Context()->CurrentSampleFrame())); + CrossThreadBindOnce(&OfflineAudioDestinationHandler::NotifySuspend, + WrapRefCounted(this), + Context()->CurrentSampleFrame())); } void OfflineAudioDestinationHandler::FinishOfflineRendering() { @@ -257,8 +259,8 @@ // The actual rendering has been completed. Notify the context. PostCrossThreadTask( *main_thread_task_runner_, FROM_HERE, - CrossThreadBind(&OfflineAudioDestinationHandler::NotifyComplete, - WrapRefCounted(this))); + CrossThreadBindOnce(&OfflineAudioDestinationHandler::NotifyComplete, + WrapRefCounted(this))); } void OfflineAudioDestinationHandler::NotifySuspend(size_t frame) {
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_node.cc b/third_party/blink/renderer/modules/webaudio/script_processor_node.cc index 730a6a11..24294946 100644 --- a/third_party/blink/renderer/modules/webaudio/script_processor_node.cc +++ b/third_party/blink/renderer/modules/webaudio/script_processor_node.cc
@@ -216,8 +216,8 @@ // index. PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind(&ScriptProcessorHandler::FireProcessEvent, - WrapRefCounted(this), double_buffer_index_)); + CrossThreadBindOnce(&ScriptProcessorHandler::FireProcessEvent, + WrapRefCounted(this), double_buffer_index_)); } else { // If this node is in the offline audio context, use the // waitable event to synchronize to the offline rendering thread. @@ -226,7 +226,7 @@ PostCrossThreadTask( *task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &ScriptProcessorHandler::FireProcessEventForOfflineAudioContext, WrapRefCounted(this), double_buffer_index_, CrossThreadUnretained(waitable_event.get())));
diff --git a/third_party/blink/renderer/modules/webdatabase/database.cc b/third_party/blink/renderer/modules/webdatabase/database.cc index a477ee5..022b977 100644 --- a/third_party/blink/renderer/modules/webdatabase/database.cc +++ b/third_party/blink/renderer/modules/webdatabase/database.cc
@@ -851,9 +851,10 @@ void Database::ScheduleTransactionCallback(SQLTransaction* transaction) { // The task is constructed in a database thread, and destructed in the // context thread. - PostCrossThreadTask(*GetDatabaseTaskRunner(), FROM_HERE, - CrossThreadBind(&SQLTransaction::PerformPendingCallback, - WrapCrossThreadPersistent(transaction))); + PostCrossThreadTask( + *GetDatabaseTaskRunner(), FROM_HERE, + CrossThreadBindOnce(&SQLTransaction::PerformPendingCallback, + WrapCrossThreadPersistent(transaction))); } Vector<String> Database::PerformGetTableNames() {
diff --git a/third_party/blink/renderer/modules/webdatabase/database_tracker.cc b/third_party/blink/renderer/modules/webdatabase/database_tracker.cc index 14b3544..0a1da34 100644 --- a/third_party/blink/renderer/modules/webdatabase/database_tracker.cc +++ b/third_party/blink/renderer/modules/webdatabase/database_tracker.cc
@@ -194,8 +194,9 @@ it != database_set->end(); ++it) { PostCrossThreadTask( *(*it)->GetDatabaseTaskRunner(), FROM_HERE, - CrossThreadBind(&DatabaseTracker::CloseOneDatabaseImmediately, - CrossThreadUnretained(this), origin_string, name, *it)); + CrossThreadBindOnce(&DatabaseTracker::CloseOneDatabaseImmediately, + CrossThreadUnretained(this), origin_string, name, + *it)); } }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index ea60c63..19ab020 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -650,10 +650,11 @@ creation_info.using_gpu_compositing = using_gpu_compositing; scoped_refptr<base::SingleThreadTaskRunner> task_runner = Thread::MainThread()->GetTaskRunner(); - PostCrossThreadTask(*task_runner, FROM_HERE, - CrossThreadBind(&CreateContextProviderOnMainThread, - CrossThreadUnretained(&creation_info), - CrossThreadUnretained(&waitable_event))); + PostCrossThreadTask( + *task_runner, FROM_HERE, + CrossThreadBindOnce(&CreateContextProviderOnMainThread, + CrossThreadUnretained(&creation_info), + CrossThreadUnretained(&waitable_event))); waitable_event.Wait(); return std::move(creation_info.created_context_provider); }
diff --git a/third_party/blink/renderer/modules/xr/OWNERS b/third_party/blink/renderer/modules/xr/OWNERS index 04300e66..2789c1b 100644 --- a/third_party/blink/renderer/modules/xr/OWNERS +++ b/third_party/blink/renderer/modules/xr/OWNERS
@@ -1,5 +1,6 @@ alcooper@chromium.org bajones@chromium.org +billorr@chromium.org klausw@chromium.org # TEAM: xr-dev@chromium.org
diff --git a/third_party/blink/renderer/modules/xr/xr_session.cc b/third_party/blink/renderer/modules/xr/xr_session.cc index 97bb889..f61f80a 100644 --- a/third_party/blink/renderer/modules/xr/xr_session.cc +++ b/third_party/blink/renderer/modules/xr/xr_session.cc
@@ -69,6 +69,10 @@ // TODO(bajones): This is something that we probably want to make configurable. const double kMagicWindowVerticalFieldOfView = 75.0f * M_PI / 180.0f; +// Indices into the views array. +const unsigned int kMonoOrStereoLeftView = 0; +const unsigned int kStereoRightView = 1; + void UpdateViewFromEyeParameters( XRViewData& view, const device::mojom::blink::VREyeParametersPtr& eye, @@ -953,17 +957,17 @@ // In immersive mode the projection and view matrices must be aligned with // the device's physical optics. UpdateViewFromEyeParameters( - views_[XRView::kEyeLeft], display_info_->leftEye, + views_[kMonoOrStereoLeftView], display_info_->leftEye, render_state_->depthNear(), render_state_->depthFar()); if (display_info_->rightEye) { UpdateViewFromEyeParameters( - views_[XRView::kEyeRight], display_info_->rightEye, + views_[kStereoRightView], display_info_->rightEye, render_state_->depthNear(), render_state_->depthFar()); } } else { if (views_.IsEmpty()) { - views_.emplace_back(XRView::kEyeLeft); - views_[XRView::kEyeLeft].UpdateOffset(0, 0, 0); + views_.emplace_back(XRView::kEyeNone); + views_[kMonoOrStereoLeftView].UpdateOffset(0, 0, 0); } float aspect = 1.0f; @@ -975,7 +979,7 @@ // In non-immersive mode, if there is no explicit projection matrix // provided, the projection matrix must be aligned with the // output canvas dimensions. - views_[XRView::kEyeLeft].UpdateProjectionMatrixFromAspect( + views_[kMonoOrStereoLeftView].UpdateProjectionMatrixFromAspect( kMagicWindowVerticalFieldOfView, aspect, render_state_->depthNear(), render_state_->depthFar()); }
diff --git a/third_party/blink/renderer/modules/xr/xr_view.cc b/third_party/blink/renderer/modules/xr/xr_view.cc index bf7f735f..5baeb0d5 100644 --- a/third_party/blink/renderer/modules/xr/xr_view.cc +++ b/third_party/blink/renderer/modules/xr/xr_view.cc
@@ -13,7 +13,16 @@ XRView::XRView(XRSession* session, const XRViewData& view_data) : eye_(view_data.Eye()), session_(session) { - eye_string_ = (eye_ == kEyeLeft ? "left" : "right"); + switch (eye_) { + case kEyeLeft: + eye_string_ = "left"; + break; + case kEyeRight: + eye_string_ = "right"; + break; + default: + eye_string_ = "none"; + } transform_ = MakeGarbageCollected<XRRigidTransform>(view_data.Transform()); projection_matrix_ = transformationMatrixToDOMFloat32Array(view_data.ProjectionMatrix());
diff --git a/third_party/blink/renderer/modules/xr/xr_view.h b/third_party/blink/renderer/modules/xr/xr_view.h index 891bbd8..04117b0 100644 --- a/third_party/blink/renderer/modules/xr/xr_view.h +++ b/third_party/blink/renderer/modules/xr/xr_view.h
@@ -26,7 +26,7 @@ public: XRView(XRSession*, const XRViewData&); - enum XREye { kEyeLeft = 0, kEyeRight = 1 }; + enum XREye { kEyeNone = 0, kEyeLeft = 1, kEyeRight = 2 }; const String& eye() const { return eye_string_; } XREye EyeValue() const { return eye_; }
diff --git a/third_party/blink/renderer/modules/xr/xr_view.idl b/third_party/blink/renderer/modules/xr/xr_view.idl index 96203598..5cb6e88 100644 --- a/third_party/blink/renderer/modules/xr/xr_view.idl +++ b/third_party/blink/renderer/modules/xr/xr_view.idl
@@ -4,6 +4,7 @@ // https://immersive-web.github.io/webxr/#xrview-interface enum XREye { + "none", "left", "right" };
diff --git a/third_party/blink/renderer/platform/audio/audio_destination.cc b/third_party/blink/renderer/platform/audio/audio_destination.cc index 3543299..abaeb9f 100644 --- a/third_party/blink/renderer/platform/audio/audio_destination.cc +++ b/third_party/blink/renderer/platform/audio/audio_destination.cc
@@ -187,11 +187,11 @@ // Use the dual-thread rendering model if the AudioWorklet is activated. if (worklet_task_runner_) { PostCrossThreadTask( - *worklet_task_runner_, - FROM_HERE, - CrossThreadBind(&AudioDestination::RequestRender, WrapRefCounted(this), - number_of_frames, frames_to_render, delay, - delay_timestamp, prior_frames_skipped)); + *worklet_task_runner_, FROM_HERE, + CrossThreadBindOnce(&AudioDestination::RequestRender, + WrapRefCounted(this), number_of_frames, + frames_to_render, delay, delay_timestamp, + prior_frames_skipped)); } else { // Otherwise use the single-thread rendering with AudioDeviceThread. RequestRender(number_of_frames, frames_to_render, delay,
diff --git a/third_party/blink/renderer/platform/audio/hrtf_database_loader.cc b/third_party/blink/renderer/platform/audio/hrtf_database_loader.cc index 7086598..22718706 100644 --- a/third_party/blink/renderer/platform/audio/hrtf_database_loader.cc +++ b/third_party/blink/renderer/platform/audio/hrtf_database_loader.cc
@@ -98,8 +98,8 @@ ThreadCreationParams(WebThreadType::kHRTFDatabaseLoaderThread)); // TODO(alexclarke): Should this be posted as a loading task? PostCrossThreadTask(*thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&HRTFDatabaseLoader::LoadTask, - CrossThreadUnretained(this))); + CrossThreadBindOnce(&HRTFDatabaseLoader::LoadTask, + CrossThreadUnretained(this))); } HRTFDatabase* HRTFDatabaseLoader::Database() { @@ -128,9 +128,9 @@ base::WaitableEvent sync; // TODO(alexclarke): Should this be posted as a loading task? PostCrossThreadTask(*thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&HRTFDatabaseLoader::CleanupTask, - CrossThreadUnretained(this), - CrossThreadUnretained(&sync))); + CrossThreadBindOnce(&HRTFDatabaseLoader::CleanupTask, + CrossThreadUnretained(this), + CrossThreadUnretained(&sync))); sync.Wait(); thread_.reset(); }
diff --git a/third_party/blink/renderer/platform/audio/push_pull_fifo_multithread_test.cc b/third_party/blink/renderer/platform/audio/push_pull_fifo_multithread_test.cc index 427e3589..b1509de 100644 --- a/third_party/blink/renderer/platform/audio/push_pull_fifo_multithread_test.cc +++ b/third_party/blink/renderer/platform/audio/push_pull_fifo_multithread_test.cc
@@ -43,8 +43,8 @@ duration_ms_ = duration_ms; interval_ms_ = interval_ms; PostCrossThreadTask(*client_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&FIFOClient::RunTaskOnOwnThread, - CrossThreadUnretained(this))); + CrossThreadBindOnce(&FIFOClient::RunTaskOnOwnThread, + CrossThreadUnretained(this))); return done_event_.get(); }
diff --git a/third_party/blink/renderer/platform/audio/reverb_convolver.cc b/third_party/blink/renderer/platform/audio/reverb_convolver.cc index 64ae945..42629c9 100644 --- a/third_party/blink/renderer/platform/audio/reverb_convolver.cc +++ b/third_party/blink/renderer/platform/audio/reverb_convolver.cc
@@ -201,9 +201,10 @@ // Now that we've buffered more input, post another task to the background // thread. if (background_thread_) { - PostCrossThreadTask(*background_thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&ReverbConvolver::ProcessInBackground, - CrossThreadUnretained(this))); + PostCrossThreadTask( + *background_thread_->GetTaskRunner(), FROM_HERE, + CrossThreadBindOnce(&ReverbConvolver::ProcessInBackground, + CrossThreadUnretained(this))); } }
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string.cc b/third_party/blink/renderer/platform/bindings/parkable_string.cc index 5faec25..2af4525 100644 --- a/third_party/blink/renderer/platform/bindings/parkable_string.cc +++ b/third_party/blink/renderer/platform/bindings/parkable_string.cc
@@ -627,7 +627,7 @@ size_t size = params->size; PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](std::unique_ptr<CompressionTaskParams> params, std::unique_ptr<Vector<uint8_t>> compressed, base::TimeDelta parking_thread_time) {
diff --git a/third_party/blink/renderer/platform/blob/blob_bytes_provider.cc b/third_party/blink/renderer/platform/blob/blob_bytes_provider.cc index bb094a2..1137c76 100644 --- a/third_party/blink/renderer/platform/blob/blob_bytes_provider.cc +++ b/third_party/blink/renderer/platform/blob/blob_bytes_provider.cc
@@ -95,7 +95,7 @@ void IncreaseChildProcessRefCount() { if (!WTF::IsMainThread()) { PostCrossThreadTask(*Thread::MainThread()->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&IncreaseChildProcessRefCount)); + CrossThreadBindOnce(&IncreaseChildProcessRefCount)); return; } Platform::Current()->SuddenTerminationChanged(false); @@ -104,7 +104,7 @@ void DecreaseChildProcessRefCount() { if (!WTF::IsMainThread()) { PostCrossThreadTask(*Thread::MainThread()->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&DecreaseChildProcessRefCount)); + CrossThreadBindOnce(&DecreaseChildProcessRefCount)); return; } Platform::Current()->SuddenTerminationChanged(true); @@ -125,7 +125,7 @@ // using the MayBlock taskrunner for actual file operations. PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](std::unique_ptr<BlobBytesProvider> provider, mojom::blink::BytesProviderRequest request) { mojo::MakeStrongBinding(std::move(provider), std::move(request));
diff --git a/third_party/blink/renderer/platform/exported/mediastream/media_stream_audio_processor_options.cc b/third_party/blink/renderer/platform/exported/mediastream/media_stream_audio_processor_options.cc index efd60c2..00c875af 100644 --- a/third_party/blink/renderer/platform/exported/mediastream/media_stream_audio_processor_options.cc +++ b/third_party/blink/renderer/platform/exported/mediastream/media_stream_audio_processor_options.cc
@@ -113,30 +113,25 @@ return out; } -void EnableEchoCancellation(AudioProcessing* audio_processing) { - webrtc::AudioProcessing::Config apm_config = audio_processing->GetConfig(); - apm_config.echo_canceller.enabled = true; +void EnableEchoCancellation(AudioProcessing::Config* apm_config) { + apm_config->echo_canceller.enabled = true; #if defined(OS_ANDROID) - apm_config.echo_canceller.mobile_mode = true; + apm_config->echo_canceller.mobile_mode = true; #else - apm_config.echo_canceller.mobile_mode = false; + apm_config->echo_canceller.mobile_mode = false; #endif - audio_processing->ApplyConfig(apm_config); } -void EnableNoiseSuppression(AudioProcessing* audio_processing, - webrtc::NoiseSuppression::Level ns_level) { - int err = audio_processing->noise_suppression()->set_level(ns_level); - err |= audio_processing->noise_suppression()->Enable(true); - CHECK_EQ(err, 0); +void EnableNoiseSuppression( + AudioProcessing::Config* apm_config, + AudioProcessing::Config::NoiseSuppression::Level ns_level) { + apm_config->noise_suppression.enabled = true; + apm_config->noise_suppression.level = ns_level; } -void EnableTypingDetection(AudioProcessing* audio_processing, +void EnableTypingDetection(AudioProcessing::Config* apm_config, webrtc::TypingDetection* typing_detector) { - webrtc::AudioProcessing::Config apm_config = audio_processing->GetConfig(); - apm_config.voice_detection.enabled = true; - audio_processing->ApplyConfig(apm_config); - + apm_config->voice_detection.enabled = true; // Configure the update period to 1s (100 * 10ms) in the typing detector. typing_detector->SetParameters(0, 0, 0, 0, 0, 100); } @@ -184,7 +179,7 @@ } void ConfigAutomaticGainControl( - webrtc::AudioProcessing::Config* apm_config, + AudioProcessing::Config* apm_config, bool agc_enabled, bool experimental_agc_enabled, bool use_hybrid_agc, @@ -202,9 +197,9 @@ apm_config->gain_controller1.enabled = true; apm_config->gain_controller1.mode = #if defined(OS_ANDROID) - webrtc::AudioProcessing::Config::GainController1::Mode::kFixedDigital; + AudioProcessing::Config::GainController1::Mode::kFixedDigital; #else - webrtc::AudioProcessing::Config::GainController1::Mode::kAdaptiveAnalog; + AudioProcessing::Config::GainController1::Mode::kAdaptiveAnalog; #endif } @@ -220,7 +215,7 @@ apm_config->gain_controller2.adaptive_digital.enabled = true; using LevelEstimator = - webrtc::AudioProcessing::Config::GainController2::LevelEstimator; + AudioProcessing::Config::GainController2::LevelEstimator; apm_config->gain_controller2.adaptive_digital.level_estimator = hybrid_agc_use_peaks_not_rms.value() ? LevelEstimator::kPeak : LevelEstimator::kRms; @@ -239,7 +234,7 @@ } } -void ConfigPreAmplifier(webrtc::AudioProcessing::Config* apm_config, +void ConfigPreAmplifier(AudioProcessing::Config* apm_config, base::Optional<double> fixed_gain_factor) { if (!!fixed_gain_factor) { apm_config->pre_amplifier.enabled = true;
diff --git a/third_party/blink/renderer/platform/exported/platform.cc b/third_party/blink/renderer/platform/exported/platform.cc index 1a373d0..60e7d1f 100644 --- a/third_party/blink/renderer/platform/exported/platform.cc +++ b/third_party/blink/renderer/platform/exported/platform.cc
@@ -111,7 +111,7 @@ void* context) { PostCrossThreadTask( *Thread::MainThread()->GetTaskRunner(), FROM_HERE, - CrossThreadBind(function, CrossThreadUnretained(context))); + CrossThreadBindOnce(function, CrossThreadUnretained(context))); } Platform::Platform() {
diff --git a/third_party/blink/renderer/platform/exported/web_resource_timing_info_test.cc b/third_party/blink/renderer/platform/exported/web_resource_timing_info_test.cc index c0e61fac..04b20342 100644 --- a/third_party/blink/renderer/platform/exported/web_resource_timing_info_test.cc +++ b/third_party/blink/renderer/platform/exported/web_resource_timing_info_test.cc
@@ -120,9 +120,9 @@ std::unique_ptr<Thread> thread = Platform::Current()->CreateThread( ThreadCreationParams(WebThreadType::kTestThread) .SetThreadNameForTest("TestThread")); - PostCrossThreadTask( - *thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&CheckWebResourceTimingInfoOnThread, info, pseudo_time)); + PostCrossThreadTask(*thread->GetTaskRunner(), FROM_HERE, + CrossThreadBindOnce(&CheckWebResourceTimingInfoOnThread, + info, pseudo_time)); } } // namespace blink
diff --git a/third_party/blink/renderer/platform/fonts/font.cc b/third_party/blink/renderer/platform/fonts/font.cc index 56591515..898aeaff8 100644 --- a/third_party/blink/renderer/platform/fonts/font.cc +++ b/third_party/blink/renderer/platform/fonts/font.cc
@@ -107,11 +107,12 @@ namespace { -void DrawBlobs(cc::PaintCanvas* canvas, - const cc::PaintFlags& flags, - const ShapeResultBloberizer::BlobBuffer& blobs, - const FloatPoint& point, - const cc::NodeHolder& node_holder = cc::NodeHolder()) { +void DrawBlobs( + cc::PaintCanvas* canvas, + const cc::PaintFlags& flags, + const ShapeResultBloberizer::BlobBuffer& blobs, + const FloatPoint& point, + const cc::NodeHolder& node_holder = cc::NodeHolder::EmptyNodeHolder()) { for (const auto& blob_info : blobs) { DCHECK(blob_info.blob); cc::PaintCanvasAutoRestore auto_restore(canvas, false); @@ -175,7 +176,7 @@ ShapeResultBloberizer bloberizer(*this, device_scale_factor); bloberizer.FillGlyphs(text_info.text, text_info.from, text_info.to, text_info.shape_result); - DrawBlobs(canvas, flags, bloberizer.Blobs(), point); + DrawBlobs(canvas, flags, bloberizer.Blobs(), point, node_holder); } bool Font::DrawBidiText(cc::PaintCanvas* canvas,
diff --git a/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc index 4f10d77..20b03cb3 100644 --- a/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc +++ b/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc
@@ -118,7 +118,7 @@ if (!original_skia_image_task_runner_->BelongsToCurrentThread()) { PostCrossThreadTask( *original_skia_image_task_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &DestroySkImageOnOriginalThread, std::move(original_skia_image_), std::move(original_skia_image_context_provider_wrapper_), WTF::Passed(std::move(sync_token))));
diff --git a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc index 6b61a385..fcb34a4b 100644 --- a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc +++ b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc
@@ -194,7 +194,7 @@ int next_async_mutation_id) { PostCrossThreadTask( *host_queue, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( &AnimationWorkletMutatorDispatcherImpl::AsyncMutationsDone, dispatcher, next_async_mutation_id)); }, @@ -313,7 +313,7 @@ PostCrossThreadTask( *worklet_queue, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](AnimationWorkletMutator* mutator, std::unique_ptr<AnimationWorkletInput> input, scoped_refptr<OutputVectorRef> outputs, int index,
diff --git a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc index 7011d0a..22583f6f 100644 --- a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc +++ b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc
@@ -63,7 +63,7 @@ void BlockWorkletThread() { PostCrossThreadTask( *expected_runner_, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](base::WaitableEvent* start_processing_event) { start_processing_event->Wait(); },
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.cc b/third_party/blink/renderer/platform/graphics/canvas_resource.cc index 1abda19..cd927ea 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.cc
@@ -772,9 +772,10 @@ if (!original_task_runner->BelongsToCurrentThread()) { PostCrossThreadTask( *original_task_runner, FROM_HERE, - CrossThreadBind(&CanvasResourceSharedImage::OnBitmapImageDestroyed, - std::move(resource), std::move(original_task_runner), - sync_token, is_lost)); + CrossThreadBindOnce(&CanvasResourceSharedImage::OnBitmapImageDestroyed, + std::move(resource), + std::move(original_task_runner), sync_token, + is_lost)); return; }
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc index a5603619..8399f248 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc
@@ -140,10 +140,10 @@ PostCrossThreadTask( *Thread::MainThread()->Scheduler()->CompositorTaskRunner(), FROM_HERE, - CrossThreadBind(UpdatePlaceholderImage, this->GetWeakPtr(), - WTF::Passed(std::move(dispatcher_task_runner)), - placeholder_canvas_id_, std::move(canvas_resource), - resource_id)); + CrossThreadBindOnce(UpdatePlaceholderImage, this->GetWeakPtr(), + WTF::Passed(std::move(dispatcher_task_runner)), + placeholder_canvas_id_, std::move(canvas_resource), + resource_id)); } void CanvasResourceDispatcher::DispatchFrameSync(
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc index df9a79f7..9cc4219 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc +++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
@@ -307,11 +307,11 @@ bool PaintArtifactCompositor::HasComposited( CompositorElementId element_id) const { - // |Update| sets the LayerTreeHost's |elements_in_property_trees_| to the - // elements composited by PaintArtifactCompositor. Look up whether the - // given |element_id| has been created. + // |Update| creates PropertyTrees on the LayerTreeHost to represent the + // composited page state. Check if it has created a property tree node for + // the given |element_id|. DCHECK(!NeedsUpdate()) << "This should only be called after an update"; - return root_layer_->layer_tree_host()->elements_in_property_trees().count( + return root_layer_->layer_tree_host()->property_trees()->HasElement( element_id); } @@ -797,7 +797,6 @@ void PaintArtifactCompositor::Update( scoped_refptr<const PaintArtifact> paint_artifact, - CompositorElementIdSet& animation_element_ids, const ViewportProperties& viewport_properties, const Settings& settings) { DCHECK(NeedsUpdate()); @@ -824,9 +823,9 @@ g_s_property_tree_sequence_number); LayerListBuilder layer_list_builder; - PropertyTreeManager property_tree_manager( - *this, *host->property_trees(), *root_layer_, layer_list_builder, - animation_element_ids, g_s_property_tree_sequence_number); + PropertyTreeManager property_tree_manager(*this, *host->property_trees(), + *root_layer_, layer_list_builder, + g_s_property_tree_sequence_number); CollectPendingLayers(*paint_artifact, settings); UpdateCompositorViewportProperties(viewport_properties, property_tree_manager, @@ -843,8 +842,6 @@ for (auto& entry : synthesized_clip_cache_) entry.in_use = false; - // Clear prior frame ids before inserting new ones. - animation_element_ids.clear(); for (auto& pending_layer : pending_layers_) { const auto& property_state = pending_layer.property_tree_state; const auto& clip = property_state.Clip(); @@ -913,9 +910,6 @@ pending_layer.FirstPaintChunk(*paint_artifact).id.client.OwnerNodeId()); // TODO(wangxianzhu): cc_picture_layer_->set_compositing_reasons(...); - if (layer->scrollable()) - animation_element_ids.insert(layer->element_id()); - // If the property tree state has changed between the layer and the root, we // need to inform the compositor so damage can be calculated. // Calling |PropertyTreeStateChanged| for every pending layer is @@ -951,8 +945,8 @@ blink_effects); root_layer_->SetChildLayerList(std::move(layers)); - // Update the host's active registered element ids. - host->SetActiveRegisteredElementIds(animation_element_ids); + // Update the host's active registered elements from the new property tree. + host->UpdateActiveElements(); // Mark the property trees as having been rebuilt. host->property_trees()->needs_rebuild = false;
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h index f5eb03e5..5a2c3fc 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h +++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
@@ -134,7 +134,6 @@ // Populates |animation_element_ids| with the CompositorElementId of all // animations for which we saw a paint chunk and created a layer. void Update(scoped_refptr<const PaintArtifact>, - CompositorElementIdSet& animation_element_ids, const ViewportProperties& viewport_properties, const Settings& settings);
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc index c712eb03..a590931 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc +++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc
@@ -137,22 +137,15 @@ return property_trees->element_id_to_scroll_node_index[element_id]; } - void Update(scoped_refptr<const PaintArtifact> artifact) { - CompositorElementIdSet element_ids; - Update(artifact, element_ids); - } - using ViewportProperties = PaintArtifactCompositor::ViewportProperties; using Settings = PaintArtifactCompositor::Settings; void Update( scoped_refptr<const PaintArtifact> artifact, - CompositorElementIdSet& element_ids, const ViewportProperties& viewport_properties = ViewportProperties(), const Settings& settings = Settings()) { paint_artifact_compositor_->SetNeedsUpdate(); - paint_artifact_compositor_->Update(artifact, element_ids, - viewport_properties, settings); + paint_artifact_compositor_->Update(artifact, viewport_properties, settings); layer_tree_->layer_tree_host()->LayoutAndUpdateLayers(); } @@ -1044,10 +1037,7 @@ .RectDrawing(FloatRect(-110, 12, 170, 19), Color::kWhite); // Scroll node ElementIds are referenced by scroll animations. - CompositorElementIdSet composited_element_ids; - Update(artifact.Build(), composited_element_ids); - EXPECT_EQ(1u, composited_element_ids.size()); - EXPECT_TRUE(composited_element_ids.count(scroll_element_id)); + Update(artifact.Build()); const cc::ScrollTree& scroll_tree = GetPropertyTrees().scroll_tree; // Node #0 reserved for null; #1 for root render surface. @@ -2351,50 +2341,6 @@ EXPECT_EQ(1, layer4->effect_tree_index()); } -TEST_P(PaintArtifactCompositorTest, UpdatePopulatesCompositedElementIds) { - auto transform = CreateAnimatingTransform(t0()); - auto effect = CreateAnimatingOpacityEffect(e0()); - TestPaintArtifact artifact; - artifact.Chunk(*transform, c0(), e0()) - .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack) - .Chunk(t0(), c0(), *effect) - .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack); - - CompositorElementIdSet composited_element_ids; - Update(artifact.Build(), composited_element_ids); - - EXPECT_EQ(2u, composited_element_ids.size()); - EXPECT_TRUE( - composited_element_ids.count(transform->GetCompositorElementId())); - EXPECT_TRUE(composited_element_ids.count(effect->GetCompositorElementId())); -} - -// If we have both a transform and an opacity animation, they should both be -// included in the composited element id set returned from -// |PaintArtifactCompositor::Update(...)|. -TEST_P(PaintArtifactCompositorTest, UniqueAnimationCompositedElementIds) { - auto animating_transform = CreateAnimatingTransform(t0()); - auto non_animating_transform = CreateTransform( - *animating_transform, TransformationMatrix().Translate(10, 20)); - auto animating_effect = CreateAnimatingOpacityEffect(e0()); - auto non_animating_effect = CreateOpacityEffect(*animating_effect, 0.5f); - - CompositorElementIdSet composited_element_ids; - Update(TestPaintArtifact() - .Chunk(*animating_transform, c0(), *animating_effect) - .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack) - .Chunk(*non_animating_transform, c0(), *non_animating_effect) - .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack) - .Build(), - composited_element_ids); - - EXPECT_EQ(2u, composited_element_ids.size()); - EXPECT_EQ(1u, composited_element_ids.count( - animating_transform->GetCompositorElementId())); - EXPECT_EQ(1u, composited_element_ids.count( - animating_effect->GetCompositorElementId())); -} - TEST_P(PaintArtifactCompositorTest, SkipChunkWithOpacityZero) { UpdateWithArtifactWithOpacity(0, false, false); if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) @@ -2556,17 +2502,17 @@ Update(artifact.Build()); ASSERT_EQ(1u, ContentLayerCount()); - ASSERT_TRUE(GetLayerTreeHost().IsElementInList( + ASSERT_TRUE(GetLayerTreeHost().IsElementInPropertyTrees( element_id, cc::ElementListType::ACTIVE)); } { TestPaintArtifact artifact; - ASSERT_TRUE(GetLayerTreeHost().IsElementInList( + ASSERT_TRUE(GetLayerTreeHost().IsElementInPropertyTrees( element_id, cc::ElementListType::ACTIVE)); Update(artifact.Build()); ASSERT_EQ(0u, ContentLayerCount()); - ASSERT_FALSE(GetLayerTreeHost().IsElementInList( + ASSERT_FALSE(GetLayerTreeHost().IsElementInPropertyTrees( element_id, cc::ElementListType::ACTIVE)); } } @@ -3885,8 +3831,7 @@ TestPaintArtifact artifact; ViewportProperties viewport_properties; viewport_properties.page_scale = scale_transform_node.get(); - CompositorElementIdSet element_ids; - Update(artifact.Build(), element_ids, viewport_properties); + Update(artifact.Build(), viewport_properties); cc::TransformTree& transform_tree = GetPropertyTrees().transform_tree; cc::TransformNode* cc_transform_node = transform_tree.FindNodeFromElementId( @@ -3927,8 +3872,7 @@ .RectDrawing(FloatRect(0, 0, 10, 10), Color::kBlack); ViewportProperties viewport_properties; viewport_properties.page_scale = page_scale_transform.get(); - CompositorElementIdSet element_ids; - Update(artifact.Build(), element_ids, viewport_properties); + Update(artifact.Build(), viewport_properties); cc::TransformTree& transform_tree = GetPropertyTrees().transform_tree; const auto* cc_page_scale_transform = transform_tree.FindNodeFromElementId( @@ -3982,8 +3926,7 @@ .RectDrawing(FloatRect(0, 0, 10, 10), Color::kBlack); ViewportProperties viewport_properties; viewport_properties.page_scale = scale_transform_node.get(); - CompositorElementIdSet element_ids; - Update(artifact.Build(), element_ids, viewport_properties); + Update(artifact.Build(), viewport_properties); cc::ScrollTree& scroll_tree = GetPropertyTrees().scroll_tree; cc::ScrollNode* cc_scroll_node =
diff --git a/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc b/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc index 31ffabe..e385494 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc +++ b/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc
@@ -44,13 +44,11 @@ cc::PropertyTrees& property_trees, cc::Layer& root_layer, LayerListBuilder& layer_list_builder, - CompositorElementIdSet& animation_element_ids, int new_sequence_number) : client_(client), property_trees_(property_trees), root_layer_(root_layer), layer_list_builder_(layer_list_builder), - animation_element_ids_(animation_element_ids), new_sequence_number_(new_sequence_number) { SetupRootTransformNode(); SetupRootClipNode(); @@ -464,7 +462,6 @@ property_trees_.element_id_to_transform_node_index[compositor_element_id] = id; compositor_node.element_id = compositor_element_id; - CollectAnimationElementId(compositor_element_id); } // If this transform is a scroll offset translation, create the associated @@ -936,19 +933,6 @@ return delegated_blend; } -void PropertyTreeManager::CollectAnimationElementId( - CompositorElementId element_id) { - // Collect the element id if the namespace is one of the ones needed for - // running animations on the compositor. These are the only element_ids the - // compositor needs to track existence of in the element id set. - auto element_namespace = NamespaceFromCompositorElementId(element_id); - if (element_namespace == CompositorElementIdNamespace::kPrimaryTransform || - element_namespace == CompositorElementIdNamespace::kPrimaryEffect || - element_namespace == CompositorElementIdNamespace::kEffectFilter) { - animation_element_ids_.insert(element_id); - } -} - void PropertyTreeManager::BuildEffectNodesRecursively( const EffectPaintPropertyNode& next_effect_arg) { const auto& next_effect = next_effect_arg.Unalias(); @@ -993,7 +977,6 @@ compositor_element_id)); property_trees_.element_id_to_effect_node_index[compositor_element_id] = effect_node.id; - CollectAnimationElementId(compositor_element_id); } effect_stack_.emplace_back(current_);
diff --git a/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h b/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h index 8a9e980..a9811c2 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h +++ b/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h
@@ -53,7 +53,6 @@ cc::PropertyTrees& property_trees, cc::Layer& root_layer, LayerListBuilder& layer_list_builder, - CompositorElementIdSet& animation_element_ids, int new_sequence_number); ~PropertyTreeManager(); @@ -259,7 +258,6 @@ cc::Layer& root_layer_; LayerListBuilder& layer_list_builder_; - CompositorElementIdSet& animation_element_ids_; int new_sequence_number_;
diff --git a/third_party/blink/renderer/platform/graphics/deferred_image_decoder_test.cc b/third_party/blink/renderer/platform/graphics/deferred_image_decoder_test.cc index d96aee4..4320a3e 100644 --- a/third_party/blink/renderer/platform/graphics/deferred_image_decoder_test.cc +++ b/third_party/blink/renderer/platform/graphics/deferred_image_decoder_test.cc
@@ -271,8 +271,8 @@ .SetThreadNameForTest("RasterThread")); PostCrossThreadTask( *thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&RasterizeMain, CrossThreadUnretained(canvas_.get()), - record)); + CrossThreadBindOnce(&RasterizeMain, CrossThreadUnretained(canvas_.get()), + record)); thread.reset(); EXPECT_EQ(0, decode_request_count_); EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), bitmap_.getColor(0, 0));
diff --git a/third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.cc b/third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.cc index 2d8c47f..5ce7e31 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.cc
@@ -126,11 +126,11 @@ Thread::MainThread()->GetTaskRunner(); PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind(&CreateContextProviderOnMainThread, - only_if_gpu_compositing, - CrossThreadUnretained(&is_gpu_compositing_disabled_), - CrossThreadUnretained(&context_provider_wrapper_), - CrossThreadUnretained(&waitable_event))); + CrossThreadBindOnce( + &CreateContextProviderOnMainThread, only_if_gpu_compositing, + CrossThreadUnretained(&is_gpu_compositing_disabled_), + CrossThreadUnretained(&context_provider_wrapper_), + CrossThreadUnretained(&waitable_event))); waitable_event.Wait(); if (context_provider_wrapper_ && !context_provider_wrapper_->ContextProvider()->BindToCurrentThread())
diff --git a/third_party/blink/renderer/platform/graphics/image_frame_generator_test.cc b/third_party/blink/renderer/platform/graphics/image_frame_generator_test.cc index c7d946f..2c09473 100644 --- a/third_party/blink/renderer/platform/graphics/image_frame_generator_test.cc +++ b/third_party/blink/renderer/platform/graphics/image_frame_generator_test.cc
@@ -271,8 +271,8 @@ .SetThreadNameForTest("DecodeThread")); PostCrossThreadTask( *thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&DecodeThreadMain, WTF::RetainedRef(generator_), - WTF::RetainedRef(segment_reader_))); + CrossThreadBindOnce(&DecodeThreadMain, WTF::RetainedRef(generator_), + WTF::RetainedRef(segment_reader_))); thread.reset(); EXPECT_EQ(2, decode_request_count_); EXPECT_EQ(1, decoders_destroyed_);
diff --git a/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc b/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc index da6cd935..6e06b938 100644 --- a/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc +++ b/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc
@@ -145,10 +145,10 @@ thread_id_ != Thread::Current()->ThreadId()) { PostCrossThreadTask( *texture_thread_task_runner_, FROM_HERE, - CrossThreadBind(&ReleaseTexture, is_converted_from_skia_texture_, - texture_id_, WTF::Passed(std::move(passed_mailbox)), - WTF::Passed(ContextProviderWrapper()), - WTF::Passed(std::move(passed_sync_token)))); + CrossThreadBindOnce(&ReleaseTexture, is_converted_from_skia_texture_, + texture_id_, WTF::Passed(std::move(passed_mailbox)), + WTF::Passed(ContextProviderWrapper()), + WTF::Passed(std::move(passed_sync_token)))); } else { ReleaseTexture(is_converted_from_skia_texture_, texture_id_, std::move(passed_mailbox), ContextProviderWrapper(),
diff --git a/third_party/blink/renderer/platform/graphics/offscreen_canvas_placeholder.cc b/third_party/blink/renderer/platform/graphics/offscreen_canvas_placeholder.cc index b5933630..d17de32 100644 --- a/third_party/blink/renderer/platform/graphics/offscreen_canvas_placeholder.cc +++ b/third_party/blink/renderer/platform/graphics/offscreen_canvas_placeholder.cc
@@ -100,11 +100,11 @@ if (placeholder_frame_) { DCHECK(frame_dispatcher_task_runner_); placeholder_frame_->Transfer(); - PostCrossThreadTask( - *frame_dispatcher_task_runner_, FROM_HERE, - CrossThreadBind(releaseFrameToDispatcher, std::move(frame_dispatcher_), - std::move(placeholder_frame_), - placeholder_frame_resource_id_)); + PostCrossThreadTask(*frame_dispatcher_task_runner_, FROM_HERE, + CrossThreadBindOnce(releaseFrameToDispatcher, + std::move(frame_dispatcher_), + std::move(placeholder_frame_), + placeholder_frame_resource_id_)); } } @@ -150,7 +150,7 @@ return false; PostCrossThreadTask( *frame_dispatcher_task_runner_, FROM_HERE, - CrossThreadBind(SetSuspendAnimation, frame_dispatcher_, suspend)); + CrossThreadBindOnce(SetSuspendAnimation, frame_dispatcher_, suspend)); return true; }
diff --git a/third_party/blink/renderer/platform/graphics/paint_worklet_paint_dispatcher.cc b/third_party/blink/renderer/platform/graphics/paint_worklet_paint_dispatcher.cc index 92bc9e3..a523492f 100644 --- a/third_party/blink/renderer/platform/graphics/paint_worklet_paint_dispatcher.cc +++ b/third_party/blink/renderer/platform/graphics/paint_worklet_paint_dispatcher.cc
@@ -98,7 +98,7 @@ PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( [](PaintWorkletPainter* painter, cc::PaintWorkletInput* input, std::unique_ptr<AutoSignal> completion, sk_sp<cc::PaintRecord>* output) {
diff --git a/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc index bb8b1e7e..39b0fd86 100644 --- a/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc +++ b/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc
@@ -50,8 +50,8 @@ if (!original_skia_image_task_runner_->BelongsToCurrentThread()) { PostCrossThreadTask( *original_skia_image_task_runner_, FROM_HERE, - CrossThreadBind([](sk_sp<SkImage> image) { image.reset(); }, - std::move(original_skia_image_))); + CrossThreadBindOnce([](sk_sp<SkImage> image) { image.reset(); }, + std::move(original_skia_image_))); } else { original_skia_image_.reset(); }
diff --git a/third_party/blink/renderer/platform/heap/heap.h b/third_party/blink/renderer/platform/heap/heap.h index 8f2ae61..0684133f 100644 --- a/third_party/blink/renderer/platform/heap/heap.h +++ b/third_party/blink/renderer/platform/heap/heap.h
@@ -523,10 +523,9 @@ "T needs to be a garbage collected object"); void* memory = T::AllocateObject(sizeof(T), IsEagerlyFinalizedType<T>::value); HeapObjectHeader* header = HeapObjectHeader::FromPayload(memory); - header->MarkIsInConstruction(); // Placement new as regular operator new() is deleted. T* object = ::new (memory) T(std::forward<Args>(args)...); - header->UnmarkIsInConstruction(); + header->MarkFullyConstructed(); return object; } @@ -545,10 +544,9 @@ void* memory = T::AllocateObject(sizeof(T) + additional_bytes.value, IsEagerlyFinalizedType<T>::value); HeapObjectHeader* header = HeapObjectHeader::FromPayload(memory); - header->MarkIsInConstruction(); // Placement new as regular operator new() is deleted. T* object = ::new (memory) T(std::forward<Args>(args)...); - header->UnmarkIsInConstruction(); + header->MarkFullyConstructed(); return object; }
diff --git a/third_party/blink/renderer/platform/heap/heap_allocator.h b/third_party/blink/renderer/platform/heap/heap_allocator.h index 04159a8e..7fffed76 100644 --- a/third_party/blink/renderer/platform/heap/heap_allocator.h +++ b/third_party/blink/renderer/platform/heap/heap_allocator.h
@@ -75,8 +75,8 @@ uint32_t gc_info_index = GCInfoTrait<HeapVectorBacking<T>>::Index(); NormalPageArena* arena = static_cast<NormalPageArena*>( state->Heap().VectorBackingArena(gc_info_index)); - return reinterpret_cast<T*>(arena->AllocateObject( - ThreadHeap::AllocationSizeFromSize(size), gc_info_index)); + return reinterpret_cast<T*>(MarkAsConstructed(arena->AllocateObject( + ThreadHeap::AllocationSizeFromSize(size), gc_info_index))); } template <typename T> static T* AllocateExpandedVectorBacking(size_t size) { @@ -86,8 +86,8 @@ uint32_t gc_info_index = GCInfoTrait<HeapVectorBacking<T>>::Index(); NormalPageArena* arena = static_cast<NormalPageArena*>( state->Heap().ExpandedVectorBackingArena(gc_info_index)); - return reinterpret_cast<T*>(arena->AllocateObject( - ThreadHeap::AllocationSizeFromSize(size), gc_info_index)); + return reinterpret_cast<T*>(MarkAsConstructed(arena->AllocateObject( + ThreadHeap::AllocationSizeFromSize(size), gc_info_index))); } static void FreeVectorBacking(void*); static bool ExpandVectorBacking(void*, size_t); @@ -100,9 +100,10 @@ ThreadState* state = ThreadStateFor<ThreadingTrait<T>::kAffinity>::GetState(); const char* type_name = WTF_HEAP_PROFILER_TYPE_NAME(HeapVectorBacking<T>); - return reinterpret_cast<T*>(state->Heap().AllocateOnArenaIndex( - state, size, BlinkGC::kInlineVectorArenaIndex, gc_info_index, - type_name)); + return reinterpret_cast<T*>( + MarkAsConstructed(state->Heap().AllocateOnArenaIndex( + state, size, BlinkGC::kInlineVectorArenaIndex, gc_info_index, + type_name))); } static void FreeInlineVectorBacking(void*); static bool ExpandInlineVectorBacking(void*, size_t); @@ -118,8 +119,10 @@ ThreadStateFor<ThreadingTrait<T>::kAffinity>::GetState(); const char* type_name = WTF_HEAP_PROFILER_TYPE_NAME(HeapHashTableBacking<HashTable>); - return reinterpret_cast<T*>(state->Heap().AllocateOnArenaIndex( - state, size, BlinkGC::kHashTableArenaIndex, gc_info_index, type_name)); + return reinterpret_cast<T*>( + MarkAsConstructed(state->Heap().AllocateOnArenaIndex( + state, size, BlinkGC::kHashTableArenaIndex, gc_info_index, + type_name))); } template <typename T, typename HashTable> static T* AllocateZeroedHashTableBacking(size_t size) { @@ -148,8 +151,9 @@ template <typename Return, typename Metadata> static Return Malloc(size_t size, const char* type_name) { - return reinterpret_cast<Return>(ThreadHeap::Allocate<Metadata>( - size, IsEagerlyFinalizedType<Metadata>::value)); + return reinterpret_cast<Return>( + MarkAsConstructed(ThreadHeap::Allocate<Metadata>( + size, IsEagerlyFinalizedType<Metadata>::value))); } // Compilers sometimes eagerly instantiates the unused 'operator delete', so @@ -298,6 +302,12 @@ } private: + static Address MarkAsConstructed(Address address) { + HeapObjectHeader::FromPayload(reinterpret_cast<void*>(address)) + ->MarkFullyConstructed(); + return address; + } + static void BackingFree(void*); static bool BackingExpand(void*, size_t); static bool BackingShrink(void*,
diff --git a/third_party/blink/renderer/platform/heap/heap_page.h b/third_party/blink/renderer/platform/heap/heap_page.h index d0fffbf3..de64181 100644 --- a/third_party/blink/renderer/platform/heap/heap_page.h +++ b/third_party/blink/renderer/platform/heap/heap_page.h
@@ -149,7 +149,7 @@ // // | random magic value (32 bits) | Only present on 64-bit platforms. // | gc_info_index (14 bits) | -// | in construction (1 bit) | +// | in construction (1 bit) | true: bit not set; false bit set // | size (14 bits) | Actually 17 bits because sizes are aligned. // | wrapper mark bit (1 bit) | // | unused (1 bit) | @@ -227,9 +227,8 @@ void Unmark(); bool TryMark(); - void MarkIsInConstruction(); - void UnmarkIsInConstruction(); bool IsInConstruction() const; + void MarkFullyConstructed(); // The payload starts directly after the HeapObjectHeader, and the payload // size does not include the sizeof(HeapObjectHeader). @@ -931,17 +930,12 @@ } NO_SANITIZE_ADDRESS inline bool HeapObjectHeader::IsInConstruction() const { - return encoded_ & kHeaderIsInConstructionMask; + return (encoded_ & kHeaderIsInConstructionMask) == 0; } -NO_SANITIZE_ADDRESS inline void HeapObjectHeader::MarkIsInConstruction() { - DCHECK(!IsInConstruction()); - encoded_ = encoded_ | kHeaderIsInConstructionMask; -} - -NO_SANITIZE_ADDRESS inline void HeapObjectHeader::UnmarkIsInConstruction() { +NO_SANITIZE_ADDRESS inline void HeapObjectHeader::MarkFullyConstructed() { DCHECK(IsInConstruction()); - encoded_ = encoded_ & ~kHeaderIsInConstructionMask; + encoded_ |= kHeaderIsInConstructionMask; } NO_SANITIZE_ADDRESS inline bool HeapObjectHeader::IsValid() const { @@ -1127,9 +1121,9 @@ magic_ = GetMagic(); #endif - DCHECK(gc_info_index < GCInfoTable::kMaxIndex); + DCHECK_LT(gc_info_index, GCInfoTable::kMaxIndex); DCHECK_LT(size, kNonLargeObjectPageSizeMax); - DCHECK(!(size & kAllocationMask)); + DCHECK_EQ(0u, size & kAllocationMask); encoded_ = static_cast<uint32_t>((gc_info_index << kHeaderGCInfoIndexShift) | size); if (header_location == kNormalPage) { @@ -1140,6 +1134,7 @@ } else { DCHECK(PageFromObject(this)->IsLargeObjectPage()); } + DCHECK(IsInConstruction()); } } // namespace blink
diff --git a/third_party/blink/renderer/platform/heap/heap_test.cc b/third_party/blink/renderer/platform/heap/heap_test.cc index 2ade1743..96ba65e 100644 --- a/third_party/blink/renderer/platform/heap/heap_test.cc +++ b/third_party/blink/renderer/platform/heap/heap_test.cc
@@ -501,7 +501,7 @@ .SetThreadNameForTest("blink gc testing thread")); PostCrossThreadTask( *thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(ThreadFunc, CrossThreadUnretained(tester))); + CrossThreadBindOnce(ThreadFunc, CrossThreadUnretained(tester))); } tester->done_.Wait(); delete tester;
diff --git a/third_party/blink/renderer/platform/heap/heap_thread_test.cc b/third_party/blink/renderer/platform/heap/heap_thread_test.cc index 989478ea..e30204d 100644 --- a/third_party/blink/renderer/platform/heap/heap_thread_test.cc +++ b/third_party/blink/renderer/platform/heap/heap_thread_test.cc
@@ -82,8 +82,8 @@ .SetThreadNameForTest("Test Worker Thread")); PostCrossThreadTask( *worker_thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&AlternatingThreadTester::StartWorkerThread, - CrossThreadUnretained(this))); + CrossThreadBindOnce(&AlternatingThreadTester::StartWorkerThread, + CrossThreadUnretained(this))); MainThreadMain(); }
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_response_test.cc b/third_party/blink/renderer/platform/loader/fetch/resource_response_test.cc index 5f6017e..e330709 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_response_test.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_response_test.cc
@@ -80,7 +80,7 @@ ThreadCreationParams(WebThreadType::kTestThread) .SetThreadNameForTest("WorkerThread")); PostCrossThreadTask(*thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&RunInThread)); + CrossThreadBindOnce(&RunInThread)); thread.reset(); }
diff --git a/third_party/blink/renderer/platform/memory_pressure_listener.cc b/third_party/blink/renderer/platform/memory_pressure_listener.cc index 8872352..8020223 100644 --- a/third_party/blink/renderer/platform/memory_pressure_listener.cc +++ b/third_party/blink/renderer/platform/memory_pressure_listener.cc
@@ -114,7 +114,7 @@ PostCrossThreadTask( *thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind( + CrossThreadBindOnce( MemoryPressureListenerRegistry::ClearThreadSpecificMemory)); } }
diff --git a/third_party/blink/renderer/platform/network/network_state_notifier.cc b/third_party/blink/renderer/platform/network/network_state_notifier.cc index 3e09249..b3db869 100644 --- a/third_party/blink/renderer/platform/network/network_state_notifier.cc +++ b/third_party/blink/renderer/platform/network/network_state_notifier.cc
@@ -279,9 +279,10 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner = entry.key; PostCrossThreadTask( *task_runner, FROM_HERE, - CrossThreadBind(&NetworkStateNotifier::NotifyObserversOnTaskRunner, - CrossThreadUnretained(this), - CrossThreadUnretained(&map), type, task_runner, state)); + CrossThreadBindOnce(&NetworkStateNotifier::NotifyObserversOnTaskRunner, + CrossThreadUnretained(this), + CrossThreadUnretained(&map), type, task_runner, + state)); } }
diff --git a/third_party/blink/renderer/platform/scheduler/common/thread.cc b/third_party/blink/renderer/platform/scheduler/common/thread.cc index 24b7d8d..661a3b2 100644 --- a/third_party/blink/renderer/platform/scheduler/common/thread.cc +++ b/third_party/blink/renderer/platform/scheduler/common/thread.cc
@@ -48,8 +48,8 @@ base::WaitableEvent::InitialState::NOT_SIGNALED); PostCrossThreadTask( *thread->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&UpdateThreadTLS, WTF::CrossThreadUnretained(thread), - WTF::CrossThreadUnretained(&event))); + CrossThreadBindOnce(&UpdateThreadTLS, WTF::CrossThreadUnretained(thread), + WTF::CrossThreadUnretained(&event))); event.Wait(); }
diff --git a/third_party/blink/renderer/platform/scheduler/worker/worker_thread_unittest.cc b/third_party/blink/renderer/platform/scheduler/worker/worker_thread_unittest.cc index 2d945152..d39bdf2 100644 --- a/third_party/blink/renderer/platform/scheduler/worker/worker_thread_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/worker/worker_thread_unittest.cc
@@ -115,7 +115,7 @@ PostCrossThreadTask( *thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&MockTask::Run, WTF::CrossThreadUnretained(&task))); + CrossThreadBindOnce(&MockTask::Run, WTF::CrossThreadUnretained(&task))); completion.Wait(); } @@ -127,7 +127,7 @@ base::BindOnce(&AddTaskObserver, thread_.get(), &observer)); PostCrossThreadTask( *thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&RunTestTask, WTF::CrossThreadUnretained(&calls))); + CrossThreadBindOnce(&RunTestTask, WTF::CrossThreadUnretained(&calls))); RunOnWorkerThread( FROM_HERE, base::BindOnce(&RemoveTaskObserver, thread_.get(), &observer)); @@ -150,11 +150,11 @@ base::BindOnce(&ShutdownOnThread, thread_.get())); PostCrossThreadTask( *thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&MockTask::Run, WTF::CrossThreadUnretained(&task))); + CrossThreadBindOnce(&MockTask::Run, WTF::CrossThreadUnretained(&task))); PostDelayedCrossThreadTask( *thread_->GetTaskRunner(), FROM_HERE, - CrossThreadBind(&MockTask::Run, - WTF::CrossThreadUnretained(&delayed_task)), + CrossThreadBindOnce(&MockTask::Run, + WTF::CrossThreadUnretained(&delayed_task)), TimeDelta::FromMilliseconds(50)); thread_.reset(); }
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index fda8200..aee3992 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2718,6 +2718,10 @@ crbug.com/939181 virtual/not-site-per-process/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects.html [ Failure Timeout ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Mac10.13 ] external/wpt/preload/preload-with-type.html [ Failure Timeout ] +crbug.com/626703 [ Retina ] external/wpt/preload/preload-with-type.html [ Timeout ] +crbug.com/626703 [ Mac10.13 ] external/wpt/preload/onload-event.html [ Failure Timeout ] +crbug.com/626703 [ Retina ] external/wpt/preload/onload-event.html [ Timeout ] crbug.com/626703 external/wpt/css/css-flexbox/flexbox_stf-fixpos.html [ Failure ] crbug.com/626703 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/flex-direction-row-vertical.html [ Failure ] crbug.com/626703 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/flexbox_stf-fixpos.html [ Failure ] @@ -5596,3 +5600,5 @@ crbug.com/963734 [ Mac ] mojo/bind-intercepted-interface-in-worker.html [ Failure ] crbug.com/963734 [ Mac ] shapedetection/detection-on-worker.html [ Timeout ] crbug.com/963764 [ Mac ] media/video-aspect-ratio.html [ Pass Failure ] +crbug.com/963141 [ Linux ] media/video-object-fit.html [ Pass Failure ] +crbug.com/963740 [ Win ] compositing/video-frame-size-change.html [ Pass Failure ]
diff --git a/third_party/blink/web_tests/WebDriverExpectations b/third_party/blink/web_tests/WebDriverExpectations index afab1243..e97c3fa 100644 --- a/third_party/blink/web_tests/WebDriverExpectations +++ b/third_party/blink/web_tests/WebDriverExpectations
@@ -165,4 +165,3 @@ crbug.com/626703 [ Linux ] external/wpt/webdriver/tests/new_window/user_prompts.py>>test_dismiss_and_notify[capabilities0-prompt-None] [ Failure ] crbug.com/626703 [ Linux ] external/wpt/webdriver/tests/permissions/set.py>>test_set_to_state[realmSetting2-prompt] [ Failure ] crbug.com/626703 [ Linux ] external/wpt/webdriver/tests/permissions/set.py>>test_set_to_state_cross_realm[realmSetting0-prompt] [ Failure ] -crbug.com/963245 [ Linux ] external/wpt/webdriver/tests/find_element/find.py>>test_no_browsing_context [ Failure ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json index b9bd504..6bac3277 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
@@ -6457,18 +6457,6 @@ {} ] ], - "pointerevents/pointerevent_disabled_form_control-manual.html": [ - [ - "pointerevents/pointerevent_disabled_form_control-manual.html", - {} - ] - ], - "pointerevents/pointerevent_element_haspointercapture-manual.html": [ - [ - "pointerevents/pointerevent_element_haspointercapture-manual.html", - {} - ] - ], "pointerevents/pointerevent_fractional_coordinates-manual.html": [ [ "pointerevents/pointerevent_fractional_coordinates-manual.html", @@ -6481,12 +6469,6 @@ {} ] ], - "pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html": [ - [ - "pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html", - {} - ] - ], "pointerevents/pointerevent_touch-action-button-test_touch-manual.html": [ [ "pointerevents/pointerevent_touch-action-button-test_touch-manual.html", @@ -18151,6 +18133,18 @@ {} ] ], + "css/CSS2/normal-flow/max-height-separates-margin.html": [ + [ + "css/CSS2/normal-flow/max-height-separates-margin.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], "css/CSS2/normal-flow/max-width-001.xht": [ [ "css/CSS2/normal-flow/max-width-001.xht", @@ -20155,6 +20149,18 @@ {} ] ], + "css/CSS2/normal-flow/min-height-separates-margin.html": [ + [ + "css/CSS2/normal-flow/min-height-separates-margin.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], "css/CSS2/normal-flow/min-width-001.xht": [ [ "css/CSS2/normal-flow/min-width-001.xht", @@ -41719,6 +41725,18 @@ {} ] ], + "css/css-flexbox/flex-aspect-ratio-img-column-004.html": [ + [ + "css/css-flexbox/flex-aspect-ratio-img-column-004.html", + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "css/css-flexbox/flex-aspect-ratio-img-row-001.html": [ [ "css/css-flexbox/flex-aspect-ratio-img-row-001.html", @@ -58049,6 +58067,18 @@ {} ] ], + "css/css-position/position-absolute-dynamic-relayout-001.html": [ + [ + "css/css-position/position-absolute-dynamic-relayout-001.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], "css/css-position/position-absolute-dynamic-static-position-floats-001.html": [ [ "css/css-position/position-absolute-dynamic-static-position-floats-001.html", @@ -68613,6 +68643,18 @@ {} ] ], + "css/css-text/white-space/break-spaces-010.html": [ + [ + "css/css-text/white-space/break-spaces-010.html", + [ + [ + "/css/css-text/white-space/reference/white-space-break-spaces-005-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-text/white-space/break-spaces-before-first-char-001.html": [ [ "css/css-text/white-space/break-spaces-before-first-char-001.html", @@ -97487,6 +97529,114 @@ {} ] ], + "css/motion/offset-distance-001.html": [ + [ + "css/motion/offset-distance-001.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-002.html": [ + [ + "css/motion/offset-distance-002.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-003.html": [ + [ + "css/motion/offset-distance-003.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-004.html": [ + [ + "css/motion/offset-distance-004.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-005.html": [ + [ + "css/motion/offset-distance-005.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-006.html": [ + [ + "css/motion/offset-distance-006.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-007.html": [ + [ + "css/motion/offset-distance-007.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-008.html": [ + [ + "css/motion/offset-distance-008.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css/motion/offset-distance-009.html": [ + [ + "css/motion/offset-distance-009.html", + [ + [ + "/css/motion/offset-distance-ref.html", + "==" + ] + ], + {} + ] + ], "css/motion/offset-path-ray.html": [ [ "css/motion/offset-path-ray.html", @@ -133028,6 +133178,11 @@ {} ] ], + "css/css-box/inheritance-expected.txt": [ + [ + {} + ] + ], "css/css-box/parsing/min-height-invalid-expected.txt": [ [ {} @@ -133058,11 +133213,21 @@ {} ] ], + "css/css-break/inheritance-expected.txt": [ + [ + {} + ] + ], "css/css-break/line-after-unbreakable-float-after-padding-ref.html": [ [ {} ] ], + "css/css-break/parsing/box-decoration-break-computed-expected.txt": [ + [ + {} + ] + ], "css/css-break/parsing/box-decoration-break-valid-expected.txt": [ [ {} @@ -145558,6 +145723,11 @@ {} ] ], + "css/css-masking/inheritance.sub-expected.txt": [ + [ + {} + ] + ], "css/css-masking/mask-image/reference/mask-image-ref.html": [ [ {} @@ -146568,6 +146738,11 @@ {} ] ], + "css/css-overflow/inheritance-expected.txt": [ + [ + {} + ] + ], "css/css-overflow/logical-overflow-001-expected.txt": [ [ {} @@ -146858,21 +147033,46 @@ {} ] ], + "css/css-position/inheritance-expected.txt": [ + [ + {} + ] + ], + "css/css-position/parsing/inset-after-computed-expected.txt": [ + [ + {} + ] + ], "css/css-position/parsing/inset-after-valid-expected.txt": [ [ {} ] ], + "css/css-position/parsing/inset-before-computed-expected.txt": [ + [ + {} + ] + ], "css/css-position/parsing/inset-before-valid-expected.txt": [ [ {} ] ], + "css/css-position/parsing/inset-end-computed-expected.txt": [ + [ + {} + ] + ], "css/css-position/parsing/inset-end-valid-expected.txt": [ [ {} ] ], + "css/css-position/parsing/inset-start-computed-expected.txt": [ + [ + {} + ] + ], "css/css-position/parsing/inset-start-valid-expected.txt": [ [ {} @@ -147428,6 +147628,11 @@ {} ] ], + "css/css-scrollbars/inheritance-expected.txt": [ + [ + {} + ] + ], "css/css-scrollbars/scrollbar-width-keywords-expected.txt": [ [ {} @@ -147493,6 +147698,11 @@ {} ] ], + "css/css-shapes/parsing/shape-outside-computed-expected.txt": [ + [ + {} + ] + ], "css/css-shapes/parsing/shape-outside-valid-expected.txt": [ [ {} @@ -148708,6 +148918,11 @@ {} ] ], + "css/css-text-decor/inheritance-expected.txt": [ + [ + {} + ] + ], "css/css-text-decor/parsing/text-decoration-line-valid-expected.txt": [ [ {} @@ -159963,6 +160178,11 @@ {} ] ], + "css/motion/offset-distance-ref.html": [ + [ + {} + ] + ], "css/motion/offset-path-ray-ref.html": [ [ {} @@ -163063,6 +163283,11 @@ {} ] ], + "custom-elements/HTMLElement-attachInternals-expected.txt": [ + [ + {} + ] + ], "custom-elements/HTMLElement-constructor-expected.txt": [ [ {} @@ -167748,26 +167973,6 @@ {} ] ], - "fetch/sec-metadata/redirect/multiple-redirect-cross-site.tentative.https.sub-expected.txt": [ - [ - {} - ] - ], - "fetch/sec-metadata/redirect/multiple-redirect-same-site.tentative.https.sub-expected.txt": [ - [ - {} - ] - ], - "fetch/sec-metadata/redirect/same-origin-redirect.tentative.https.sub-expected.txt": [ - [ - {} - ] - ], - "fetch/sec-metadata/redirect/same-site-redirect.tentative.https.sub-expected.txt": [ - [ - {} - ] - ], "fetch/sec-metadata/report.tentative.https.sub.html.sub.headers": [ [ {} @@ -167788,6 +167993,26 @@ {} ] ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--fallback--frame.html": [ + [ + {} + ] + ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--fallback--sw.js": [ + [ + {} + ] + ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--respondWith--frame.html": [ + [ + {} + ] + ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--respondWith--sw.js": [ + [ + {} + ] + ], "fetch/sec-metadata/resources/helper.js": [ [ {} @@ -177898,6 +178123,11 @@ {} ] ], + "html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt": [ + [ + {} + ] + ], "html/semantics/forms/form-submission-0/getactionurl-expected.txt": [ [ {} @@ -180373,11 +180603,6 @@ {} ] ], - "html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt": [ - [ - {} - ] - ], "html/webappapis/scripting/events/contains.json": [ [ {} @@ -182153,7 +182378,7 @@ {} ] ], - "layout-stability/resources/slow-image.py": [ + "layout-instability/resources/slow-image.py": [ [ {} ] @@ -194433,6 +194658,11 @@ {} ] ], + "svg/text/inheritance-expected.txt": [ + [ + {} + ] + ], "svg/text/parsing/shape-inside-valid-expected.txt": [ [ {} @@ -230960,6 +231190,12 @@ {} ] ], + "css/css-flexbox/parsing/flex-basis-computed.html": [ + [ + "css/css-flexbox/parsing/flex-basis-computed.html", + {} + ] + ], "css/css-flexbox/parsing/flex-basis-invalid.html": [ [ "css/css-flexbox/parsing/flex-basis-invalid.html", @@ -230972,6 +231208,12 @@ {} ] ], + "css/css-flexbox/parsing/flex-direction-computed.html": [ + [ + "css/css-flexbox/parsing/flex-direction-computed.html", + {} + ] + ], "css/css-flexbox/parsing/flex-direction-invalid.html": [ [ "css/css-flexbox/parsing/flex-direction-invalid.html", @@ -230984,6 +231226,12 @@ {} ] ], + "css/css-flexbox/parsing/flex-flow-computed.html": [ + [ + "css/css-flexbox/parsing/flex-flow-computed.html", + {} + ] + ], "css/css-flexbox/parsing/flex-flow-invalid.html": [ [ "css/css-flexbox/parsing/flex-flow-invalid.html", @@ -230996,6 +231244,12 @@ {} ] ], + "css/css-flexbox/parsing/flex-grow-computed.html": [ + [ + "css/css-flexbox/parsing/flex-grow-computed.html", + {} + ] + ], "css/css-flexbox/parsing/flex-grow-invalid.html": [ [ "css/css-flexbox/parsing/flex-grow-invalid.html", @@ -231014,6 +231268,12 @@ {} ] ], + "css/css-flexbox/parsing/flex-shrink-computed.html": [ + [ + "css/css-flexbox/parsing/flex-shrink-computed.html", + {} + ] + ], "css/css-flexbox/parsing/flex-shrink-invalid.html": [ [ "css/css-flexbox/parsing/flex-shrink-invalid.html", @@ -231032,6 +231292,12 @@ {} ] ], + "css/css-flexbox/parsing/flex-wrap-computed.html": [ + [ + "css/css-flexbox/parsing/flex-wrap-computed.html", + {} + ] + ], "css/css-flexbox/parsing/flex-wrap-invalid.html": [ [ "css/css-flexbox/parsing/flex-wrap-invalid.html", @@ -234480,6 +234746,12 @@ {} ] ], + "css/css-properties-values-api/conditional-rules.html": [ + [ + "css/css-properties-values-api/conditional-rules.html", + {} + ] + ], "css/css-properties-values-api/idlharness.html": [ [ "css/css-properties-values-api/idlharness.html", @@ -235890,6 +236162,30 @@ {} ] ], + "css/css-size-adjust/inheritance.html": [ + [ + "css/css-size-adjust/inheritance.html", + {} + ] + ], + "css/css-size-adjust/parsing/text-size-adjust-computed.html": [ + [ + "css/css-size-adjust/parsing/text-size-adjust-computed.html", + {} + ] + ], + "css/css-size-adjust/parsing/text-size-adjust-invalid.html": [ + [ + "css/css-size-adjust/parsing/text-size-adjust-invalid.html", + {} + ] + ], + "css/css-size-adjust/parsing/text-size-adjust-valid.html": [ + [ + "css/css-size-adjust/parsing/text-size-adjust-valid.html", + {} + ] + ], "css/css-sizing/aspect-ratio-affects-container-width-when-height-changes.html": [ [ "css/css-sizing/aspect-ratio-affects-container-width-when-height-changes.html", @@ -261165,6 +261461,18 @@ {} ] ], + "fetch/sec-metadata/fetch-via-serviceworker--fallback.tentative.https.sub.html": [ + [ + "fetch/sec-metadata/fetch-via-serviceworker--fallback.tentative.https.sub.html", + {} + ] + ], + "fetch/sec-metadata/fetch-via-serviceworker--respondWith.tentative.https.sub.html": [ + [ + "fetch/sec-metadata/fetch-via-serviceworker--respondWith.tentative.https.sub.html", + {} + ] + ], "fetch/sec-metadata/fetch.tentative.https.sub.html": [ [ "fetch/sec-metadata/fetch.tentative.https.sub.html", @@ -276399,6 +276707,12 @@ {} ] ], + "intersection-observer/inline-with-block-child-client-rect.html": [ + [ + "intersection-observer/inline-with-block-child-client-rect.html", + {} + ] + ], "intersection-observer/isIntersecting-change-events.html": [ [ "intersection-observer/isIntersecting-change-events.html", @@ -276783,21 +277097,21 @@ {} ] ], - "layout-stability/buffer-layout-jank.html": [ + "layout-instability/buffer-layout-shift.html": [ [ - "layout-stability/buffer-layout-jank.html", + "layout-instability/buffer-layout-shift.html", {} ] ], - "layout-stability/observe-layoutjank.html": [ + "layout-instability/observe-layout-shift.html": [ [ - "layout-stability/observe-layoutjank.html", + "layout-instability/observe-layout-shift.html", {} ] ], - "layout-stability/supported-layout-type.html": [ + "layout-instability/supported-layout-type.html": [ [ - "layout-stability/supported-layout-type.html", + "layout-instability/supported-layout-type.html", {} ] ], @@ -292432,6 +292746,22 @@ {} ] ], + "pointerevents/pointerevent_disabled_form_control.html": [ + [ + "pointerevents/pointerevent_disabled_form_control.html", + { + "testdriver": true + } + ] + ], + "pointerevents/pointerevent_element_haspointercapture.html": [ + [ + "pointerevents/pointerevent_element_haspointercapture.html", + { + "testdriver": true + } + ] + ], "pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html": [ [ "pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html", @@ -292620,6 +292950,14 @@ {} ] ], + "pointerevents/pointerevent_sequence_at_implicit_release_on_click.html": [ + [ + "pointerevents/pointerevent_sequence_at_implicit_release_on_click.html", + { + "testdriver": true + } + ] + ], "pointerevents/pointerevent_sequence_at_implicit_release_on_drag.html": [ [ "pointerevents/pointerevent_sequence_at_implicit_release_on_drag.html", @@ -305814,9 +306152,9 @@ {} ] ], - "service-workers/service-worker/resource-timing.https.html": [ + "service-workers/service-worker/resource-timing.sub.https.html": [ [ - "service-workers/service-worker/resource-timing.https.html", + "service-workers/service-worker/resource-timing.sub.https.html", {} ] ], @@ -313989,6 +314327,12 @@ {} ] ], + "trusted-types/TrustedTypePolicyFactory-constants.tentative.html": [ + [ + "trusted-types/TrustedTypePolicyFactory-constants.tentative.html", + {} + ] + ], "trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html": [ [ "trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html", @@ -314176,9 +314520,17 @@ } ] ], - "uievents/click/click_event_target.html": [ + "uievents/click/click_event_target_child_parent.html": [ [ - "uievents/click/click_event_target.html", + "uievents/click/click_event_target_child_parent.html", + { + "testdriver": true + } + ] + ], + "uievents/click/click_event_target_siblings.html": [ + [ + "uievents/click/click_event_target_siblings.html", { "testdriver": true } @@ -326338,6 +326690,12 @@ {} ] ], + "workers/SharedWorker-detach-frame-in-error-event.html": [ + [ + "workers/SharedWorker-detach-frame-in-error-event.html", + {} + ] + ], "workers/SharedWorker-exception-propagation.html": [ [ "workers/SharedWorker-exception-propagation.html", @@ -360307,6 +360665,10 @@ "b5c87820bd3f896a49044be19b9a24c2ad33f871", "reftest" ], + "css/CSS2/normal-flow/max-height-separates-margin.html": [ + "b14ed54e0638c02f33d4f316ef73bb3876789846", + "reftest" + ], "css/CSS2/normal-flow/max-width-001.xht": [ "1e2d590dfb44bdef37e2bfb4429ec640f188ddd1", "reftest" @@ -361087,6 +361449,10 @@ "e25d3ff0969867eff92f825b6c6e704ad129b4bc", "reftest" ], + "css/CSS2/normal-flow/min-height-separates-margin.html": [ + "1e144921fe34fa2403eac45fced5ea7ffe5561d5", + "reftest" + ], "css/CSS2/normal-flow/min-width-001.xht": [ "1db3741df83fe39b8bc5b180da751120ee1988c9", "reftest" @@ -372591,6 +372957,10 @@ "dde409360faf79a301c3ae3ea34a995d154d7bb4", "support" ], + "css/css-box/inheritance-expected.txt": [ + "4bdf0e5047e3b531b2c091303743bb14876cc987", + "support" + ], "css/css-box/inheritance.html": [ "5047b8b1df07cb1c774b5f579101d69b2482058a", "testharness" @@ -372739,6 +373109,10 @@ "4d0fc7eccc45e44480b4305632ceac2068c59919", "testharness" ], + "css/css-break/inheritance-expected.txt": [ + "b86f43fa28d48e0abd1eddb6e28c23131a4d5db2", + "support" + ], "css/css-break/inheritance.html": [ "e0be119e4002b1d637ebdfc464d87ef88ab83106", "testharness" @@ -372755,6 +373129,10 @@ "7eaa18f5435e87362e85bc0963c512cdf3904c9a", "testharness" ], + "css/css-break/parsing/box-decoration-break-computed-expected.txt": [ + "5f55375986aed8a3c06fd952181423ef596c9f89", + "support" + ], "css/css-break/parsing/box-decoration-break-computed.html": [ "86c7edba88ca35f4de5761d3379ed5bb5eae0a23", "testharness" @@ -375863,6 +376241,10 @@ "a3ee677bd972a530415c8332f4c4f571d18a482a", "reftest" ], + "css/css-flexbox/flex-aspect-ratio-img-column-004.html": [ + "5ae39e11fe0454f3e70302dcb2591d9855adaaf6", + "reftest" + ], "css/css-flexbox/flex-aspect-ratio-img-row-001.html": [ "14fabf760ca4293abf5af9e618b2e2ed627be2b2", "reftest" @@ -378239,6 +378621,10 @@ "ca9af99b939f77835933ccc76de5185b656f5977", "testharness" ], + "css/css-flexbox/parsing/flex-basis-computed.html": [ + "79781dd207e4f486846a2a2f8cf073bcd3dd9038", + "testharness" + ], "css/css-flexbox/parsing/flex-basis-invalid.html": [ "502a21c0160f7b6df688cfe79ed503a23a55bbf8", "testharness" @@ -378247,6 +378633,10 @@ "25c91ad0597ed9e6b6f99efcfdbdd7b30f4f77e6", "testharness" ], + "css/css-flexbox/parsing/flex-direction-computed.html": [ + "13b2f7e674f9a277337035c3c48c9ebfe68055e4", + "testharness" + ], "css/css-flexbox/parsing/flex-direction-invalid.html": [ "81fa8beb7eec51d559a96a2278132c1401fbbc4b", "testharness" @@ -378255,6 +378645,10 @@ "75e108478cb362c035979a239e259b337eb43783", "testharness" ], + "css/css-flexbox/parsing/flex-flow-computed.html": [ + "cb4acbba1ab1d6f8cd91853a0a43c8c978b81db2", + "testharness" + ], "css/css-flexbox/parsing/flex-flow-invalid.html": [ "e82c284632dd5b3babbd3979958874013bf3b9aa", "testharness" @@ -378263,6 +378657,10 @@ "01acd435096db60d214a0b07cb24fccdfded9c93", "testharness" ], + "css/css-flexbox/parsing/flex-grow-computed.html": [ + "fa6744655f96f529cd7d28718c5b3ff9f28a3e27", + "testharness" + ], "css/css-flexbox/parsing/flex-grow-invalid.html": [ "7af51e77a8562d2d1d7aec91c30a7f698c572f67", "testharness" @@ -378275,6 +378673,10 @@ "ae010d7b4b4540f6591c1ad42f1c89753a71afc6", "testharness" ], + "css/css-flexbox/parsing/flex-shrink-computed.html": [ + "299d62285e4389b7e2670e2f345149eabc8d2c28", + "testharness" + ], "css/css-flexbox/parsing/flex-shrink-invalid.html": [ "9fa53de05130e104f76f241733f56ec6e6ffc640", "testharness" @@ -378287,6 +378689,10 @@ "f3eaf118da61d2eb9cd6f30e7f703a0de8053305", "testharness" ], + "css/css-flexbox/parsing/flex-wrap-computed.html": [ + "46df87f38017c23a0bd098fb4af386f10fc69bd2", + "testharness" + ], "css/css-flexbox/parsing/flex-wrap-invalid.html": [ "45b0029402b99438a79b79c2338b0608bcafe819", "testharness" @@ -389704,7 +390110,7 @@ "support" ], "css/css-inline/inheritance-expected.txt": [ - "18b9e4e22acdbbdc5040b1c7f1838f645f9eecfb", + "98b09b58af66f2e00aab35d289d04a2414b4e71d", "support" ], "css/css-inline/inheritance.html": [ @@ -391595,6 +392001,10 @@ "c415eaaa67a2bc9a4b621700049eb0c0b60ec0a3", "testharness" ], + "css/css-masking/inheritance.sub-expected.txt": [ + "f19183255e80971c066ed9d0169fa894ac7c3e1e", + "support" + ], "css/css-masking/inheritance.sub.html": [ "95424204d5094bb1cbcd49e32f5e38c28d86d76f", "testharness" @@ -393499,6 +393909,10 @@ "b9ba7acd150e5022de5c5208cd7f5f7d4dde93c3", "support" ], + "css/css-overflow/inheritance-expected.txt": [ + "1e40d0fd7ffe4ebf9bb2c9beac405658eabe8a8a", + "support" + ], "css/css-overflow/inheritance.html": [ "976406be413b9bdc8cef4acab0a0cd29df2dd43d", "testharness" @@ -393580,7 +393994,7 @@ "testharness" ], "css/css-overflow/parsing/overflow-computed-expected.txt": [ - "983ebcba22c703e8122e62c351ff6105a9849074", + "a42905bdc340af406009bbd1de9f32e16d60a269", "support" ], "css/css-overflow/parsing/overflow-computed.html": [ @@ -394203,6 +394617,10 @@ "9ccb822f107f429651c7949995412c9f2a80feea", "reftest" ], + "css/css-position/inheritance-expected.txt": [ + "db3e75aca4f458a965cf5c99d4c61befc7381204", + "support" + ], "css/css-position/inheritance.html": [ "d75b28c1e0aa2698fe0c73965f4e7d1f06b16547", "testharness" @@ -394219,6 +394637,10 @@ "7a20bd722b1d5b90727975f277995a06c3645a18", "testharness" ], + "css/css-position/parsing/inset-after-computed-expected.txt": [ + "2088ef52da2cb6de4df8fad03584ff4186cddce2", + "support" + ], "css/css-position/parsing/inset-after-computed.html": [ "1a324ed5e088b1877a67e3240aa4b6fd73a7371f", "testharness" @@ -394235,6 +394657,10 @@ "27734a59e69a0a9b0498c9af2932e21b8e18784e", "testharness" ], + "css/css-position/parsing/inset-before-computed-expected.txt": [ + "641c490e2c847b7aaba8c4b470da195194ac22b2", + "support" + ], "css/css-position/parsing/inset-before-computed.html": [ "3df39d4053b7bdc129c3d2cbc0c9e97570d267dc", "testharness" @@ -394251,6 +394677,10 @@ "a802ddb1b48edade7ee1538e6061b488a56b7a54", "testharness" ], + "css/css-position/parsing/inset-end-computed-expected.txt": [ + "085cdb9222072c7a413aacda4f38020fd660d1cb", + "support" + ], "css/css-position/parsing/inset-end-computed.html": [ "5455a2bacc6a480578644890c58e5bdabc02e4a9", "testharness" @@ -394267,6 +394697,10 @@ "2271ae645544f6e7b83615b4c1b62246c5d199c9", "testharness" ], + "css/css-position/parsing/inset-start-computed-expected.txt": [ + "1c2854ad5070d42a339a40b3d5598e7c560fa83b", + "support" + ], "css/css-position/parsing/inset-start-computed.html": [ "0eea5ddb97b75dfe40307c5d656637dfa81d21b4", "testharness" @@ -394399,6 +394833,10 @@ "0c3d36275b2cfc687cd68dd06469799b31fa6f3b", "reftest" ], + "css/css-position/position-absolute-dynamic-relayout-001.html": [ + "1bde15551e7952cce210463d156217a51d3f30f3", + "reftest" + ], "css/css-position/position-absolute-dynamic-static-position-floats-001.html": [ "a63df41089e7e75d33ee1f46d458e97c8ebf0fb0", "reftest" @@ -394911,6 +395349,10 @@ "a8034d56ceccc8d6e964069740474a4492a1dd11", "support" ], + "css/css-properties-values-api/conditional-rules.html": [ + "b4de63045f339d163830921e4e201e698edae47c", + "testharness" + ], "css/css-properties-values-api/idlharness.html": [ "6f053757c3cef099f0cea41716a942dfa7e66100", "testharness" @@ -396063,6 +396505,10 @@ "107938ece14d394e42a5b0d8f3d99d63bf61271e", "testharness" ], + "css/css-scrollbars/inheritance-expected.txt": [ + "74a760738211f1e80f9f7cca1ed87803d2045a04", + "support" + ], "css/css-scrollbars/inheritance.html": [ "1a630786b490e4f872a36bd66f8dfaa763f968f9", "testharness" @@ -396263,6 +396709,10 @@ "e4a3a89108738ed76751ea47dd22b7b8eaf174de", "testharness" ], + "css/css-shapes/parsing/shape-outside-computed-expected.txt": [ + "8e729c6d76de48eaa318de84de72e4fb8ad72940", + "support" + ], "css/css-shapes/parsing/shape-outside-computed.html": [ "4a2f278ea2c6e987e2f6c38be3895e67b5cdb76f", "testharness" @@ -397539,6 +397989,22 @@ "ed3590ceef222740139a4b9d3017478c8728bb30", "support" ], + "css/css-size-adjust/inheritance.html": [ + "730bcfe2b59534534c2ddec225ceb70fbb7700a3", + "testharness" + ], + "css/css-size-adjust/parsing/text-size-adjust-computed.html": [ + "783591a52ea4741d79de77dfbfca7cfeafc42488", + "testharness" + ], + "css/css-size-adjust/parsing/text-size-adjust-invalid.html": [ + "4dfabb5f4e90239971cddeaaf6e1f583a27cae56", + "testharness" + ], + "css/css-size-adjust/parsing/text-size-adjust-valid.html": [ + "bd58ae5f699790fe90cc125fef75cd8fcc52f2bd", + "testharness" + ], "css/css-sizing/META.yml": [ "086e654a8e039f259b5e828d024f808c2e95016b", "support" @@ -398971,6 +399437,10 @@ "801a0f4a54b73d5dbf9db773c6c1281e76c76c77", "support" ], + "css/css-text-decor/inheritance-expected.txt": [ + "4c64efc22ea0fbfa75fa4190ee10b90f7bcd1e57", + "support" + ], "css/css-text-decor/inheritance.html": [ "b106343742e03aa305a3017610272c8692b2a428", "testharness" @@ -401756,7 +402226,7 @@ "testharness" ], "css/css-text/inheritance-expected.txt": [ - "42a075a61ac85fbb1c487b8224a92028593f62e5", + "11cf1e6758cff58f1c555c68ca09da7777e8cce0", "support" ], "css/css-text/inheritance.html": [ @@ -404415,6 +404885,10 @@ "128aeaf5ed151807092b083ed765082f0482c8e0", "reftest" ], + "css/css-text/white-space/break-spaces-010.html": [ + "ec7904f5046376a1a654cc6f76763a49ba10b351", + "reftest" + ], "css/css-text/white-space/break-spaces-before-first-char-001.html": [ "e5221e15501064f216337a358a80058720cd7dad", "reftest" @@ -405348,7 +405822,7 @@ "reftest" ], "css/css-text/word-break/word-break-break-all-017.html": [ - "6cf3be6b90f8a7bf617aa46472d0d291031d9e55", + "88d7c6d0d595baf20d2eded02ba28178320989fc", "reftest" ], "css/css-text/word-break/word-break-break-all-018.html": [ @@ -414172,7 +414646,7 @@ "manual" ], "css/css-ui/inheritance-expected.txt": [ - "8cbc372e3aa61c0552714a7e1c424f98c733ea3b", + "e51e25c5980a83cc1d85b5c504d1772c6422c954", "support" ], "css/css-ui/inheritance.html": [ @@ -426107,6 +426581,46 @@ "563ffdaf1a198a50e6ae82e949a8f12aa9ace8bc", "reftest" ], + "css/motion/offset-distance-001.html": [ + "a24f046bde638f4474b0a0561208b60bc1f0630f", + "reftest" + ], + "css/motion/offset-distance-002.html": [ + "ba253b3befb090ac742d81318bdd70872bab7b25", + "reftest" + ], + "css/motion/offset-distance-003.html": [ + "6f52b955922afde3e844ecd49b0342bf9c119c00", + "reftest" + ], + "css/motion/offset-distance-004.html": [ + "e56384bb7fe306530e4b9c82ccb60da2aef6845b", + "reftest" + ], + "css/motion/offset-distance-005.html": [ + "ff7e8553819dcaa27664ed2bcd1ed93c513ca800", + "reftest" + ], + "css/motion/offset-distance-006.html": [ + "99b1ce076c099b65857f06bd8b412b5a46abe34b", + "reftest" + ], + "css/motion/offset-distance-007.html": [ + "f28a7748ccf37b227d99a0cf7d374edc115357b6", + "reftest" + ], + "css/motion/offset-distance-008.html": [ + "1fcda8c366c6bf7fb72252b824755e8cb47d94f9", + "reftest" + ], + "css/motion/offset-distance-009.html": [ + "ea345483c46592501f32b7c5041d319fd022feb5", + "reftest" + ], + "css/motion/offset-distance-ref.html": [ + "653dd8b10516a08042a40a7dbdb8b31477a42df7", + "support" + ], "css/motion/offset-path-ray-ref.html": [ "fde97bd6b15cca64c06cd305822ad87dc008410f", "support" @@ -428264,7 +428778,7 @@ "support" ], "css/support/computed-testcommon.js": [ - "2cc19c176fa4147f3a30c8fcb251450938a3213b", + "80a0e0c322934fbd2fc3b559626e55fc27809786", "support" ], "css/support/green.ico": [ @@ -428284,7 +428798,7 @@ "support" ], "css/support/inheritance-testcommon.js": [ - "9229f1268ea8e8ec8d83fca77665b17602aebf56", + "dad03461d106a7ea3f26ae1335065c33f3bcd408", "support" ], "css/support/parsing-testcommon.js": [ @@ -433219,8 +433733,12 @@ "32613c47e241078fae04ecdd7ee9e5b0236819fc", "testharness" ], + "custom-elements/HTMLElement-attachInternals-expected.txt": [ + "9594d45ff6b87206cac0a17b003ff1ae46f81aca", + "support" + ], "custom-elements/HTMLElement-attachInternals.html": [ - "e537983059054eb6193434bfbeb700226e3c5fb7", + "22c9545215c8d97f1d8564c99cde806933c7f0f9", "testharness" ], "custom-elements/HTMLElement-constructor-expected.txt": [ @@ -433900,7 +434418,7 @@ "support" ], "dom/events/EventListener-incumbent-global-subsubframe.sub.html": [ - "9ce9f21ca34efcbe1b0b4279287fa1245e879d94", + "dd683f6f65f89f097ca70594e4a02c2027fdb66b", "support" ], "dom/events/EventListener-invoke-legacy.html": [ @@ -441515,6 +442033,14 @@ "c46765b37c6325260882751e9e592c2b55d8b128", "testharness" ], + "fetch/sec-metadata/fetch-via-serviceworker--fallback.tentative.https.sub.html": [ + "e8ec11ec8c1d09b72cf5eee722c1ceab4c3aa6d6", + "testharness" + ], + "fetch/sec-metadata/fetch-via-serviceworker--respondWith.tentative.https.sub.html": [ + "24f3b27cd75861974d566db6354ccbdc4eb7b030", + "testharness" + ], "fetch/sec-metadata/fetch.tentative.https.sub.html": [ "bffb4275df8e99c9d06d4fa4ef518e3b1efba747", "testharness" @@ -441555,34 +442081,18 @@ "06b58744fb5a26f16f5ed8fc923f1c91989e2eb8", "testharness" ], - "fetch/sec-metadata/redirect/multiple-redirect-cross-site.tentative.https.sub-expected.txt": [ - "769c0788981424ebbc2b8a945856329cddd8657b", - "support" - ], "fetch/sec-metadata/redirect/multiple-redirect-cross-site.tentative.https.sub.html": [ "e173bb053fedd46f346a0e89990f44cf5cbc1856", "testharness" ], - "fetch/sec-metadata/redirect/multiple-redirect-same-site.tentative.https.sub-expected.txt": [ - "8455937021e712eee0f353eee641919ca37767df", - "support" - ], "fetch/sec-metadata/redirect/multiple-redirect-same-site.tentative.https.sub.html": [ "d19a1896ad77e69923e219292d9ae4c1ef35e70e", "testharness" ], - "fetch/sec-metadata/redirect/same-origin-redirect.tentative.https.sub-expected.txt": [ - "4723bebe82792d206a25d22c1dd1282db50ec9b2", - "support" - ], "fetch/sec-metadata/redirect/same-origin-redirect.tentative.https.sub.html": [ "0b4fdfeec58b6f353000cf290f345b63c4c9cba9", "testharness" ], - "fetch/sec-metadata/redirect/same-site-redirect.tentative.https.sub-expected.txt": [ - "638af52267705c3488cc76ffb0665b93e125b735", - "support" - ], "fetch/sec-metadata/redirect/same-site-redirect.tentative.https.sub.html": [ "70c0afef22883469a54a874a955a91c89c4336d7", "testharness" @@ -441607,6 +442117,22 @@ "7884b096d994b41a365cdbc19979633e9cf65419", "support" ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--fallback--frame.html": [ + "98798025005497f48537aa8a8a5e1061fc88abe4", + "support" + ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--fallback--sw.js": [ + "09858b2663f084660c8964d7fd1097fbd74364d7", + "support" + ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--respondWith--frame.html": [ + "98798025005497f48537aa8a8a5e1061fc88abe4", + "support" + ], + "fetch/sec-metadata/resources/fetch-via-serviceworker--respondWith--sw.js": [ + "8bf8d8f22175f9eef225d954b05dac104505c4a2", + "support" + ], "fetch/sec-metadata/resources/helper.js": [ "1968cfc0dd8ed94047a9c436458ea1c568c15bf1", "support" @@ -441636,7 +442162,7 @@ "testharness" ], "fetch/sec-metadata/serviceworker.tentative.https.sub.html": [ - "ee436d9265ff85c3e307c7c6f565e55d7cc84961", + "c86198df6a2e31dc3c665fe5fe3f452bb47eeb26", "testharness" ], "fetch/sec-metadata/sharedworker.tentative.https.sub.html": [ @@ -456291,8 +456817,12 @@ "a7f0dc87efd2d3bf8798919649873cb81fc25ade", "support" ], + "html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt": [ + "dd7c7a3bdcf4a36967ece772c3204916edb2a258", + "support" + ], "html/semantics/forms/form-submission-0/form-submission-algorithm.html": [ - "bf9f9ce330a3a8ffbeb3b67b81e451dbcf064bdf", + "8f61cbc18c95133561e4dd8cbffd3cdb682420e4", "testharness" ], "html/semantics/forms/form-submission-0/getactionurl-expected.txt": [ @@ -462035,10 +462565,6 @@ "ed6c006651162aeaac41a4ad7a8e81ad0bbd457e", "testharness" ], - "html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt": [ - "27f6821050a1dd0d2429946fbb8b3412d1870e01", - "support" - ], "html/webappapis/scripting/events/compile-event-handler-settings-objects.html": [ "29ac9b8ced469025278b5d5215b651b58a6f5a4d", "testharness" @@ -463660,7 +464186,7 @@ "support" ], "interfaces/SVG.idl": [ - "78b9d64743e6ae3540e10f39bd1cbf97c2ae8a9d", + "8894f7b33363509d015a0d04e71f623805a19082", "support" ], "interfaces/WebCryptoAPI.idl": [ @@ -463684,7 +464210,7 @@ "support" ], "interfaces/appmanifest.idl": [ - "a55db2795927e3e3b1b45c589a24b4cd424c6de2", + "fd26c9ba71e93c7e0350115de745b8e45fc56a30", "support" ], "interfaces/audio-output.idl": [ @@ -463796,7 +464322,7 @@ "support" ], "interfaces/cssom.idl": [ - "a914ac0d78c627722262587a84e5a30ef367a6f0", + "798adc19f2a974beef4dd4ab8822524f807496b7", "support" ], "interfaces/dedicated-workers.idl": [ @@ -463876,7 +464402,7 @@ "support" ], "interfaces/html.idl": [ - "18b97df64e73fdc6641ee4a4a1e8ad31910e69fd", + "f44f5da96ff6e400cd51a404e3f06ae558d4cff4", "support" ], "interfaces/image-capture.idl": [ @@ -464108,7 +464634,7 @@ "support" ], "interfaces/wake-lock.idl": [ - "5081891361a7b2088b914bf3a402898ac0ab20f7", + "863cef13f3c39e852920fdf3763848562fe7360c", "support" ], "interfaces/wasm-js-api.idl": [ @@ -464140,7 +464666,7 @@ "support" ], "interfaces/webauthn.idl": [ - "be8d0c10c47e979ed6c7c8caa10f46d6578b972b", + "bf57b8bccf4ebf1e93927fcbe047b8037ad047aa", "support" ], "interfaces/webdriver.idl": [ @@ -464168,7 +464694,7 @@ "support" ], "interfaces/webrtc.idl": [ - "c40266388cba1558348b1d556efa53243dac7d47", + "6ae34167ded31a5927791915eb56bc55f09c59dd", "support" ], "interfaces/webusb.idl": [ @@ -464180,7 +464706,7 @@ "support" ], "interfaces/webxr.idl": [ - "29e38f98fe6b49b94938c9b0787e5a0964077c6a", + "c1e6d8ca2c595b18873630772edaede7ea25b40e", "support" ], "interfaces/worklets.idl": [ @@ -464251,6 +464777,10 @@ "0bdfc8de24458e0fb490de4f00537197c0662e53", "testharness" ], + "intersection-observer/inline-with-block-child-client-rect.html": [ + "81a8fd125691bbfca73ff73e861e80ecf69818f8", + "testharness" + ], "intersection-observer/isIntersecting-change-events.html": [ "f9362c3024c2003ac03c1e789c54486830710c92", "testharness" @@ -464567,20 +465097,20 @@ "64756bf195fc3319d9dd21abad4c5d86fa266cfe", "testharness" ], - "layout-stability/buffer-layout-jank.html": [ - "57009590e221b398573ca9e68d261596a58dd091", + "layout-instability/buffer-layout-shift.html": [ + "c1d0dc6d6eb971f39c913a78423aad046dd18a04", "testharness" ], - "layout-stability/observe-layoutjank.html": [ - "9d0f71ced46d111aa88a10b6a2866b10a91c8c3e", + "layout-instability/observe-layout-shift.html": [ + "db8d3ae406d42b16be4308e329c53b6f0d7f944c", "testharness" ], - "layout-stability/resources/slow-image.py": [ + "layout-instability/resources/slow-image.py": [ "ee7988c551f6429eea2b929af083ad30cbd5c73d", "support" ], - "layout-stability/supported-layout-type.html": [ - "e3204b52f788729e6a9b1ee845ea36ff79a8b8cf", + "layout-instability/supported-layout-type.html": [ + "af0ff3aa138c41bc8ce2ec1447381bf036a167e2", "testharness" ], "lifecycle/META.yml": [ @@ -477515,13 +478045,13 @@ "b8a97d1a6bb7f7b895d16282a1231c335e35f650", "testharness" ], - "pointerevents/pointerevent_disabled_form_control-manual.html": [ - "20e07a980b2b3dac7a1bec457e5ed6bb36b76ef7", - "manual" + "pointerevents/pointerevent_disabled_form_control.html": [ + "cf44677c759e6e2d3278ddefdc8deac7e11ff69b", + "testharness" ], - "pointerevents/pointerevent_element_haspointercapture-manual.html": [ - "1b479a64fa58a7403c5fbbd94e541dbbb37a6910", - "manual" + "pointerevents/pointerevent_element_haspointercapture.html": [ + "c9690a688c5cbf5c5333d63c1aae2f856aaa1af0", + "testharness" ], "pointerevents/pointerevent_fractional_coordinates-manual.html": [ "e0e2fdcd62175c325e43744e43addc5f45486159", @@ -477627,9 +478157,9 @@ "b09dfafe69d78985545453b4207d41353362defd", "testharness" ], - "pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html": [ - "0b93c847ed216653891d00cf55b5b00e41424b50", - "manual" + "pointerevents/pointerevent_sequence_at_implicit_release_on_click.html": [ + "0c6e2c532f9cc5ae410f6bd399340c55e937859d", + "testharness" ], "pointerevents/pointerevent_sequence_at_implicit_release_on_drag.html": [ "9b1de2270e4eb7e35d1ff1054a0a5dddf677da5b", @@ -478132,7 +478662,7 @@ "support" ], "preload/link-header-preload-imagesrcset.html": [ - "54f6252506b27d1c4314dcd58eddbb0504bf8035", + "b41cbee431f6aece23003276764212e737897082", "testharness" ], "preload/link-header-preload-imagesrcset.html.headers": [ @@ -478140,7 +478670,7 @@ "support" ], "preload/link-header-preload-nonce.html": [ - "dc1ec100776916319a637daa0397589a05a23804", + "bfac5639cdcfe68716af765eb763bdbe4e94cae5", "testharness" ], "preload/link-header-preload-nonce.html.headers": [ @@ -478148,7 +478678,7 @@ "support" ], "preload/link-header-preload.html": [ - "0ca364bdef71ad98fcf12db36e8e71c414745b57", + "4dfdfc8873947a95a42d97065a3229e5d20d04e5", "testharness" ], "preload/link-header-preload.html.headers": [ @@ -478168,19 +478698,19 @@ "testharness" ], "preload/onload-event-expected.txt": [ - "d14478b9833ead86643e65b07eb757ad78104d7b", + "6ff3147e4c80f250e5ece7bd58b6f1aa170ca5c8", "support" ], "preload/onload-event.html": [ - "f9348b8ceb392117a2da6560e64118df2482dfdf", + "9111cd8fc8271c97b6165e684a02fe44a5b47eb8", "testharness" ], "preload/preload-csp.sub.html": [ - "7fe06eb079133a245472c085068bb311dabebc68", + "65e9b3a2a6d350598e88cd2c8a7e4fa8d10d7533", "testharness" ], "preload/preload-default-csp.sub.html": [ - "7813e36d4d8ada4bd4e5f79a583f2ff89519c5eb", + "923431456cf7e01d66556fda7241be0e660dacc0", "testharness" ], "preload/preload-strict-dynamic.html": [ @@ -478188,11 +478718,11 @@ "testharness" ], "preload/preload-with-type-expected.txt": [ - "f6065260355808bddc6f5ff8cb8b343d5ca30583", + "8041c99fc6c811cfab5e01f5cfe5000cec552f79", "support" ], "preload/preload-with-type.html": [ - "83eafc5848b9c514e9136cbedfc64df6665d5aa9", + "980592274bf3579bebe14804b81f945d7fcee70c", "testharness" ], "preload/preload-xhr.html": [ @@ -478276,7 +478806,7 @@ "support" ], "preload/resources/preload_helper.js": [ - "f464908fa513353917901d49af150d53cfd99945", + "1c7c1a2750e7bc8dbd24ec16f4037183a4a9e91d", "support" ], "preload/resources/sound_5.oga": [ @@ -490548,7 +491078,7 @@ "testharness" ], "service-workers/service-worker/fetch-request-xhr.https-expected.txt": [ - "76e08357b6e2b1edce325a9ebefde287c962681b", + "44c6a053034ccd646803c60363b9890c4813175f", "support" ], "service-workers/service-worker/fetch-request-xhr.https.html": [ @@ -490963,8 +491493,8 @@ "827688df011ea9be216a7414b161dbb730f1b975", "testharness" ], - "service-workers/service-worker/resource-timing.https.html": [ - "7fc3fcd9e48b445aad5f34d658171d18c3caa42f", + "service-workers/service-worker/resource-timing.sub.https.html": [ + "f0502cac727896ce674f3b93a9dd4cfcbf54b41b", "testharness" ], "service-workers/service-worker/resources/404.py": [ @@ -491904,7 +492434,7 @@ "support" ], "service-workers/service-worker/resources/resource-timing-iframe.sub.html": [ - "4b626576ab456eae02aa922884b0d4917caeca14", + "41bc2e77c1b4acb3a57a83f9c9889f4e9c538103", "support" ], "service-workers/service-worker/resources/resource-timing-worker.js": [ @@ -494848,7 +495378,7 @@ "testharness" ], "svg/idlharness.window-expected.txt": [ - "921d3f2520ff495700101f86b152792cd05c5800", + "c08f4384ea1d574849841bd8f669d04db0d5d108", "support" ], "svg/idlharness.window.js": [ @@ -495955,6 +496485,10 @@ "51303171f09d28e3958ab74ecdce7f9cf120bd12", "testharness" ], + "svg/text/inheritance-expected.txt": [ + "33b1bce119ad68b8f0e10892d09481210424ac21", + "support" + ], "svg/text/inheritance.svg": [ "1f4609d7ac6c5384f68d109733be01c7ea915df4", "testharness" @@ -501048,7 +501582,7 @@ "support" ], "tools/wptrunner/wptrunner/browsers/servodriver.py": [ - "0a63a32c96699a441ce696bae6b8d32f4d69bc3d", + "e5e08e2579a09a0cbbb9eb341458795d5e0ba55c", "support" ], "tools/wptrunner/wptrunner/browsers/webkit.py": [ @@ -501563,6 +502097,10 @@ "c121fe4cab50ab52a7159184bfa012e85d555768", "testharness" ], + "trusted-types/TrustedTypePolicyFactory-constants.tentative.html": [ + "f164e792345463ac658e925a0187fe9b3f21a127", + "testharness" + ], "trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html": [ "37e245ee27aa5828bd97568d9390d9cbfbb6f968", "testharness" @@ -501727,8 +502265,12 @@ "9f4ffed96e6cb186f8441e9681c281d087ff8faf", "testharness" ], - "uievents/click/click_event_target.html": [ - "ffe5dbaf3988a4908cda76bf3f4edf901b24833b", + "uievents/click/click_event_target_child_parent.html": [ + "1e07e4340392ef0830869876c06e5ee0c1238c91", + "testharness" + ], + "uievents/click/click_event_target_siblings.html": [ + "0306b6f05f0d4c3c6ef58ab638c186184bb6bf5a", "testharness" ], "uievents/click/mouse-dblclick-event.html": [ @@ -502820,7 +503362,7 @@ "support" ], "wake-lock/idlharness.https.any-expected.txt": [ - "ca88133a56777e7b0c5b4b65741aae208cf0d904", + "f6eb85a71334369718609b6fb1eeda08e04515a8", "support" ], "wake-lock/idlharness.https.any.js": [ @@ -512108,7 +512650,7 @@ "support" ], "webxr/idlharness.https.window-expected.txt": [ - "453310130b5286c28c14b161ebebc33cd25fd4e4", + "f7aeb02f1f07f9e38794f02407e9e68b0401d72f", "support" ], "webxr/idlharness.https.window.js": [ @@ -512192,7 +512734,7 @@ "testharness" ], "webxr/xrFrame_getPose.https.html": [ - "a8015e3276acc3f97cced60c964d92c752a25d24", + "e3dd77be72a2a391c93813199c427eed30e48fb3", "testharness" ], "webxr/xrFrame_lifetime.https.html": [ @@ -512279,6 +512821,10 @@ "2bfe7d9b87adfe927517a0a3af6d614d8837964d", "testharness" ], + "workers/SharedWorker-detach-frame-in-error-event.html": [ + "7363265fbc3c42f498c78afda01a1cd51cb0aeac", + "testharness" + ], "workers/SharedWorker-exception-propagation.html": [ "5823a19a4bfabb89243d51797288ee3a13b4cd1f", "testharness"
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-indent/text-indent-long-line-crash.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-indent/text-indent-long-line-crash.html new file mode 100644 index 0000000..9b5e0798 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-indent/text-indent-long-line-crash.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>Very long line with `text-indent` should not crash</title> +<link rel="help" href="https://crbug.com/963794"> +<link rel="author" title="Koji Ishii" href="kojii@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> +body { + width: 2147483648px; +} +div { + text-indent: 2147483648px; + width: 200%; /* Double the width in case CSS parser clamps the body width */ +} +</style> +<body> + <div>XXX</div> +<script>test(() => { document.body.offsetTop; });</script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-001.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-001.html new file mode 100644 index 0000000..a24f046 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-001.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when offset-path is a closed loop."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 0 0 h 200 v 150 z'); + offset-distance: 20%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-002.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-002.html new file mode 100644 index 0000000..ba253b3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-002.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when offset-path is a closed loop."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 0 0 h 200 v 150 z'); + offset-distance: 120%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-003.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-003.html new file mode 100644 index 0000000..6f52b95 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-003.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when offset-path is a closed loop."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 0 0 h 200 v 150 z'); + offset-distance: -280%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-004.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-004.html new file mode 100644 index 0000000..e56384bb --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-004.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when total length of the path is 0."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 120 0 h 0 v 0 z'); + offset-distance: 20%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-005.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-005.html new file mode 100644 index 0000000..ff7e8553 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-005.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when total length of the path is 0."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 120 0 h 0 v 0 z'); + offset-distance: 120%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-006.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-006.html new file mode 100644 index 0000000..99b1ce0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-006.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when total length of the path is 0."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 120 0 h 0 v 0 z'); + offset-distance: -280%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-007.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-007.html new file mode 100644 index 0000000..f28a774 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-007.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when offset-path is an unclosed interval."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m -80 0 h 1000'); + offset-distance: 20%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-008.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-008.html new file mode 100644 index 0000000..1fcda8c3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-008.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when offset-path is an unclosed interval."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m -80 0 h 200'); + offset-distance: 120%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-009.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-009.html new file mode 100644 index 0000000..ea34548 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-009.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <link rel="help" href="https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path"> + <link rel="match" href="offset-distance-ref.html"> + <meta name="assert" content="This tests used offset-distance when offset-path is an unclosed interval."> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + offset-path: path('m 120 0 h 200 v 150'); + offset-distance: -280%; + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-ref.html b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-ref.html new file mode 100644 index 0000000..653dd8b1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/motion/offset-distance-ref.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Motion Path: offset-distance</title> + <style> + #target { + position: absolute; + width: 100px; + height: 40px; + background-color: lime; + transform-origin: 0% 0%; + transform: translateX(120px); + } + </style> + </head> + <body> + <div id="target"></div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals-expected.txt b/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals-expected.txt new file mode 100644 index 0000000..9594d45f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL Successful attachInternals() and the second call. assert_throws: New - 2nd call function "() => { element.attachInternals(); }" threw object "InvalidStateError: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached." that is not a DOMException NotSupportedError: property "code" is equal to 11, expected 9 +PASS attachInternals() throws a NotSupportedError if it is called for a customized built-in element +FAIL If a custom element definition for the local name of the element doesn't exist, throw an NotSupportedError assert_throws: function "() => { builtin.attachInternals() }" threw object "InvalidStateError: Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements." that is not a DOMException NotSupportedError: property "code" is equal to 11, expected 9 +PASS If a custom element definition for the local name of the element has disable internals flag, throw a NotSupportedError +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals.html b/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals.html index e5379830..22c9545 100644 --- a/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals.html +++ b/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-attachInternals.html
@@ -14,19 +14,19 @@ let element = new MyElement1(); assert_true(element.attachInternals() instanceof ElementInternals, 'New - 1st call'); - assert_throws('InvalidStateError', () => { element.attachInternals(); }, + assert_throws('NotSupportedError', () => { element.attachInternals(); }, 'New - 2nd call'); element = document.createElement('my-element1'); assert_true(element.attachInternals() instanceof ElementInternals, 'createElement - 1st call'); - assert_throws('InvalidStateError', () => { element.attachInternals(); }, + assert_throws('NotSupportedError', () => { element.attachInternals(); }, 'createElement - 2nd call'); container.innerHTML = '<my-element1></my-element1>'; assert_true(container.firstChild.attachInternals() instanceof ElementInternals, 'Parser - 1st call'); - assert_throws('InvalidStateError', () => { + assert_throws('NotSupportedError', () => { container.firstChild.attachInternals(); }, 'Parser - 2nd call'); }, 'Successful attachInternals() and the second call.'); @@ -41,17 +41,17 @@ test(() => { const builtin = document.createElement('div'); - assert_throws('InvalidStateError', () => { builtin.attachInternals() }); + assert_throws('NotSupportedError', () => { builtin.attachInternals() }); const doc = document.implementation.createDocument('foo', null); const span = doc.appendChild(doc.createElementNS('http://www.w3.org/1999/xhtml', 'html:span')); assert_true(span instanceof HTMLElement); - assert_throws('InvalidStateError', () => { span.attachInternals(); }); + assert_throws('NotSupportedError', () => { span.attachInternals(); }); const undefinedCustom = document.createElement('undefined-element'); - assert_throws('InvalidStateError', () => { undefinedCustom.attachInternals() }); + assert_throws('NotSupportedError', () => { undefinedCustom.attachInternals() }); }, 'If a custom element definition for the local name of the element doesn\'t' + - ' exist, throw an InvalidStateError'); + ' exist, throw an NotSupportedError'); test(() => { class MyElement2 extends HTMLElement {
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt new file mode 100644 index 0000000..dd7c7a3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS If constructing entry list flag of form is true, then return +FAIL If form's firing submission events is true, then return; 'invalid' event assert_equals: expected 1 but got 2 +PASS If form's firing submission events is true, then return; 'submit' event +PASS Cannot navigate (after constructing the entry list) +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm.html b/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm.html index bf9f9ce..8f61cbc 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/form-submission-algorithm.html
@@ -18,8 +18,39 @@ assert_equals(counter, 2); }, 'If constructing entry list flag of form is true, then return'); -let test10 = async_test('Cannot navigate (after constructing the entry list)'); -test10.step(() => { + +test(() => { + let form = populateForm('<input required><input type=submit><button type=submit></button>'); + let submitter1 = form.querySelector('input[type=submit]'); + let submitter2 = form.querySelector('button[type=submit]'); + let invalid = form.querySelector('[required]'); + let counter = 0; + invalid.oninvalid = () => { + ++counter; + // Needs to click different one because click() has reentrancy protection. + submitter2.click(); + }; + submitter1.click(); + assert_equals(counter, 1); +}, "If form's firing submission events is true, then return; 'invalid' event"); + +async_test(t => { + let form = populateForm('<input type=submit name=n value=i><button type=submit name=n value=b>'); + let submitter1 = form.querySelector('input[type=submit]'); + let submitter2 = form.querySelector('button[type=submit]'); + let iframe = form.previousSibling; + form.onsubmit = () => { + // Needs to click different one because click() has reentrancy protection. + submitter2.click(); + }; + submitter1.click(); + // We actually submit the form in order to check which 'click()' submits it. + iframe.onload = t.step_func_done(() => { + assert_not_equals(iframe.contentWindow.location.search.indexOf('n=i'), -1); + }); +}, "If form's firing submission events is true, then return; 'submit' event"); + +async_test(t => { let form = populateForm('<input name=n1 value=v1>'); form.onformdata = (e) => { e.target.remove(); }; let wasLoaded = false; @@ -27,13 +58,13 @@ // Request to load '/common/dummy.xhtml', and immediately submit the form to // the same frame. If the form submission is aborted, the first request // will be completed. - iframe.onload = test10.step_func_done(() => { + iframe.onload = t.step_func_done(() => { wasLoaded = true; assert_true(iframe.contentWindow.location.search.indexOf('n1=v1') == -1); }); iframe.src = '/common/dummy.xhtml'; assert_false(wasLoaded, 'Make sure the first loading is ongoing.'); form.submit(); -}); +}, 'Cannot navigate (after constructing the entry list)'); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/SVG.idl b/third_party/blink/web_tests/external/wpt/interfaces/SVG.idl index 78b9d647..8894f7b33 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/SVG.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/SVG.idl
@@ -283,10 +283,6 @@ }; [Exposed=Window] -interface SVGUnknownElement : SVGGraphicsElement { -}; - -[Exposed=Window] interface SVGDefsElement : SVGGraphicsElement { };
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/appmanifest.idl b/third_party/blink/web_tests/external/wpt/interfaces/appmanifest.idl index a55db279..fd26c9b 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/appmanifest.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/appmanifest.idl
@@ -3,20 +3,21 @@ // (https://github.com/tidoust/reffy-reports) // Source: Web App Manifest (https://w3c.github.io/manifest/) -enum AppBannerPromptOutcome { - "accepted", - "dismissed" -}; - [Constructor(DOMString type, optional EventInit eventInitDict), Exposed=Window] interface BeforeInstallPromptEvent : Event { Promise<PromptResponseObject> prompt(); }; + dictionary PromptResponseObject { AppBannerPromptOutcome userChoice; }; +enum AppBannerPromptOutcome { + "accepted", + "dismissed" +}; + partial interface Window { attribute EventHandler onappinstalled; attribute EventHandler onbeforeinstallprompt;
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/cssom.idl b/third_party/blink/web_tests/external/wpt/interfaces/cssom.idl index a914ac0d7..798adc1 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/cssom.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/cssom.idl
@@ -40,6 +40,12 @@ void deleteRule(unsigned long index); }; +partial interface CSSStyleSheet { + [SameObject] readonly attribute CSSRuleList rules; + long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index); + void removeRule(optional unsigned long index = 0); +}; + [Exposed=Window] interface StyleSheetList { getter CSSStyleSheet? item(unsigned long index); @@ -122,7 +128,7 @@ getter CSSOMString item(unsigned long index); CSSOMString getPropertyValue(CSSOMString property); CSSOMString getPropertyPriority(CSSOMString property); - [CEReactions] void setProperty(CSSOMString property, [TreatNullAs=EmptyString] CSSOMString value, [TreatNullAs=EmptyString] optional CSSOMString priority = ""); + [CEReactions] void setProperty(CSSOMString property, [TreatNullAs=EmptyString] CSSOMString value, optional [TreatNullAs=EmptyString] CSSOMString priority = ""); [CEReactions] CSSOMString removeProperty(CSSOMString property); readonly attribute CSSRule? parentRule; [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString cssFloat;
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/html.idl b/third_party/blink/web_tests/external/wpt/interfaces/html.idl index 18b97df..f44f5da 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/html.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/html.idl
@@ -91,6 +91,8 @@ // special event handler IDL attributes that only apply to Document objects [LenientThis] attribute EventHandler onreadystatechange; + + // also has obsolete members }; Document includes GlobalEventHandlers; Document includes DocumentAndElementEventHandlers; @@ -144,7 +146,9 @@ [Exposed=Window, HTMLConstructor] -interface HTMLHtmlElement : HTMLElement {}; +interface HTMLHtmlElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] @@ -179,6 +183,8 @@ [CEReactions] attribute USVString imageSrcset; [CEReactions] attribute DOMString imageSizes; [CEReactions] attribute DOMString referrerPolicy; + + // also has obsolete members }; HTMLLinkElement includes LinkStyle; @@ -188,36 +194,50 @@ [CEReactions] attribute DOMString name; [CEReactions] attribute DOMString httpEquiv; [CEReactions] attribute DOMString content; + + // also has obsolete members }; [Exposed=Window, HTMLConstructor] interface HTMLStyleElement : HTMLElement { [CEReactions] attribute DOMString media; + + // also has obsolete members }; HTMLStyleElement includes LinkStyle; [Exposed=Window, HTMLConstructor] -interface HTMLBodyElement : HTMLElement {}; +interface HTMLBodyElement : HTMLElement { + // also has obsolete members +}; HTMLBodyElement includes WindowEventHandlers; [Exposed=Window, HTMLConstructor] -interface HTMLHeadingElement : HTMLElement {}; +interface HTMLHeadingElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] -interface HTMLParagraphElement : HTMLElement {}; +interface HTMLParagraphElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] -interface HTMLHRElement : HTMLElement {}; +interface HTMLHRElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] -interface HTMLPreElement : HTMLElement {}; +interface HTMLPreElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] @@ -231,30 +251,42 @@ [CEReactions] attribute boolean reversed; [CEReactions] attribute long start; [CEReactions] attribute DOMString type; + + // also has obsolete members }; [Exposed=Window, HTMLConstructor] -interface HTMLUListElement : HTMLElement {}; +interface HTMLUListElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] interface HTMLMenuElement : HTMLElement { + + // also has obsolete members }; [Exposed=Window, HTMLConstructor] interface HTMLLIElement : HTMLElement { [CEReactions] attribute long value; + + // also has obsolete members }; [Exposed=Window, HTMLConstructor] -interface HTMLDListElement : HTMLElement {}; +interface HTMLDListElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] -interface HTMLDivElement : HTMLElement {}; +interface HTMLDivElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] @@ -270,6 +302,8 @@ [CEReactions] attribute DOMString text; [CEReactions] attribute DOMString referrerPolicy; + + // also has obsolete members }; HTMLAnchorElement includes HTMLHyperlinkElementUtils; @@ -291,7 +325,9 @@ [Exposed=Window, HTMLConstructor] -interface HTMLBRElement : HTMLElement {}; +interface HTMLBRElement : HTMLElement { + // also has obsolete members +}; interface mixin HTMLHyperlinkElementUtils { [CEReactions] stringifier attribute USVString href; @@ -349,6 +385,8 @@ [CEReactions] attribute DOMString decoding; Promise<void> decode(); + + // also has obsolete members }; [Exposed=Window, @@ -367,6 +405,8 @@ readonly attribute Document? contentDocument; readonly attribute WindowProxy? contentWindow; Document? getSVGDocument(); + + // also has obsolete members }; [Exposed=Window, @@ -377,6 +417,8 @@ [CEReactions] attribute DOMString width; [CEReactions] attribute DOMString height; Document? getSVGDocument(); + + // also has obsolete members }; [Exposed=Window, @@ -399,6 +441,8 @@ boolean checkValidity(); boolean reportValidity(); void setCustomValidity(DOMString error); + + // also has obsolete members }; [Exposed=Window, @@ -406,6 +450,8 @@ interface HTMLParamElement : HTMLElement { [CEReactions] attribute DOMString name; [CEReactions] attribute DOMString value; + + // also has obsolete members }; [Exposed=Window, @@ -646,6 +692,8 @@ [CEReactions] attribute DOMString rel; [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; [CEReactions] attribute DOMString referrerPolicy; + + // also has obsolete members }; HTMLAreaElement includes HTMLHyperlinkElementUtils; @@ -670,16 +718,22 @@ [SameObject] readonly attribute HTMLCollection rows; HTMLTableRowElement insertRow(optional long index = -1); [CEReactions] void deleteRow(long index); + + // also has obsolete members }; [Exposed=Window, HTMLConstructor] -interface HTMLTableCaptionElement : HTMLElement {}; +interface HTMLTableCaptionElement : HTMLElement { + // also has obsolete members +}; [Exposed=Window, HTMLConstructor] interface HTMLTableColElement : HTMLElement { [CEReactions] attribute unsigned long span; + + // also has obsolete members }; [Exposed=Window, @@ -688,6 +742,8 @@ [SameObject] readonly attribute HTMLCollection rows; HTMLTableRowElement insertRow(optional long index = -1); [CEReactions] void deleteRow(long index); + + // also has obsolete members }; [Exposed=Window, @@ -698,6 +754,8 @@ [SameObject] readonly attribute HTMLCollection cells; HTMLTableCellElement insertCell(optional long index = -1); [CEReactions] void deleteCell(long index); + + // also has obsolete members }; [Exposed=Window, @@ -710,6 +768,8 @@ [CEReactions] attribute DOMString scope; // only conforming for th elements [CEReactions] attribute DOMString abbr; // only conforming for th elements + + // also has obsolete members }; [Exposed=Window, @@ -808,6 +868,8 @@ void setRangeText(DOMString replacement); void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve"); void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); + + // also has obsolete members }; [Exposed=Window, @@ -1006,6 +1068,8 @@ HTMLConstructor] interface HTMLLegendElement : HTMLElement { readonly attribute HTMLFormElement? form; + + // also has obsolete members }; enum SelectionMode { @@ -1069,6 +1133,7 @@ [CEReactions] attribute DOMString integrity; [CEReactions] attribute DOMString referrerPolicy; + // also has obsolete members }; [Exposed=Window,
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/wake-lock.idl b/third_party/blink/web_tests/external/wpt/interfaces/wake-lock.idl index 5081891..863cef1 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/wake-lock.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/wake-lock.idl
@@ -9,13 +9,10 @@ enum WakeLockType { "screen", "system" }; -[Constructor(WakeLockType type), SecureContext, Exposed=(DedicatedWorker,Window)] -interface WakeLock : EventTarget { +[SecureContext, Exposed=(DedicatedWorker,Window)] +interface WakeLock { [Exposed=Window] static Promise<PermissionState> requestPermission(WakeLockType type); - readonly attribute WakeLockType type; - readonly attribute boolean active; - attribute EventHandler onactivechange; - Promise<void> request(optional WakeLockRequestOptions options); + static Promise<void> request(WakeLockType type, optional WakeLockRequestOptions options); }; dictionary WakeLockRequestOptions {
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl b/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl index be8d0c10..bf57b8b 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl
@@ -76,6 +76,7 @@ dictionary AuthenticatorSelectionCriteria { AuthenticatorAttachment authenticatorAttachment; boolean requireResidentKey = false; + ResidentKeyRequirement residentKey; UserVerificationRequirement userVerification = "preferred"; }; @@ -84,6 +85,12 @@ "cross-platform" }; +enum ResidentKeyRequirement { + "discouraged", + "preferred", + "required" +}; + enum AttestationConveyancePreference { "none", "indirect", @@ -228,3 +235,15 @@ float FAR; float FRR; }; + +partial dictionary AuthenticationExtensionsClientInputs { + boolean credProps; +}; + +dictionary CredentialPropertiesOutput { + boolean rk; +}; + +partial dictionary AuthenticationExtensionsClientOutputs { + CredentialPropertiesOutput credProps; +};
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl b/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl index c402663..6ae3416 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl
@@ -5,9 +5,9 @@ dictionary RTCConfiguration { sequence<RTCIceServer> iceServers; - RTCIceTransportPolicy iceTransportPolicy = "all"; - RTCBundlePolicy bundlePolicy = "balanced"; - RTCRtcpMuxPolicy rtcpMuxPolicy = "require"; + RTCIceTransportPolicy iceTransportPolicy; + RTCBundlePolicy bundlePolicy; + RTCRtcpMuxPolicy rtcpMuxPolicy; DOMString peerIdentity; sequence<RTCCertificate> certificates; [EnforceRange] @@ -382,6 +382,7 @@ required DOMHighResTimeStamp timestamp; required unsigned long source; double audioLevel; + unsigned long rtpTimestamp; }; dictionary RTCRtpSynchronizationSource : RTCRtpContributingSource {
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webxr.idl b/third_party/blink/web_tests/external/wpt/interfaces/webxr.idl index 29e38f9..c1e6d8c 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/webxr.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/webxr.idl
@@ -32,14 +32,12 @@ // Attributes readonly attribute XREnvironmentBlendMode environmentBlendMode; [SameObject] readonly attribute XRRenderState renderState; - [SameObject] readonly attribute XRSpace viewerSpace; + readonly attribute XRInputSourceArray inputSources; // Methods void updateRenderState(optional XRRenderStateInit state); Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type); - FrozenArray<XRInputSource> getInputSources(); - long requestAnimationFrame(XRFrameRequestCallback callback); void cancelAnimationFrame(long handle); @@ -85,11 +83,10 @@ }; enum XRReferenceSpaceType { - "identity", - "position-disabled", - "eye-level", - "floor-level", - "bounded", + "viewer", + "local", + "local-floor", + "bounded-floor", "unbounded" }; @@ -106,6 +103,7 @@ }; enum XREye { + "none", "left", "right" }; @@ -171,6 +169,13 @@ [SameObject] readonly attribute Gamepad? gamepad; }; +[SecureContext, Exposed=Window] +interface XRInputSourceArray { + iterable<XRInputSource>; + readonly attribute unsigned long length; + getter XRInputSource(unsigned long index); +}; + enum GamepadMappingType { "", // Defined in the Gamepad API "standard", // Defined in the Gamepad API @@ -207,7 +212,6 @@ // Methods XRViewport? getViewport(XRView view); - void requestViewportScaling(double viewportScaleFactor); // Static Methods static double getNativeFramebufferScaleFactor(XRSession session); @@ -247,6 +251,20 @@ long? buttonIndex = null; }; +[SecureContext, Exposed=Window, Constructor(DOMString type, XRInputSourcesChangeEventInit eventInitDict)] +interface XRInputSourcesChangeEvent : Event { + [SameObject] readonly attribute XRSession session; + [SameObject] readonly attribute FrozenArray<XRInputSource> added; + [SameObject] readonly attribute FrozenArray<XRInputSource> removed; +}; + +dictionary XRInputSourcesChangeEventInit : EventInit { + required XRSession session; + required FrozenArray<XRInputSource> added; + required FrozenArray<XRInputSource> removed; + +}; + [SecureContext, Exposed=Window, Constructor(DOMString type, XRReferenceSpaceEventInit eventInitDict)] interface XRReferenceSpaceEvent : Event { [SameObject] readonly attribute XRReferenceSpace referenceSpace;
diff --git a/third_party/blink/web_tests/external/wpt/preload/link-header-preload-imagesrcset.html b/third_party/blink/web_tests/external/wpt/preload/link-header-preload-imagesrcset.html index 54f6252..b41cbee 100644 --- a/third_party/blink/web_tests/external/wpt/preload/link-header-preload-imagesrcset.html +++ b/third_party/blink/web_tests/external/wpt/preload/link-header-preload-imagesrcset.html
@@ -1,16 +1,31 @@ <!DOCTYPE html> +<title>Makes sure that Link headers preload images with imagesrcset/imagesizes attributes.</title> <link rel="help" href="https://github.com/w3c/preload/issues/120"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> -<script> - var t = async_test('Makes sure that Link headers preload images with imagesrcset/imagesizes attributes.'); -</script> <body> <script> - window.addEventListener("load", t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (numberOfResourceTimingEntries('resources/square.png?from-header&1x') == 1 && + numberOfResourceTimingEntries('resources/square.png?from-header&2x') == 0 && + numberOfResourceTimingEntries('resources/square.png?from-header&3x') == 0 && + numberOfResourceTimingEntries('resources/square.png?from-header&base') == 0 && + numberOfResourceTimingEntries('resources/square.png?from-header&200') == 0 && + numberOfResourceTimingEntries('resources/square.png?from-header&400') == 1 && + numberOfResourceTimingEntries('resources/square.png?from-header&800') == 0 && + numberOfResourceTimingEntries('resources/square.png?from-header&150') == 0 && + numberOfResourceTimingEntries('resources/square.png?from-header&300') == 1 && + numberOfResourceTimingEntries('resources/square.png?from-header&600') == 0) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). verifyNumberOfResourceTimingEntries('resources/square.png?from-header&1x', 1); verifyNumberOfResourceTimingEntries('resources/square.png?from-header&2x', 0); verifyNumberOfResourceTimingEntries('resources/square.png?from-header&3x', 0); @@ -21,8 +36,15 @@ verifyNumberOfResourceTimingEntries('resources/square.png?from-header&150', 0); verifyNumberOfResourceTimingEntries('resources/square.png?from-header&300', 1); verifyNumberOfResourceTimingEntries('resources/square.png?from-header&600', 0); - t.done(); - }, 3000); - })); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/preload/link-header-preload-nonce.html b/third_party/blink/web_tests/external/wpt/preload/link-header-preload-nonce.html index dc1ec10..bfac563 100644 --- a/third_party/blink/web_tests/external/wpt/preload/link-header-preload-nonce.html +++ b/third_party/blink/web_tests/external/wpt/preload/link-header-preload-nonce.html
@@ -1,17 +1,33 @@ <!DOCTYPE html> +<title>Makes sure that Link headers preload resources with CSP nonce</title> <script nonce="abc" src="/resources/testharness.js"></script> <script nonce="abc" src="/resources/testharnessreport.js"></script> <script nonce="abc" src="/preload/resources/preload_helper.js"></script> +<body> <script nonce="abc"> - var t = async_test('Makes sure that Link headers preload resources with CSP nonce'); -</script> -<script nonce="abc"> - window.addEventListener('load', t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (numberOfResourceTimingEntries("resources/dummy.js?from-header&without-nonce") == 0 && + numberOfResourceTimingEntries("resources/dummy.js?from-header&with-nonce") == 1) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). verifyNumberOfResourceTimingEntries("resources/dummy.js?from-header&without-nonce", 0); verifyNumberOfResourceTimingEntries("resources/dummy.js?from-header&with-nonce", 1); - t.done(); - }, 5000); - })); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/preload/link-header-preload.html b/third_party/blink/web_tests/external/wpt/preload/link-header-preload.html index 0ca364b..4dfdfc88 100644 --- a/third_party/blink/web_tests/external/wpt/preload/link-header-preload.html +++ b/third_party/blink/web_tests/external/wpt/preload/link-header-preload.html
@@ -1,20 +1,35 @@ <!DOCTYPE html> +<title>Makes sure that Link headers preload resources</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> -<script> - var t = async_test('Makes sure that Link headers preload resources'); -</script> <body> <script> - window.addEventListener("load", t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (numberOfResourceTimingEntries("resources/square.png?link-header-preload") == 1 && + numberOfResourceTimingEntries("resources/dummy.js?link-header-preload") == 1 && + numberOfResourceTimingEntries("resources/dummy.css?link-header-preload") == 1) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). verifyNumberOfResourceTimingEntries("resources/square.png?link-header-preload", 1); verifyNumberOfResourceTimingEntries("resources/dummy.js?link-header-preload", 1); verifyNumberOfResourceTimingEntries("resources/dummy.css?link-header-preload", 1); - t.done(); - }, 5000); - })); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/preload/onload-event-expected.txt b/third_party/blink/web_tests/external/wpt/preload/onload-event-expected.txt index d14478b9..6ff3147 100644 --- a/third_party/blink/web_tests/external/wpt/preload/onload-event-expected.txt +++ b/third_party/blink/web_tests/external/wpt/preload/onload-event-expected.txt
@@ -1,4 +1,4 @@ This is a testharness.js-based test. -FAIL Makes sure that preloaded resources trigger the onload event assert_true: video triggered load event expected true got false +FAIL Makes sure that preloaded resources trigger the onload event Uncaught Error: assert_true: video triggered load event expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/preload/onload-event.html b/third_party/blink/web_tests/external/wpt/preload/onload-event.html index f9348b8c..9111cd8f 100644 --- a/third_party/blink/web_tests/external/wpt/preload/onload-event.html +++ b/third_party/blink/web_tests/external/wpt/preload/onload-event.html
@@ -1,9 +1,9 @@ <!DOCTYPE html> +<title>Makes sure that preloaded resources trigger the onload event</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> <script> - var t = async_test('Makes sure that preloaded resources trigger the onload event'); var scriptLoaded = false; var styleLoaded = false; var imageLoaded = false; @@ -28,9 +28,18 @@ <link rel=preload href="resources/dummy.xml" onload="noTypeLoaded = true;"> <body> <script> - window.onload = t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (styleLoaded && scriptLoaded && imageLoaded && fontLoaded && videoLoaded && audioLoaded && + trackLoaded && !gibberishLoaded && !gibberishErrored && fetchLoaded && !noTypeLoaded) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). assert_true(styleLoaded, "style triggered load event"); assert_true(scriptLoaded, "script triggered load event"); assert_true(imageLoaded, "image triggered load event"); @@ -42,8 +51,15 @@ assert_false(gibberishErrored, "gibberish as value triggered error event"); assert_true(fetchLoaded, "fetch as value triggered load event"); assert_false(noTypeLoaded, "empty as triggered load event"); - t.done(); - }, 5000); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); }); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/preload/preload-csp.sub.html b/third_party/blink/web_tests/external/wpt/preload/preload-csp.sub.html index 7fe06eb0..65e9b3a 100644 --- a/third_party/blink/web_tests/external/wpt/preload/preload-csp.sub.html +++ b/third_party/blink/web_tests/external/wpt/preload/preload-csp.sub.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; font-src 'none'; style-src 'none'; img-src 'none'; media-src 'none'; connect-src 'none'"> +<title>Makes sure that preload requests respect CSP</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> -<script> - var t = async_test('Makes sure that preload requests respect CSP'); -</script> <link rel=preload href="{{host}}:{{ports[http][1]}}/preload/resources/dummy.js" as=style> <link rel=preload href="resources/dummy.css" as=style> <link rel=preload href="resources/square.png" as=image> @@ -17,19 +15,41 @@ <link rel=preload href="resources/dummy.xml"> <body> <script> - window.onload = t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); - verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); - verifyNumberOfResourceTimingEntries("resources/square.png", 0); - verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); - verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); - verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); - verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); - t.done(); - }, 5000); - }); +setup({explicit_done: true}); + +var iterations = 0; + +function check_finished() { + if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && + numberOfResourceTimingEntries("resources/dummy.css") == 0 && + numberOfResourceTimingEntries("resources/square.png") == 0 && + numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && + numberOfResourceTimingEntries("resources/white.mp4") == 0 && + numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && + numberOfResourceTimingEntries("resources/foo.vtt") == 0 && + numberOfResourceTimingEntries("resources/dummy.xml") == 0) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). + verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); + verifyNumberOfResourceTimingEntries("resources/square.png", 0); + verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); + verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); + verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); + verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); + done(); + } else { + step_timeout(check_finished, 500); + } +} + +window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); +}); </script>
diff --git a/third_party/blink/web_tests/external/wpt/preload/preload-default-csp.sub.html b/third_party/blink/web_tests/external/wpt/preload/preload-default-csp.sub.html index 7813e36..92343145 100644 --- a/third_party/blink/web_tests/external/wpt/preload/preload-default-csp.sub.html +++ b/third_party/blink/web_tests/external/wpt/preload/preload-default-csp.sub.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; default-src 'none'"> +<title>Makes sure that preload requests respect CSP</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> -<script> - var t = async_test('Makes sure that preload requests respect CSP'); -</script> <link rel=preload href="{{host}}:{{ports[http][1]}}/preload/resources/dummy.js" as=style> <link rel=preload href="resources/dummy.css" as=style> <link rel=preload href="resources/square.png" as=image> @@ -17,19 +15,41 @@ <link rel=preload href="resources/dummy.xml"> <body> <script> - window.onload = t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); - verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); - verifyNumberOfResourceTimingEntries("resources/square.png", 0); - verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); - verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); - verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); - verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); - t.done(); - }, 5000); - }); +setup({explicit_done: true}); + +var iterations = 0; + +function check_finished() { + if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && + numberOfResourceTimingEntries("resources/dummy.css") == 0 && + numberOfResourceTimingEntries("resources/square.png") == 0 && + numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && + numberOfResourceTimingEntries("resources/white.mp4") == 0 && + numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && + numberOfResourceTimingEntries("resources/foo.vtt") == 0 && + numberOfResourceTimingEntries("resources/dummy.xml") == 0) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). + verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); + verifyNumberOfResourceTimingEntries("resources/square.png", 0); + verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); + verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); + verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); + verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); + done(); + } else { + step_timeout(check_finished, 500); + } +} + +window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); +}); </script>
diff --git a/third_party/blink/web_tests/external/wpt/preload/preload-with-type-expected.txt b/third_party/blink/web_tests/external/wpt/preload/preload-with-type-expected.txt index f606526..8041c99 100644 --- a/third_party/blink/web_tests/external/wpt/preload/preload-with-type-expected.txt +++ b/third_party/blink/web_tests/external/wpt/preload/preload-with-type-expected.txt
@@ -1,4 +1,4 @@ This is a testharness.js-based test. -FAIL Makes sure that preloaded resources with a type attribute trigger the onload event assert_true: video triggered load event expected true got false +FAIL Makes sure that preloaded resources with a type attribute trigger the onload event Uncaught Error: assert_true: video triggered load event expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/preload/preload-with-type.html b/third_party/blink/web_tests/external/wpt/preload/preload-with-type.html index 83eafc5..98059227 100644 --- a/third_party/blink/web_tests/external/wpt/preload/preload-with-type.html +++ b/third_party/blink/web_tests/external/wpt/preload/preload-with-type.html
@@ -1,10 +1,10 @@ <!DOCTYPE html> +<title>Makes sure that preloaded resources with a type attribute trigger the onload event</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> <script src="/common/media.js"></script> <script> - var t = async_test('Makes sure that preloaded resources with a type attribute trigger the onload event'); var scriptLoaded = false; var styleLoaded = false; var imageLoaded = false; @@ -48,9 +48,18 @@ <link rel=preload href="resources/foo.vtt" as=track type="text/foobar" onload="gibberishLoaded++;"> <body> <script> - window.onload = t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (styleLoaded && scriptLoaded && imageLoaded && fontLoaded && videoLoaded && audioLoaded && + trackLoaded && gibberishLoaded == 0) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). assert_true(styleLoaded, "style triggered load event"); assert_true(scriptLoaded, "script triggered load event"); assert_true(imageLoaded, "image triggered load event"); @@ -59,8 +68,15 @@ assert_true(audioLoaded, "audio triggered load event"); assert_true(trackLoaded, "track triggered load event"); assert_equals(gibberishLoaded, 0, "resources with gibberish type should not be loaded"); - t.done(); - }, 5000); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); }); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/preload/resources/preload_helper.js b/third_party/blink/web_tests/external/wpt/preload/resources/preload_helper.js index f464908..1c7c1a27 100644 --- a/third_party/blink/web_tests/external/wpt/preload/resources/preload_helper.js +++ b/third_party/blink/web_tests/external/wpt/preload/resources/preload_helper.js
@@ -12,8 +12,12 @@ function verifyNumberOfResourceTimingEntries(url, number) { - var numEntries = performance.getEntriesByName(getAbsoluteURL(url)).length; - assert_equals(numEntries, number, url); + assert_equals(numberOfResourceTimingEntries(url), number, url); +} + +function numberOfResourceTimingEntries(url) +{ + return performance.getEntriesByName(getAbsoluteURL(url)).length; } // Verifies that the resource is loaded, but not downloaded from network
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resource-timing.https.html b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resource-timing.sub.https.html similarity index 96% rename from third_party/blink/web_tests/external/wpt/service-workers/service-worker/resource-timing.https.html rename to third_party/blink/web_tests/external/wpt/service-workers/service-worker/resource-timing.sub.https.html index 7fc3fcd..f0502ca 100644 --- a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resource-timing.https.html +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resource-timing.sub.https.html
@@ -1,15 +1,14 @@ <!DOCTYPE html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/common/get-host-info.sub.js"></script> <script src="resources/test-helpers.sub.js"></script> <script> function resourceUrl(path) { - return get_host_info()['HTTPS_ORIGIN'] + base_path() + path; + return "https://{{host}}:{{ports[https][0]}}" + base_path() + path; } function crossOriginUrl(path) { - return get_host_info()['HTTPS_REMOTE_ORIGIN'] + base_path() + path; + return "https://{{hosts[alt][]}}:{{ports[https][0]}}" + base_path() + path; } function verify(options) {
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/resource-timing-iframe.sub.html b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/resource-timing-iframe.sub.html index 4b626576a..41bc2e7 100644 --- a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/resource-timing-iframe.sub.html +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/resource-timing-iframe.sub.html
@@ -3,8 +3,8 @@ <script src="dummy.js"></script> <script src="redirect.py?Redirect=empty.js"></script> <img src="square.png"> -<img src="https://{{domains[www1]}}:{{ports[https][0]}}/service-workers/service-worker/resources/square.png"> +<img src="https://{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/square.png"> <img src="missing.jpg"> -<img src="https://{{domains[www1]}}:{{ports[https][0]}}/service-workers/service-worker/resources/missing.jpg"> +<img src="https://{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/missing.jpg"> <img src='missing.jpg?SWRespondsWithFetch'> <script src='empty-worker.js'></script>
diff --git a/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt b/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt index 921d3f2..c08f4384 100644 --- a/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt +++ b/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 1600 tests; 1474 PASS, 126 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 1594 tests; 1474 PASS, 120 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS Partial interface Document: original interface defined PASS SVGElement interface: existence and properties of interface object @@ -460,12 +460,6 @@ PASS SVGElement interface: objects.g must inherit property "viewportElement" with the proper type FAIL SVGElement interface: objects.g must inherit property "correspondingElement" with the proper type assert_inherits: property "correspondingElement" not found in prototype chain FAIL SVGElement interface: objects.g must inherit property "correspondingUseElement" with the proper type assert_inherits: property "correspondingUseElement" not found in prototype chain -FAIL SVGUnknownElement interface: existence and properties of interface object assert_own_property: self does not have own property "SVGUnknownElement" expected property "SVGUnknownElement" missing -FAIL SVGUnknownElement interface object length assert_own_property: self does not have own property "SVGUnknownElement" expected property "SVGUnknownElement" missing -FAIL SVGUnknownElement interface object name assert_own_property: self does not have own property "SVGUnknownElement" expected property "SVGUnknownElement" missing -FAIL SVGUnknownElement interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SVGUnknownElement" expected property "SVGUnknownElement" missing -FAIL SVGUnknownElement interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SVGUnknownElement" expected property "SVGUnknownElement" missing -FAIL SVGUnknownElement interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SVGUnknownElement" expected property "SVGUnknownElement" missing PASS SVGDefsElement interface: existence and properties of interface object PASS SVGDefsElement interface object length PASS SVGDefsElement interface object name
diff --git a/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/servodriver.py b/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/servodriver.py index 0a63a32..e5e08e2 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/servodriver.py +++ b/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/servodriver.py
@@ -1,3 +1,4 @@ +import multiprocessing import os import subprocess import tempfile @@ -72,9 +73,9 @@ f.write(make_hosts_file(config, "127.0.0.1")) return hosts_path - class ServoWebDriverBrowser(Browser): used_ports = set() + used_ports_lock = multiprocessing.Lock() init_timeout = 300 # Large timeout for cases where we're booting an Android emulator def __init__(self, logger, binary, debug_info=None, webdriver_host="127.0.0.1", @@ -94,8 +95,9 @@ self.ca_certificate_path = server_config.ssl_config["ca_cert_path"] def start(self, **kwargs): - self.webdriver_port = get_free_port(4444, exclude=self.used_ports) - self.used_ports.add(self.webdriver_port) + with ServoWebDriverBrowser.used_ports_lock: + self.webdriver_port = get_free_port(4444, exclude=self.used_ports) + self.used_ports.add(self.webdriver_port) env = os.environ.copy() env["HOST_FILE"] = self.hosts_path
diff --git a/third_party/blink/web_tests/external/wpt/user-timing/measure-with-dict.html b/third_party/blink/web_tests/external/wpt/user-timing/measure-with-dict.html index 47a4f3f5..e5869e1 100644 --- a/third_party/blink/web_tests/external/wpt/user-timing/measure-with-dict.html +++ b/third_party/blink/web_tests/external/wpt/user-timing/measure-with-dict.html
@@ -15,22 +15,20 @@ [{ entryType: "measure", name: "measure1", detail: null, startTime: 0 }, { entryType: "measure", name: "measure2", detail: null, startTime: 0 }, { entryType: "measure", name: "measure3", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure5", detail: null }, - { entryType: "measure", name: "measure7", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure11", detail: null, startTime: timeStamp1 }, - { entryType: "measure", name: "measure13", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 }, - { entryType: "measure", name: "measure14", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure15", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure16", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure17", detail: null, startTime: timeStamp1 }, - { entryType: "measure", name: "measure18", detail: null, startTime: timeStamp3 }, - { entryType: "measure", name: "measure19", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure20", detail: null, startTime: 0 }, - { entryType: "measure", name: "measure21", detail: null, startTime: timeStamp3, duration: timeStamp1 - timeStamp3 }, - { entryType: "measure", name: "measure22", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 }, - { entryType: "measure", name: "measure23", detail: null, startTime: timeStamp1 }, - { entryType: "measure", name: "measure24", detail: {}, startTime: 0 }, - { entryType: "measure", name: "measure25", detail: { customInfo: 159 }, startTime: timeStamp3, duration: timeStamp2 - timeStamp3 }]; + { entryType: "measure", name: "measure4", detail: null }, + { entryType: "measure", name: "measure5", detail: null, startTime: 0 }, + { entryType: "measure", name: "measure6", detail: null, startTime: timeStamp1 }, + { entryType: "measure", name: "measure7", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 }, + { entryType: "measure", name: "measure8", detail: null, startTime: 0 }, + { entryType: "measure", name: "measure9", detail: null, startTime: 0 }, + { entryType: "measure", name: "measure10", detail: null, startTime: timeStamp1 }, + { entryType: "measure", name: "measure11", detail: null, startTime: timeStamp3 }, + { entryType: "measure", name: "measure12", detail: null, startTime: 0 }, + { entryType: "measure", name: "measure13", detail: null, startTime: 0 }, + { entryType: "measure", name: "measure14", detail: null, startTime: timeStamp3, duration: timeStamp1 - timeStamp3 }, + { entryType: "measure", name: "measure15", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 }, + { entryType: "measure", name: "measure16", detail: null, startTime: timeStamp1 }, + { entryType: "measure", name: "measure17", detail: { customInfo: 159 }, startTime: timeStamp3, duration: timeStamp2 - timeStamp3 }]; const observer = new PerformanceObserver( t.step_func(function (entryList, obs) { measureEntries = @@ -52,37 +50,33 @@ returnedEntries.push(self.performance.measure("measure1")); returnedEntries.push(self.performance.measure("measure2", undefined)); returnedEntries.push(self.performance.measure("measure3", null)); - returnedEntries.push(self.performance.measure("measure5", 'mark1')); + returnedEntries.push(self.performance.measure("measure4", 'mark1')); returnedEntries.push( - self.performance.measure("measure7", null, 'mark1')); + self.performance.measure("measure5", null, 'mark1')); returnedEntries.push( - self.performance.measure("measure11", 'mark1', undefined)); + self.performance.measure("measure6", 'mark1', undefined)); returnedEntries.push( - self.performance.measure("measure13", 'mark1', 'mark2')); + self.performance.measure("measure7", 'mark1', 'mark2')); returnedEntries.push( - self.performance.measure("measure14", {})); + self.performance.measure("measure8", {})); returnedEntries.push( - self.performance.measure("measure15", { startTime: null })); + self.performance.measure("measure9", { start: undefined })); returnedEntries.push( - self.performance.measure("measure16", { startTime: undefined })); + self.performance.measure("measure10", { start: 'mark1' })); returnedEntries.push( - self.performance.measure("measure17", { startTime: 'mark1' })); + self.performance.measure("measure11", { start: timeStamp3 })); returnedEntries.push( - self.performance.measure("measure18", { startTime: timeStamp3 })); + self.performance.measure("measure12", { end: undefined })); returnedEntries.push( - self.performance.measure("measure19", { endTime: undefined })); + self.performance.measure("measure13", { end: 'mark1' })); returnedEntries.push( - self.performance.measure("measure20", { endTime: 'mark1' })); + self.performance.measure("measure14", { start: timeStamp3, end: 'mark1' })); returnedEntries.push( - self.performance.measure("measure21", { startTime: timeStamp3, endTime: 'mark1' })); + self.performance.measure("measure15", { start: timeStamp1, end: timeStamp2, detail: undefined })); returnedEntries.push( - self.performance.measure("measure22", { startTime: timeStamp1, endTime: timeStamp2, detail: undefined })); + self.performance.measure("measure16", { start: 'mark1', end: undefined, detail: null })); returnedEntries.push( - self.performance.measure("measure23", { startTime: 'mark1', endTime: undefined, detail: null })); - returnedEntries.push( - self.performance.measure("measure24", { startTime: null, endTime: timeStamp1, detail: {} })); - returnedEntries.push( - self.performance.measure("measure25", { startTime: timeStamp3, endTime: 'mark2', detail: { customInfo: 159 }})); + self.performance.measure("measure17", { start: timeStamp3, end: 'mark2', detail: { customInfo: 159 }})); checkEntries(returnedEntries, expectedEntries); }, "measure entries' detail and start/end are customizable");
diff --git a/third_party/blink/web_tests/external/wpt/wake-lock/idlharness.https.any-expected.txt b/third_party/blink/web_tests/external/wpt/wake-lock/idlharness.https.any-expected.txt index ca88133a..f6eb85a7 100644 --- a/third_party/blink/web_tests/external/wpt/wake-lock/idlharness.https.any-expected.txt +++ b/third_party/blink/web_tests/external/wpt/wake-lock/idlharness.https.any-expected.txt
@@ -1,24 +1,18 @@ This is a testharness.js-based test. PASS idl_test setup -PASS WakeLock interface: existence and properties of interface object -FAIL WakeLock interface object length assert_equals: wrong value for WakeLock.length expected 1 but got 0 +FAIL WakeLock interface: existence and properties of interface object assert_equals: prototype of self's property "WakeLock" is not Function.prototype expected function "function () { [native code] }" but got function "function EventTarget() { [native code] }" +PASS WakeLock interface object length PASS WakeLock interface object name -PASS WakeLock interface: existence and properties of interface prototype object +FAIL WakeLock interface: existence and properties of interface prototype object assert_equals: prototype of WakeLock.prototype is not Object.prototype expected object "[object Object]" but got object "[object EventTarget]" PASS WakeLock interface: existence and properties of interface prototype object's "constructor" property PASS WakeLock interface: existence and properties of interface prototype object's @@unscopables property FAIL WakeLock interface: operation requestPermission(WakeLockType) assert_own_property: interface object missing static operation expected property "requestPermission" missing -PASS WakeLock interface: attribute type -PASS WakeLock interface: attribute active -PASS WakeLock interface: attribute onactivechange -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: interface prototype object missing non-static operation expected property "request" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: interface object missing static operation expected property "request" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" FAIL WakeLock interface: new WakeLock("screen") must inherit property "requestPermission(WakeLockType)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" FAIL WakeLock interface: calling requestPermission(WakeLockType) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Illegal constructor" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/webxr/idlharness.https.window-expected.txt b/third_party/blink/web_tests/external/wpt/webxr/idlharness.https.window-expected.txt index c488c45e..f7aeb02f 100644 --- a/third_party/blink/web_tests/external/wpt/webxr/idlharness.https.window-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webxr/idlharness.https.window-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 202 tests; 201 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 217 tests; 198 PASS, 19 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS Partial interface Navigator: original interface defined PASS Partial dictionary WebGLContextAttributes: original dictionary defined @@ -28,10 +28,9 @@ PASS XRSession interface: existence and properties of interface prototype object's @@unscopables property PASS XRSession interface: attribute environmentBlendMode PASS XRSession interface: attribute renderState -PASS XRSession interface: attribute viewerSpace +FAIL XRSession interface: attribute inputSources assert_true: The prototype object must have a property "inputSources" expected true got false PASS XRSession interface: operation updateRenderState(XRRenderStateInit) PASS XRSession interface: operation requestReferenceSpace(XRReferenceSpaceType) -PASS XRSession interface: operation getInputSources() PASS XRSession interface: operation requestAnimationFrame(XRFrameRequestCallback) PASS XRSession interface: operation cancelAnimationFrame(long) PASS XRSession interface: operation end() @@ -147,6 +146,14 @@ PASS XRInputSource interface: attribute targetRaySpace PASS XRInputSource interface: attribute gripSpace PASS XRInputSource interface: attribute gamepad +FAIL XRInputSourceArray interface: existence and properties of interface object assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing +FAIL XRInputSourceArray interface object length assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing +FAIL XRInputSourceArray interface object name assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing +FAIL XRInputSourceArray interface: existence and properties of interface prototype object assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing +FAIL XRInputSourceArray interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing +FAIL XRInputSourceArray interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing +FAIL XRInputSourceArray interface: iterable<XRInputSource> Cannot read property 'prototype' of undefined +FAIL XRInputSourceArray interface: attribute length assert_own_property: self does not have own property "XRInputSourceArray" expected property "XRInputSourceArray" missing PASS XRLayer interface: existence and properties of interface object PASS XRLayer interface object length PASS XRLayer interface object name @@ -166,7 +173,6 @@ PASS XRWebGLLayer interface: attribute framebufferWidth PASS XRWebGLLayer interface: attribute framebufferHeight PASS XRWebGLLayer interface: operation getViewport(XRView) -PASS XRWebGLLayer interface: operation requestViewportScaling(double) PASS XRWebGLLayer interface: operation getNativeFramebufferScaleFactor(XRSession) PASS XRPresentationContext interface: existence and properties of interface object PASS XRPresentationContext interface object length @@ -191,6 +197,15 @@ PASS XRInputSourceEvent interface: attribute frame PASS XRInputSourceEvent interface: attribute inputSource PASS XRInputSourceEvent interface: attribute buttonIndex +FAIL XRInputSourcesChangeEvent interface: existence and properties of interface object assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface object length assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface object name assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface: attribute session assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface: attribute added assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing +FAIL XRInputSourcesChangeEvent interface: attribute removed assert_own_property: self does not have own property "XRInputSourcesChangeEvent" expected property "XRInputSourcesChangeEvent" missing PASS XRReferenceSpaceEvent interface: existence and properties of interface object PASS XRReferenceSpaceEvent interface object length PASS XRReferenceSpaceEvent interface object name
diff --git a/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_util.js b/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_util.js index c66b131..3b010a43 100644 --- a/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_util.js +++ b/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_util.js
@@ -51,6 +51,7 @@ navigator.xr.requestSession(sessionMode) .then((session) => { testSession = session; + session.mode = sessionMode; // Session must have a baseLayer or frame requests // will be ignored. session.updateRenderState({
diff --git a/third_party/blink/web_tests/external/wpt/webxr/xrView_eyes.https.html b/third_party/blink/web_tests/external/wpt/webxr/xrView_eyes.https.html new file mode 100644 index 0000000..847ba388 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/webxr/xrView_eyes.https.html
@@ -0,0 +1,57 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/test-constants.js"></script> +<script src="resources/webxr_util.js"></script> +<script src="resources/xr-test-asserts.js"></script> +<canvas></canvas> + +<script> + +let immersiveTestName = "XRView.eye is correct for immersive sessions"; +let nonImmersiveTestName = "XRView.eye is correct for non-immersive sessions"; + +let fakeDeviceInitParams = { supportsImmersive:true }; + +let testFunction = function(session, fakeDeviceController, t) { + // Need to have a valid pose or input events don't process. + fakeDeviceController.setXRPresentationFrameData(VALID_POSE_MATRIX, [{ + eye:"left", + projectionMatrix: VALID_PROJECTION_MATRIX, + viewMatrix: VALID_VIEW_MATRIX + }, { + eye:"right", + projectionMatrix: VALID_PROJECTION_MATRIX, + viewMatrix: VALID_VIEW_MATRIX + }]); + + return session.requestReferenceSpace({ type: "identity" }) + .then((space) => new Promise((resolve) => { + function onFrame(time, xrFrame) { + let viewer_pose = xrFrame.getViewerPose(space); + + if (session.mode == 'inline') { + // An inline session should report a single view with an eye type "none". + assert_equals(viewer_pose.views.length, 1); + assert_equals(viewer_pose.views[0].eye, "none"); + } else { + // An immersive session should report a two views with a left and right eye. + assert_equals(viewer_pose.views.length, 2); + assert_equals(viewer_pose.views[0].eye, "left"); + assert_equals(viewer_pose.views[1].eye, "right"); + } + + // Finished test. + resolve(); + } + + session.requestAnimationFrame(onFrame); + })); +}; + +xr_session_promise_test(immersiveTestName, testFunction, + fakeDeviceInitParams, 'immersive-vr'); +xr_session_promise_test(nonImmersiveTestName, testFunction, + fakeDeviceInitParams, 'inline'); + +</script>
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt index 247dee5..55f9d96 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt
@@ -1,5 +1,3 @@ -nick.jpg has MIME type image/jpeg -nick.jpg has MIME type image/jpeg This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource. See bug 49236 in which this wasn't working. When this test succeeds, you'll see an image of Nick on a sailboat immediately below this text. When this test fails, you will see no images at all.
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html index 874e993..d35e23e 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
@@ -23,7 +23,6 @@ if (window.testRunner) { testRunner.waitUntilDone(); testRunner.dumpAsText(); - testRunner.dumpResourceResponseMIMETypes(); } </script> <p>This test verifies that an image which is prefetched, and which is also contained as a
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test.html b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test.html index a3179dc..fb4dbe3 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test.html +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/link-and-subresource-test.html
@@ -23,7 +23,6 @@ if (window.testRunner) { testRunner.waitUntilDone(); testRunner.dumpAsText(); - testRunner.dumpResourceResponseMIMETypes(); } </script> <p>This test verifies that an image which is prefetched, and which is also contained as a
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch-expected.txt b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch-expected.txt index 8ac0b16..78a7eb5 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch-expected.txt +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch-expected.txt
@@ -1,4 +1,4 @@ -prefetch.link has MIME type text/plain +HTMLLinkElement/prefetch.link - willSendRequest <NSURLRequest URL HTMLLinkElement/prefetch.link, main document URL prefetch.html, http method GET> This test requires DumpRenderTree to see the log of what resources are loaded. SUCCESS! prefetch onload called.
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch.html b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch.html index 8423929..aac2e919 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch.html +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/prefetch.html
@@ -12,7 +12,7 @@ if (window.testRunner) { testRunner.waitUntilDone(); testRunner.dumpAsText(); - testRunner.dumpResourceResponseMIMETypes(); + testRunner.dumpResourceLoadCallbacks(); } </script> <html>
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource-expected.txt b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource-expected.txt index 4e4a1c4b..3ff6a15 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource-expected.txt +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource-expected.txt
@@ -1,4 +1,3 @@ -prefetch.link has MIME type text/plain PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource.html b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource.html index 6e103a2..f103ab5b 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource.html +++ b/third_party/blink/web_tests/fast/dom/HTMLLinkElement/subresource.html
@@ -9,7 +9,6 @@ if (window.testRunner) { testRunner.waitUntilDone(); testRunner.dumpAsText(); - testRunner.dumpResourceResponseMIMETypes(); } </script> <html>
diff --git a/third_party/blink/web_tests/fast/dom/HTMLScriptElement/dont-load-unknown-type.html b/third_party/blink/web_tests/fast/dom/HTMLScriptElement/dont-load-unknown-type.html index 027ac31a..700197c 100644 --- a/third_party/blink/web_tests/fast/dom/HTMLScriptElement/dont-load-unknown-type.html +++ b/third_party/blink/web_tests/fast/dom/HTMLScriptElement/dont-load-unknown-type.html
@@ -1,9 +1,7 @@ <div id="console"></div> <script> - if (window.testRunner) { + if (window.testRunner) testRunner.dumpAsText(); - testRunner.dumpResourceResponseMIMETypes(); - } function fail(str) { var element = document.createElement("p");
diff --git a/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-create-basics.html b/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-create-basics.html index 471820b..416e9db 100644 --- a/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-create-basics.html +++ b/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-create-basics.html
@@ -154,13 +154,6 @@ navigator.credentials.create({ publicKey : MAKE_CREDENTIAL_OPTIONS})); }, "Verify that credential excluded error returned by mock is properly handled."); -promise_test(t => { - mockAuthenticator.setAuthenticatorStatus( - blink.mojom.AuthenticatorStatus.CREDENTIAL_NOT_RECOGNIZED); - return promise_rejects(t, "InvalidStateError", - navigator.credentials.create({ publicKey : MAKE_CREDENTIAL_OPTIONS})); -}, "Verify that credential not recognized error returned by mock is properly handled."); - promise_test(_ => { mockAuthenticator.reset(); mockAuthenticator.setDefaultsForSuccessfulMakeCredential();
diff --git a/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-from-nested-frame.html b/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-from-nested-frame.html index 8ba92395..541fbfe7 100644 --- a/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-from-nested-frame.html +++ b/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-from-nested-frame.html
@@ -112,9 +112,9 @@ someOtherCredential.id = new TextEncoder().encode("someOtherCredential"); customGetAssertionOptions.allowCredentials = [someOtherCredential]; - return promise_rejects(t, "InvalidStateError", + return promise_rejects(t, "NotAllowedError", navigator.credentials.get({ publicKey : customGetAssertionOptions})); -}, "navigator.credentials.get() for unregistered device returns InvalidStateError"); +}, "navigator.credentials.get() for unregistered device returns NotAllowedError"); promise_test(async t => { var customGetAssertionOptions = deepCopy(GET_CREDENTIAL_OPTIONS);
diff --git a/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-with-virtual-authenticator.html b/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-with-virtual-authenticator.html index de227a6..aef39e1 100644 --- a/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-with-virtual-authenticator.html +++ b/third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-with-virtual-authenticator.html
@@ -35,9 +35,9 @@ someOtherCredential.id = new TextEncoder().encode("someOtherCredential"); customGetAssertionOptions.allowCredentials = [someOtherCredential]; - return promise_rejects(t, "InvalidStateError", + return promise_rejects(t, "NotAllowedError", navigator.credentials.get({ publicKey : customGetAssertionOptions})); -}, "navigator.credentials.get() for unregistered device returns InvalidStateError"); +}, "navigator.credentials.get() for unregistered device returns NotAllowedError"); promise_test(async t => { var customGetAssertionOptions = deepCopy(GET_CREDENTIAL_OPTIONS);
diff --git a/third_party/blink/web_tests/http/tests/loading/307-after-303-after-post-expected.txt b/third_party/blink/web_tests/http/tests/loading/307-after-303-after-post-expected.txt index 9725221..8af010d 100644 --- a/third_party/blink/web_tests/http/tests/loading/307-after-303-after-post-expected.txt +++ b/third_party/blink/web_tests/http/tests/loading/307-after-303-after-post-expected.txt
@@ -8,7 +8,6 @@ main frame - didFinishLoadForFrame main frame - didHandleOnloadEventsForFrame main frame - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/307-post-output-target.php - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/307-post-output-target.php, http status code 200> main frame - didCommitLoadForFrame main frame - didReceiveTitle: main frame - didFinishDocumentLoadForFrame
diff --git a/third_party/blink/web_tests/http/tests/loading/redirect-methods-expected.txt b/third_party/blink/web_tests/http/tests/loading/redirect-methods-expected.txt index 12e806f..f2f60e2 100644 --- a/third_party/blink/web_tests/http/tests/loading/redirect-methods-expected.txt +++ b/third_party/blink/web_tests/http/tests/loading/redirect-methods-expected.txt
@@ -17,7 +17,6 @@ frame "0" - BeginNavigation request to 'http://127.0.0.1:8000/loading/resources/redirect-methods-form.html', http method GET frame "0" - DidStartNavigation frame "0" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200> frame "0" - didCommitLoadForFrame frame "0" - didReceiveTitle: frame "0" - didFinishDocumentLoadForFrame @@ -26,7 +25,6 @@ frame "0" - didFinishLoadForFrame frame "0" - didHandleOnloadEventsForFrame frame "0" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, http status code 200> frame "0" - didCommitLoadForFrame frame "0" - didReceiveTitle: frame "0" - didFinishDocumentLoadForFrame @@ -44,7 +42,6 @@ frame "0" - didHandleOnloadEventsForFrame frame "0" - didFinishLoadForFrame frame "1" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200> frame "1" - didCommitLoadForFrame frame "1" - didReceiveTitle: frame "1" - didFinishDocumentLoadForFrame @@ -53,7 +50,6 @@ frame "1" - didFinishLoadForFrame frame "1" - didHandleOnloadEventsForFrame frame "1" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, http status code 200> frame "1" - didCommitLoadForFrame frame "1" - didReceiveTitle: frame "1" - didFinishDocumentLoadForFrame @@ -71,7 +67,6 @@ frame "1" - didHandleOnloadEventsForFrame frame "1" - didFinishLoadForFrame frame "2" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200> frame "2" - didCommitLoadForFrame frame "2" - didReceiveTitle: frame "2" - didFinishDocumentLoadForFrame @@ -80,7 +75,6 @@ frame "2" - didFinishLoadForFrame frame "2" - didHandleOnloadEventsForFrame frame "2" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, http status code 200> frame "2" - didCommitLoadForFrame frame "2" - didReceiveTitle: frame "2" - didFinishDocumentLoadForFrame @@ -98,7 +92,6 @@ frame "2" - didHandleOnloadEventsForFrame frame "2" - didFinishLoadForFrame frame "3" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200> frame "3" - didCommitLoadForFrame frame "3" - didReceiveTitle: frame "3" - didFinishDocumentLoadForFrame @@ -107,7 +100,6 @@ frame "3" - didFinishLoadForFrame frame "3" - didHandleOnloadEventsForFrame frame "3" - ReadyToCommitNavigation -http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, http status code 200> frame "3" - didCommitLoadForFrame frame "3" - didReceiveTitle: frame "3" - didFinishDocumentLoadForFrame
diff --git a/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type-expected.txt b/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type-expected.txt deleted file mode 100644 index 86af810e..0000000 --- a/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -load-and-stall.php has MIME type image/x-png -
diff --git a/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type.html b/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type.html index 2931df6e..38493a1 100644 --- a/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type.html +++ b/third_party/blink/web_tests/http/tests/mime/png-image-with-x-png-mime-type.html
@@ -3,11 +3,9 @@ <body> <iframe scrolling=no width=300 height=300></iframe> <script> -if (window.testRunner) { +if (window.testRunner) testRunner.waitUntilDone(); - testRunner.dumpResourceResponseMIMETypes(); - testRunner.dumpAsTextWithPixelResults(); -} + function loadImage() { return "http://127.0.0.1:8000/resources/load-and-stall.php";
diff --git a/third_party/blink/web_tests/http/tests/mime/resources/uppercase-mime-type.php b/third_party/blink/web_tests/http/tests/mime/resources/uppercase-mime-type.php deleted file mode 100644 index ab01ee22..0000000 --- a/third_party/blink/web_tests/http/tests/mime/resources/uppercase-mime-type.php +++ /dev/null
@@ -1,13 +0,0 @@ -<?php -header("Content-Type: TEXT/HTML"); -?> -<html> -<script> -if (window.testRunner) - testRunner.notifyDone(); - -</script> -<body> -If this text is shown, that means the new document was successfully loaded. -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/mime/uppercase-mime-type-expected.txt b/third_party/blink/web_tests/http/tests/mime/uppercase-mime-type-expected.txt deleted file mode 100644 index 223d620..0000000 --- a/third_party/blink/web_tests/http/tests/mime/uppercase-mime-type-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -uppercase-mime-type.php has MIME type text/html -If this text is shown, that means the new document was successfully loaded.
diff --git a/third_party/blink/web_tests/http/tests/mime/uppercase-mime-type.html b/third_party/blink/web_tests/http/tests/mime/uppercase-mime-type.html deleted file mode 100644 index a4dfbb0..0000000 --- a/third_party/blink/web_tests/http/tests/mime/uppercase-mime-type.html +++ /dev/null
@@ -1,16 +0,0 @@ -<html> -<script> -if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.dumpResourceResponseMIMETypes(); - testRunner.dumpAsText(); -} - -function runTests() { - window.location.assign('resources/uppercase-mime-type.php'); -} -</script> -<body onload="runTests();"> -FAIL -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt b/third_party/blink/web_tests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt index 52fd866..4ee0a82 100644 --- a/third_party/blink/web_tests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt +++ b/third_party/blink/web_tests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt
@@ -1,4 +1,3 @@ -http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html, http status code 200> Radar 6973106 and https://bugs.webkit.org/show_bug.cgi?id=27896 - Favicons still load when automatic image loading is disabled. This test uses DRT's resource load delegate callback mode to see if the favicon is loaded even when image loading is off.
diff --git a/third_party/blink/web_tests/http/tests/misc/prefetch-purpose-expected.txt b/third_party/blink/web_tests/http/tests/misc/prefetch-purpose-expected.txt index 7e433c7..2a80acbf 100644 --- a/third_party/blink/web_tests/http/tests/misc/prefetch-purpose-expected.txt +++ b/third_party/blink/web_tests/http/tests/misc/prefetch-purpose-expected.txt
@@ -1,5 +1,3 @@ -prefetch-purpose.php has MIME type text/html -prefetch-purpose.php has MIME type text/html Purpose: prefetch This test verifies that prefetches are sent with the HTTP request header Purpose: prefetch. To do this, the root page has a prefetch link targetting this subresource which contains a PHP script (resources/prefetch-purpose.php). The PHP prints the value of the Purpose header into the document. Later, the root page sets window.location to target this script, which should have "Purpose: prefetch" in its output if it's served from cache.
diff --git a/third_party/blink/web_tests/http/tests/misc/prefetch-purpose.html b/third_party/blink/web_tests/http/tests/misc/prefetch-purpose.html index 05276fd..682a3ca 100644 --- a/third_party/blink/web_tests/http/tests/misc/prefetch-purpose.html +++ b/third_party/blink/web_tests/http/tests/misc/prefetch-purpose.html
@@ -9,7 +9,6 @@ if (window.testRunner) { testRunner.waitUntilDone(); testRunner.dumpAsText(); - testRunner.dumpResourceResponseMIMETypes(); } </script> <link href="resources/prefetch-purpose.php" rel="prefetch" onload="finishUp()">
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/linux/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/linux/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac10.10/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac10.11/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-retina/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/mac-retina/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-retina/external/wpt/preload/onload-event-expected.txt b/third_party/blink/web_tests/platform/mac-retina/external/wpt/preload/onload-event-expected.txt new file mode 100644 index 0000000..d14478b9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/external/wpt/preload/onload-event-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Makes sure that preloaded resources trigger the onload event assert_true: video triggered load event expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-retina/external/wpt/preload/preload-with-type-expected.txt b/third_party/blink/web_tests/platform/mac-retina/external/wpt/preload/preload-with-type-expected.txt new file mode 100644 index 0000000..f606526 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/external/wpt/preload/preload-with-type-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Makes sure that preloaded resources with a type attribute trigger the onload event assert_true: video triggered load event expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-retina/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-retina/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/mac-retina/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac-retina/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/win/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win7/external/wpt/css/cssom/interfaces-expected.txt b/third_party/blink/web_tests/platform/win7/external/wpt/css/cssom/interfaces-expected.txt new file mode 100644 index 0000000..7a79be6d --- /dev/null +++ b/third_party/blink/web_tests/platform/win7/external/wpt/css/cssom/interfaces-expected.txt
@@ -0,0 +1,392 @@ +This is a testharness.js-based test. +Found 386 tests; 331 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS Partial interface CSSStyleSheet: original interface defined +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface Window: original interface defined +PASS MediaList interface: existence and properties of interface object +PASS MediaList interface object length +PASS MediaList interface object name +PASS MediaList interface: existence and properties of interface prototype object +PASS MediaList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaList interface: attribute mediaText +PASS MediaList interface: stringifier +PASS MediaList interface: attribute length +PASS MediaList interface: operation item(unsigned long) +PASS MediaList interface: operation appendMedium(CSSOMString) +PASS MediaList interface: operation deleteMedium(CSSOMString) +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS StyleSheet interface: existence and properties of interface object +PASS StyleSheet interface object length +PASS StyleSheet interface object name +PASS StyleSheet interface: existence and properties of interface prototype object +PASS StyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheet interface: attribute type +PASS StyleSheet interface: attribute href +PASS StyleSheet interface: attribute ownerNode +PASS StyleSheet interface: attribute parentStyleSheet +PASS StyleSheet interface: attribute title +PASS StyleSheet interface: attribute media +PASS StyleSheet interface: attribute disabled +FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function() { + new interface_object(); + }" did not throw +PASS CSSStyleSheet interface object length +PASS CSSStyleSheet interface object name +PASS CSSStyleSheet interface: existence and properties of interface prototype object +PASS CSSStyleSheet interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleSheet interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleSheet interface: attribute ownerRule +PASS CSSStyleSheet interface: attribute cssRules +PASS CSSStyleSheet interface: operation insertRule(CSSOMString, unsigned long) +PASS CSSStyleSheet interface: operation deleteRule(unsigned long) +PASS CSSStyleSheet interface: attribute rules +PASS CSSStyleSheet interface: operation addRule(DOMString, DOMString, unsigned long) +PASS CSSStyleSheet interface: operation removeRule(unsigned long) +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "rules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "addRule(DOMString, DOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling addRule(DOMString, DOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "removeRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling removeRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type +PASS StyleSheetList interface: existence and properties of interface object +PASS StyleSheetList interface object length +PASS StyleSheetList interface object name +PASS StyleSheetList interface: existence and properties of interface prototype object +PASS StyleSheetList interface: existence and properties of interface prototype object's "constructor" property +PASS StyleSheetList interface: existence and properties of interface prototype object's @@unscopables property +PASS StyleSheetList interface: operation item(unsigned long) +PASS StyleSheetList interface: attribute length +PASS StyleSheetList must be primary interface of document.styleSheets +PASS Stringification of document.styleSheets +PASS StyleSheetList interface: document.styleSheets must inherit property "item(unsigned long)" with the proper type +PASS StyleSheetList interface: calling item(unsigned long) on document.styleSheets with too few arguments must throw TypeError +PASS StyleSheetList interface: document.styleSheets must inherit property "length" with the proper type +PASS CSSRuleList interface: existence and properties of interface object +PASS CSSRuleList interface object length +PASS CSSRuleList interface object name +PASS CSSRuleList interface: existence and properties of interface prototype object +PASS CSSRuleList interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRuleList interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRuleList interface: operation item(unsigned long) +PASS CSSRuleList interface: attribute length +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type +PASS CSSRule interface: existence and properties of interface object +PASS CSSRule interface object length +PASS CSSRule interface object name +PASS CSSRule interface: existence and properties of interface prototype object +PASS CSSRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSRule interface: constant STYLE_RULE on interface object +PASS CSSRule interface: constant STYLE_RULE on interface prototype object +PASS CSSRule interface: constant CHARSET_RULE on interface object +PASS CSSRule interface: constant CHARSET_RULE on interface prototype object +PASS CSSRule interface: constant IMPORT_RULE on interface object +PASS CSSRule interface: constant IMPORT_RULE on interface prototype object +PASS CSSRule interface: constant MEDIA_RULE on interface object +PASS CSSRule interface: constant MEDIA_RULE on interface prototype object +PASS CSSRule interface: constant FONT_FACE_RULE on interface object +PASS CSSRule interface: constant FONT_FACE_RULE on interface prototype object +PASS CSSRule interface: constant PAGE_RULE on interface object +PASS CSSRule interface: constant PAGE_RULE on interface prototype object +FAIL CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing +FAIL CSSRule interface: constant MARGIN_RULE on interface prototype object assert_own_property: expected property "MARGIN_RULE" missing +PASS CSSRule interface: constant NAMESPACE_RULE on interface object +PASS CSSRule interface: constant NAMESPACE_RULE on interface prototype object +PASS CSSRule interface: attribute type +PASS CSSRule interface: attribute cssText +PASS CSSRule interface: attribute parentRule +PASS CSSRule interface: attribute parentStyleSheet +PASS CSSStyleRule interface: existence and properties of interface object +PASS CSSStyleRule interface object length +PASS CSSStyleRule interface object name +PASS CSSStyleRule interface: existence and properties of interface prototype object +PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleRule interface: attribute selectorText +PASS CSSStyleRule interface: attribute style +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule interface: existence and properties of interface object +PASS CSSImportRule interface object length +PASS CSSImportRule interface object name +PASS CSSImportRule interface: existence and properties of interface prototype object +PASS CSSImportRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSImportRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSImportRule interface: attribute href +PASS CSSImportRule interface: attribute media +PASS CSSImportRule interface: attribute styleSheet +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSGroupingRule interface: existence and properties of interface object +PASS CSSGroupingRule interface object length +PASS CSSGroupingRule interface object name +PASS CSSGroupingRule interface: existence and properties of interface prototype object +PASS CSSGroupingRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSGroupingRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSGroupingRule interface: attribute cssRules +FAIL CSSGroupingRule interface: operation insertRule(CSSOMString, unsigned long) assert_equals: property has wrong .length expected 1 but got 2 +PASS CSSGroupingRule interface: operation deleteRule(unsigned long) +FAIL CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" +PASS CSSPageRule interface object length +PASS CSSPageRule interface object name +FAIL CSSPageRule interface: existence and properties of interface prototype object assert_equals: prototype of CSSPageRule.prototype is not CSSGroupingRule.prototype expected object "[object CSSGroupingRule]" but got object "[object CSSRule]" +PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSPageRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSPageRule interface: attribute selectorText +PASS CSSPageRule interface: attribute style +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSNamespaceRule interface: existence and properties of interface object +PASS CSSNamespaceRule interface object length +PASS CSSNamespaceRule interface object name +PASS CSSNamespaceRule interface: existence and properties of interface prototype object +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's "constructor" property +PASS CSSNamespaceRule interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSNamespaceRule interface: attribute namespaceURI +PASS CSSNamespaceRule interface: attribute prefix +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleDeclaration interface: existence and properties of interface object +PASS CSSStyleDeclaration interface object length +PASS CSSStyleDeclaration interface object name +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's "constructor" property +PASS CSSStyleDeclaration interface: existence and properties of interface prototype object's @@unscopables property +PASS CSSStyleDeclaration interface: attribute cssText +PASS CSSStyleDeclaration interface: attribute length +PASS CSSStyleDeclaration interface: operation item(unsigned long) +PASS CSSStyleDeclaration interface: operation getPropertyValue(CSSOMString) +PASS CSSStyleDeclaration interface: operation getPropertyPriority(CSSOMString) +PASS CSSStyleDeclaration interface: operation setProperty(CSSOMString, CSSOMString, CSSOMString) +PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) +PASS CSSStyleDeclaration interface: attribute parentRule +PASS CSSStyleDeclaration interface: attribute cssFloat +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of style_element.style +PASS Stringification of style_element.style +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of svg_element.style +PASS Stringification of svg_element.style +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) +PASS Stringification of getComputedStyle(svg_element) +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS Document interface: attribute styleSheets +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ShadowRoot interface: attribute styleSheets +PASS ProcessingInstruction interface: attribute sheet +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win7/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/win7/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt index 78381b7..4beb5c1 100644 --- a/third_party/blink/web_tests/platform/win7/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win7/external/wpt/wake-lock/idlharness.https.any.worker-expected.txt
@@ -7,17 +7,11 @@ FAIL WakeLock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock interface: member requestPermission Cannot use 'in' operator to search for 'requestPermission' in undefined -FAIL WakeLock interface: attribute type assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute active assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: attribute onactivechange assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing -FAIL WakeLock interface: operation request(WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing +FAIL WakeLock interface: operation request(WakeLockType, WakeLockRequestOptions) assert_own_property: self does not have own property "WakeLock" expected property "WakeLock" missing FAIL WakeLock must be primary interface of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL Stringification of new WakeLock("screen") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" FAIL WakeLock interface: new WakeLock("screen") must not have property "requestPermission" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "active" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "onactivechange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" -FAIL WakeLock interface: calling request(WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: new WakeLock("screen") must inherit property "request(WakeLockType, WakeLockRequestOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" +FAIL WakeLock interface: calling request(WakeLockType, WakeLockRequestOptions) on new WakeLock("screen") with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WakeLock is not defined" Harness: the test ran to completion.
diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto_library.gni index 5c4ffa01..0e90809 100644 --- a/third_party/protobuf/proto_library.gni +++ b/third_party/protobuf/proto_library.gni
@@ -209,6 +209,7 @@ protos = rebase_path(invoker.sources, proto_in_dir) protogens = [] + protogens_cc = [] # List output files. foreach(proto, protos) { @@ -217,7 +218,7 @@ proto_path = proto_dir + "/" + proto_name if (generate_cc) { - protogens += [ + protogens_cc += [ "$cc_out_dir/$proto_path.pb.h", "$cc_out_dir/$proto_path.pb.cc", ] @@ -227,7 +228,7 @@ } if (generate_with_plugin) { foreach(suffix, generator_plugin_suffixes) { - protogens += [ "$cc_out_dir/${proto_path}${suffix}" ] + protogens_cc += [ "$cc_out_dir/${proto_path}${suffix}" ] } } } @@ -240,7 +241,7 @@ visibility = [ ":$source_set_name" ] script = "//tools/protoc_wrapper/protoc_wrapper.py" sources = proto_sources - outputs = get_path_info(protogens, "abspath") + outputs = get_path_info(protogens + protogens_cc, "abspath") args = protos protoc_label = "//third_party/protobuf:protoc($host_toolchain)" @@ -366,7 +367,7 @@ "visibility", ]) - sources = get_target_outputs(":$action_name") + sources = get_path_info(protogens_cc, "abspath") if (defined(invoker.remove_configs)) { configs -= invoker.remove_configs
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index e0f5810..cdcfe711 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -3184,18 +3184,31 @@ </action> <action name="BookmarkBar_ContextMenu_OpenAll"> - <owner>Please list the metric's owners. Add more owner tags as needed.</owner> - <description>Please enter the description of this user action.</description> + <owner>dfried@chromium.org</owner> + <description> + The user opened one or more bookmarks in the Bookmarks Bar using the context + menu. Distinguished from launching from e.g. the application menu or the + bookmark manager. This is for opening bookmarks normally (in the same + window). + </description> </action> <action name="BookmarkBar_ContextMenu_OpenAllIncognito"> - <owner>Please list the metric's owners. Add more owner tags as needed.</owner> - <description>Please enter the description of this user action.</description> + <owner>dfried@chromium.org</owner> + <description> + The user opened one or more bookmarks in the Bookmarks Bar using the context + menu. Distinguished from launching from e.g. the application menu or the + bookmark manager. This is for opening bookmarks in an incognito window. + </description> </action> <action name="BookmarkBar_ContextMenu_OpenAllInNewWindow"> - <owner>Please list the metric's owners. Add more owner tags as needed.</owner> - <description>Please enter the description of this user action.</description> + <owner>dfried@chromium.org</owner> + <description> + The user opened one or more bookmarks in the Bookmarks Bar using the context + menu. Distinguished from launching from e.g. the application menu or the + bookmark manager. This is for opening bookmarks in a new window. + </description> </action> <action name="BookmarkBar_ContextMenu_OpenInNewTab"> @@ -21800,6 +21813,34 @@ <description>Please enter the description of this user action.</description> </action> +<action name="WrenchMenu_Bookmarks_ContextMenu_OpenAll"> + <owner>dfried@chromium.org</owner> + <description> + The user opened one or more bookmarks in the Bookmarks Bar using the context + menu. Distinguished from launching from e.g. the application menu or the + bookmark manager. This is for opening bookmarks normally (in the same + window). + </description> +</action> + +<action name="WrenchMenu_Bookmarks_ContextMenu_OpenAllIncognito"> + <owner>dfried@chromium.org</owner> + <description> + The user opened one or more bookmarks in the Bookmarks Bar using the context + menu. Distinguished from launching from e.g. the application menu or the + bookmark manager. This is for opening bookmarks in an incognito window. + </description> +</action> + +<action name="WrenchMenu_Bookmarks_ContextMenu_OpenAllInNewWindow"> + <owner>dfried@chromium.org</owner> + <description> + The user opened one or more bookmarks in the Bookmarks Bar using the context + menu. Distinguished from launching from e.g. the application menu or the + bookmark manager. This is for opening bookmarks in a new window. + </description> +</action> + <action name="WrenchMenu_Bookmarks_LaunchURL"> <owner>dfried@chromium.org</owner> <description>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index df25617..8a2e264 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -6551,6 +6551,7 @@ <int value="21" label="RenderPassDrawQuad has unconvertable filters."/> <int value="22" label="RenderPassDrawQuad has a sorting context id."/> <int value="23" label="Too many RenderPassDrawQuads."/> + <int value="24" label="Unsupported rounded corner rect."/> </enum> <enum name="CanMakePaymentUsage"> @@ -7070,6 +7071,19 @@ <int value="2" label="First service disabled"/> </enum> +<enum name="ChromeOSCameraErrorType"> + <int value="1" label="Device"/> + <int value="2" label="Request"/> + <int value="3" label="Result"/> + <int value="4" label="Buffer"/> +</enum> + +<enum name="ChromeOSCameraFacing"> + <int value="0" label="Back"/> + <int value="1" label="Front"/> + <int value="2" label="External"/> +</enum> + <enum name="ChromeOSColorProfile"> <summary>See ui/display/display_constants.h for the variation.</summary> <int value="0" label="Standard"/> @@ -9365,6 +9379,7 @@ <int value="37" label="Share link"/> <int value="38" label="Sneak peek (Ephemeral tab)"/> <int value="39" label="Sneak peek for image (Ephemeral tab)"/> + <int value="40" label="Go to URL"/> </enum> <enum name="ContextMenuSaveImage"> @@ -29509,6 +29524,14 @@ <int value="4" label="Script"/> </enum> +<enum name="InlineUpdateAvailability"> + <int value="0" label="Untracked (Not Known to UMA)"/> + <int value="1" label="Unknown"/> + <int value="2" label="Update Not Available"/> + <int value="3" label="Update Available"/> + <int value="4" label="Developer Triggered Update In Progress"/> +</enum> + <enum name="InlineUpdateCallFailure"> <int value="0" label="StartUpdate Failed"/> <int value="1" label="StartUpdate Exception"/> @@ -29529,6 +29552,19 @@ <int value="9" label="Error - Untracked (Not Known to UMA)"/> </enum> +<enum name="InlineUpdateInstallStatus"> + <int value="0" label="Untracked (Not Known to UMA)"/> + <int value="1" label="Unknown"/> + <int value="2" label="Requires UI Intent"/> + <int value="3" label="Pending"/> + <int value="4" label="Downloading"/> + <int value="5" label="Downloaded"/> + <int value="6" label="Installing"/> + <int value="7" label="Installed"/> + <int value="8" label="Failed"/> + <int value="9" label="Canceled"/> +</enum> + <enum name="InputMethodCategory"> <int value="0" label="Unkown"/> <int value="1" label="XKB">XKeyboard</int>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 9014e8c..d096ac5 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -4333,6 +4333,18 @@ </summary> </histogram> +<histogram name="Apps.AppListSuggestedChipOpenType" enum="AppListSearchResult" + expires_after="2020-01-01"> +<!-- Name completed by histogram_suffixes name="TabletOrClamshellMode" --> + + <owner>newcomer@chromium.org</owner> + <owner>mmourgos@chromium.org</owner> + <summary> + The type of app list suggestion chip that was opened by the user. This is + gathered per SuggestionChip opened. + </summary> +</histogram> + <histogram name="Apps.AppListTileLaunchIndexAndQueryLength"> <owner>tby@chromium.org</owner> <owner>jiameng@chromium.org</owner> @@ -16650,6 +16662,93 @@ </summary> </histogram> +<histogram base="true" + name="ChromeOS.Camera.ConfigureStreams.Output.Resolution" units="pixels" + expires_after="2019-10-25"> +<!-- Name completed by histogram_suffixes + name="ChromeOS.Camera.StreamFormat" --> + + <owner>wtlee@chromium.org</owner> + <summary> + Records the resolution of output stream that is configured by Chrome OS + camera service. + </summary> +</histogram> + +<histogram name="ChromeOS.Camera.ConfigureStreamsLatency" units="microseconds" + expires_after="2019-10-25"> + <owner>wtlee@chromium.org</owner> + <summary> + Records the process time of ConfigureStreams() method in Chrome OS camera + service. + </summary> +</histogram> + +<histogram name="ChromeOS.Camera.ErrorType" enum="ChromeOSCameraErrorType" + expires_after="2019-10-25"> + <owner>wtlee@chromium.org</owner> + <summary> + Records the type of the error which triggers the Notify() method in Chrome + OS camera service. + </summary> +</histogram> + +<histogram name="ChromeOS.Camera.Facing" enum="ChromeOSCameraFacing" + expires_after="2019-10-25"> + <owner>wtlee@chromium.org</owner> + <summary> + Records the camera facing of the camera session in Chrome OS camera service. + </summary> +</histogram> + +<histogram base="true" name="ChromeOS.Camera.Jpeg.Latency" units="microseconds" + expires_after="2019-10-25"> +<!-- Name completed by histogram_suffixes + name="ChromeOS.Camera.JpegProcessMethod" --> + +<!-- Name completed by histogram_suffixes + name="ChromeOS.Camera.JpegProcessType" --> + + <owner>wtlee@chromium.org</owner> + <summary> + Records the process time of the JDA (Jpeg Decode Accelerator) or JEA (Jpeg + Encode Accelerator) run on Chrome OS camera service. There are suffixes that + record the runner method (hardware/software), the runner type + (decode/encode). + </summary> +</histogram> + +<histogram base="true" name="ChromeOS.Camera.Jpeg.Resolution" units="pixels" + expires_after="2019-10-25"> +<!-- Name completed by histogram_suffixes + name="ChromeOS.Camera.JpegProcessMethod" --> + +<!-- Name completed by histogram_suffixes + name="ChromeOS.Camera.JpegProcessType" --> + + <owner>wtlee@chromium.org</owner> + <summary> + Records the resolution of the image that JDA/JEA process by Chrome OS camera + service. The resolution represents by the total pixels contained in the + image. There are suffixes that record the runner method (hardware/software), + the runner type (decode/encode). + </summary> +</histogram> + +<histogram name="ChromeOS.Camera.OpenDeviceLatency" units="microseconds" + expires_after="2019-10-25"> + <owner>wtlee@chromium.org</owner> + <summary> + Records the process time of OpenDevice() method in Chrome OS camera service. + </summary> +</histogram> + +<histogram name="ChromeOS.Camera.SessionDuration" units="seconds" + expires_after="2019-10-25"> + <owner>wtlee@chromium.org</owner> + <summary>Records the session duration in Chrome OS camera service.</summary> +</histogram> + <histogram name="ChromeOS.CWP.CollectHeap" enum="ChromeOSProfileCollectionStatus" expires_after="2020-02-01"> <owner>aalexand@google.com</owner> @@ -17580,6 +17679,11 @@ </histogram> <histogram name="Compositing.Browser.CachedImagesCount" units="count"> + <obsolete> + Deprecated 05/2019 because it no longer reports. To be superseded by a + measurement related to percentage of cache/discardable memory used by image + caching. + </obsolete> <owner>vmpstr@chromium.org</owner> <summary> The maximum number of images that were cached in the browser over the @@ -18083,6 +18187,11 @@ </histogram> <histogram name="Compositing.Renderer.CachedImagesCount" units="count"> + <obsolete> + Deprecated 05/2019 because it no longer reports. To be superseded by a + measurement related to percentage of cache/discardable memory used by image + caching. + </obsolete> <owner>vmpstr@chromium.org</owner> <summary> The maximum number of images that were cached in the renderer over the @@ -42840,6 +42949,26 @@ </summary> </histogram> +<histogram name="GoogleUpdate.Inline.AppUpdateInfo.InstallStatus" + enum="InlineUpdateInstallStatus" expires_after="2019-10-30"> + <owner>dtrainor@chromium.org</owner> + <owner>nyquist@chromium.org</owner> + <summary> + (Android-only) Records the instances where Play update API returned the + current install status of inline updates. + </summary> +</histogram> + +<histogram name="GoogleUpdate.Inline.AppUpdateInfo.UpdateAvailability" + enum="InlineUpdateAvailability" expires_after="2019-10-30"> + <owner>dtrainor@chromium.org</owner> + <owner>nyquist@chromium.org</owner> + <summary> + (Android-only) Records the instances where Play update API returned the + current availability of inline updates. + </summary> +</histogram> + <histogram name="GoogleUpdate.Inline.CallFailure" enum="InlineUpdateCallFailure" expires_after="2019-10-30"> <owner>dtrainor@chromium.org</owner> @@ -95539,6 +95668,17 @@ </summary> </histogram> +<histogram name="PluginVm.Image.DownloadedSize" units="MB" + expires_after="2019-12-01"> + <owner>aoldemeier@chromium.org</owner> + <owner>okalitova@chromium.org</owner> + <owner>timloh@chromium.org</owner> + <summary> + The size of the PluginVm image downloaded in MB. Recorded each time PluginVm + image is sucessfully downloaded. + </summary> +</histogram> + <histogram name="Power.BacklightLevelOnAC" units="%"> <owner>derat@chromium.org</owner> <summary> @@ -144523,7 +144663,8 @@ <histogram name="XHR.Sync.PageDismissal_forbidden" enum="XHRPageDismissalState" expires_after="2019-06-01"> - <owner>kdillon@chromium.org, panicker@chromium.org</owner> + <owner>kdillon@chromium.org</owner> + <owner>panicker@chromium.org</owner> <summary> Records occurence of sync XHR requests during page dismissal state (unload, beforeunload, pagehide etc) that were forbidden. @@ -146298,6 +146439,35 @@ name="ServiceWorker.ActivatedWorkerPreparationForMainFrame.Type"/> </histogram_suffixes> +<histogram_suffixes name="ChromeOS.Camera.JpegProcessMethod" separator="."> + <suffix name="Hardware"/> + <suffix name="Software"/> + <affected-histogram name="ChromeOS.Camera.Jpeg.Latency"/> + <affected-histogram name="ChromeOS.Camera.Jpeg.Resolution"/> +</histogram_suffixes> + +<histogram_suffixes name="ChromeOS.Camera.JpegProcessType" separator="."> + <suffix name="Decode"/> + <suffix name="Encode"/> + <affected-histogram name="ChromeOS.Camera.Jpeg.Latency"/> + <affected-histogram name="ChromeOS.Camera.Jpeg.Resolution"/> +</histogram_suffixes> + +<histogram_suffixes name="ChromeOS.Camera.StreamFormat" separator="."> + <suffix name="BGRA_8888" label="Format HAL_PIXEL_FORMAT_BGRA_8888"/> + <suffix name="BLOB" label="Format HAL_PIXEL_FORMAT_BLOB"/> + <suffix name="IMPLEMENTATION_DEFINED" + label="Format HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED"/> + <suffix name="RGBA_8888" label="Format HAL_PIXEL_FORMAT_RGBA_8888"/> + <suffix name="RGBX_8888" label="Format HAL_PIXEL_FORMAT_RGBX_8888"/> + <suffix name="YCbCr_420_888" label="Format HAL_PIXEL_FORMAT_YCbCr_420_888"/> + <suffix name="YCbCr_422_I" label="Format HAL_PIXEL_FORMAT_YCbCr_422_I"/> + <suffix name="YCrCb_420_SP" label="Format HAL_PIXEL_FORMAT_YCrCb_420_SP"/> + <suffix name="YV12" label="Format HAL_PIXEL_FORMAT_YV12"/> + <affected-histogram + name="ChromeOS.Camera.ConfigureStreams.Output.Resolution"/> +</histogram_suffixes> + <histogram_suffixes name="ChromeOS.MachineIdRegen.AgeSeconds" separator="_"> <suffix name="Network"/> <suffix name="Periodic"/> @@ -158147,6 +158317,7 @@ <affected-histogram name="Apps.AppListSearchBoxActivated"/> <affected-histogram name="Apps.AppListSearchQueryLength"/> <affected-histogram name="Apps.AppListSearchResultOpenTypeV2"/> + <affected-histogram name="Apps.AppListSuggestedChipOpenType"/> <affected-histogram name="Apps.ContextMenuExecuteCommand.FromApp"/> <affected-histogram name="Apps.ContextMenuExecuteCommand.NotFromApp"/> <affected-histogram name="Apps.ContextMenuShowSource.AppGrid"/>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 59a589e..417a24c 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -3346,6 +3346,61 @@ <metric name="Length"/> </event> +<event name="Media.Learning.PredictionRecord"> + <owner>liberato@chromium.org</owner> + <summary> + A record of some predicted value vs. an observation. If the prediction is + for a regression-style task (e.g., "predict a number" rather than + "predict an enum value"), then the predicted and observed values + are the numeric values, scaled by default to be in the integer range 0-100. + + The exact scaling used depends on the particular regression problem. Please + see the LearningTask structure for the task of interest to find out how it + maps values into the [0, 100] output range. + + A record is created for every prediction separately. + + For example, in the MediaCapabilities experiments, each playback generates a + record. The predicted / observed values are the ratio of dropped to decoded + frames, expressed as a percentage scaled to 0-100. + </summary> + <metric name="LearningTask"> + <summary> + The learning task to which this record applies. This is a persistent hash + of the |name| field in the LearningTask. Presumably, you'll want to + include only records of a particular task when analyzing results. + </summary> + </metric> + <metric name="ObservedValue"> + <summary> + Observed value for this sample, scaled into the range [0, 100]. The exact + scaling factor depends on the particular task. + + MediaCapabilities, for example, reports 100 * percentage_of_dropped_frames + in this field. + </summary> + </metric> + <metric name="PredictedValue"> + <summary> + Predicted value for this sample, scaled into the range [0, 100]. The exact + scaling factor depends on the particular task. + + MediaCapabilities, for example, reports 100 * percentage_of_dropped_frames + in this field. + </summary> + </metric> + <metric name="TrainingDataSize"> + <summary> + Number of training examples that were used to train this model. + </summary> + </metric> + <metric name="TrainingDataTotalWeight"> + <summary> + Total weight of all examples that were used to train this model. + </summary> + </metric> +</event> + <event name="Media.SiteMuted" singular="True"> <owner>steimel@chromium.org</owner> <owner>media-dev@chromium.org</owner>
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index 87e274d..33822472c 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -41,10 +41,15 @@ # Benchmark: blink_perf.css crbug.com/891878 [ Nexus5X_Webview ] blink_perf.css/CustomPropertiesVarAlias.html [ Skip ] +# Benchmark: blink_perf.events +crbug.com/963945 [ Nexus5X_Webview ] blink_perf.events/EventsDispatchingInDeeplyNestedV0ShadowTrees.html [ Skip ] +crbug.com/963945 [ Nexus5X_Webview ] blink_perf.events/EventsDispatchingInDeeplyNestedV1ShadowTrees.html [ Skip ] + # Benchmark: blink_perf.layout crbug.com/551950 [ Android_Svelte ] blink_perf.layout/* [ Skip ] crbug.com/832686 [ Nexus_5 ] blink_perf.layout/subtree-detaching.html [ Skip ] crbug.com/910207 [ Nexus_5X ] blink_perf.layout/subtree-detaching.html [ Skip ] +crbug.com/963967 [ Android_Webview ] blink_perf.layout/line-layout-fit-content.html [ Skip ] # Benchmark: blink_perf.paint crbug.com/574483 [ Android_Svelte ] blink_perf.paint/* [ Skip ] @@ -327,7 +332,7 @@ crbug.com/954959 [ Linux ] v8.browsing_desktop/browse:media:pinterest:2018 [ Skip ] crbug.com/954959 [ Linux ] v8.browsing_desktop/browse:tools:maps [ Skip ] crbug.com/958422 [ All ] v8.browsing_desktop/browse:social:tumblr_infinite_scroll:2018 [ Skip ] -crbug.com/958507 [ Mac ] v8.browsing_desktop/browse:media:imgur [ Skip ] +crbug.com/958507 [ Desktop ] v8.browsing_desktop/browse:media:imgur [ Skip ] # Benchmark v8.browsing_desktop-future crbug.com/788796 [ Linux ] v8.browsing_desktop-future/browse:media:imgur [ Skip ] @@ -336,7 +341,7 @@ crbug.com/906654 [ All ] v8.browsing_desktop-future/browse:search:google [ Skip ] crbug.com/953371 [ Win ] v8.browsing_desktop-future/browse:social:twitter_infinite_scroll:2018 [ Skip ] crbug.com/958422 [ All ] v8.browsing_desktop-future/browse:social:tumblr_infinite_scroll:2018 [ Skip ] -crbug.com/958507 [ Mac ] v8.browsing_desktop-future/browse:media:imgur [ Skip ] +crbug.com/958507 [ Desktop ] v8.browsing_desktop-future/browse:media:imgur [ Skip ] # Benchmark: v8.browsing_mobile crbug.com/958034 [ Android_Go_Webview ] v8.browsing_mobile/* [ Skip ]
diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc index 9fdcf7f3..ac77107 100644 --- a/ui/aura/window_tree_host.cc +++ b/ui/aura/window_tree_host.cc
@@ -402,7 +402,7 @@ base::ThreadTaskRunnerHandle::Get(), ui::IsPixelCanvasRecordingEnabled(), external_begin_frame_client, force_software_compositor, trace_environment_name); -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || defined(USE_X11) compositor_->AddObserver(this); #endif if (!dispatcher()) {
diff --git a/ui/base/clipboard/clipboard_format_type.h b/ui/base/clipboard/clipboard_format_type.h index 089a45c..07d8e08 100644 --- a/ui/base/clipboard/clipboard_format_type.h +++ b/ui/base/clipboard/clipboard_format_type.h
@@ -113,7 +113,9 @@ // type. static std::map<LONG, ClipboardFormatType>& GetFileContentTypeMap(); - FORMATETC data_{}; + // FORMATETC: + // https://docs.microsoft.com/en-us/windows/desktop/com/the-formatetc-structure + FORMATETC data_; #elif defined(USE_AURA) || defined(OS_ANDROID) || defined(OS_FUCHSIA) explicit ClipboardFormatType(const std::string& native_format); std::string data_;
diff --git a/ui/base/clipboard/clipboard_format_type_win.cc b/ui/base/clipboard/clipboard_format_type_win.cc index c477acb..bb242e0 100644 --- a/ui/base/clipboard/clipboard_format_type_win.cc +++ b/ui/base/clipboard/clipboard_format_type_win.cc
@@ -23,16 +23,13 @@ ClipboardFormatType::ClipboardFormatType(UINT native_format, LONG index) : ClipboardFormatType(native_format, index, TYMED_HGLOBAL) {} +// In C++ 20, we can use designated initializers. ClipboardFormatType::ClipboardFormatType(UINT native_format, LONG index, - DWORD tymed) { - // There's no good way to actually initialize this in the constructor in - // C++14. In C++ 20, we can use designated initializers. - data_.cfFormat = static_cast<CLIPFORMAT>(native_format); - data_.dwAspect = DVASPECT_CONTENT; - data_.lindex = index; - data_.tymed = tymed; -} + DWORD tymed) + : data_{/* .cfFormat */ static_cast<CLIPFORMAT>(native_format), + /* .ptd */ nullptr, /* .dwAspect */ DVASPECT_CONTENT, + /* .lindex */ index, /* .tymed*/ tymed} {} ClipboardFormatType::~ClipboardFormatType() = default;
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc index 7a10483..544d5fdb 100644 --- a/ui/base/x/x11_util.cc +++ b/ui/base/x/x11_util.cc
@@ -1299,6 +1299,14 @@ return icc_profile; } +bool IsSyncExtensionAvailable() { + auto* display = gfx::GetXDisplay(); + int unused; + static bool result = XSyncQueryExtension(display, &unused, &unused) && + XSyncInitialize(display, &unused, &unused); + return result; +} + XRefcountedMemory::XRefcountedMemory(unsigned char* x11_data, size_t length) : x11_data_(length ? x11_data : nullptr), length_(length) { }
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h index ee36758..daf755e 100644 --- a/ui/base/x/x11_util.h +++ b/ui/base/x/x11_util.h
@@ -301,6 +301,9 @@ // Returns the ICCProfile corresponding to |monitor| using XGetWindowProperty. UI_BASE_X_EXPORT gfx::ICCProfile GetICCProfileForMonitor(int monitor); +// Return true if the display supports SYNC extension. +UI_BASE_X_EXPORT bool IsSyncExtensionAvailable(); + // Manages a piece of X11 allocated memory as a RefCountedMemory segment. This // object takes ownership over the passed in memory and will free it with the // X11 allocator when done.
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index d101328..8bd8f200 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc
@@ -707,6 +707,13 @@ NOTREACHED(); } +#if defined(USE_X11) +void Compositor::OnCompleteSwapWithNewSize(const gfx::Size& size) { + for (auto& observer : observer_list_) + observer.OnCompositingCompleteSwapWithNewSize(this, size); +} +#endif + void Compositor::SetOutputIsSecure(bool output_is_secure) { if (context_factory_private_) context_factory_private_->SetOutputIsSecure(this, output_is_secure);
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h index d1352c0..ce87db9 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h
@@ -425,6 +425,10 @@ void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override; void OnFrameTokenChanged(uint32_t frame_token) override; +#if defined(USE_X11) + void OnCompleteSwapWithNewSize(const gfx::Size& size); +#endif + bool IsLocked() { return lock_manager_.IsLocked(); } void SetOutputIsSecure(bool output_is_secure);
diff --git a/ui/compositor/compositor_observer.h b/ui/compositor/compositor_observer.h index 5745c3cb..a67c005 100644 --- a/ui/compositor/compositor_observer.h +++ b/ui/compositor/compositor_observer.h
@@ -8,6 +8,10 @@ #include "base/time/time.h" #include "ui/compositor/compositor_export.h" +namespace gfx { +class Size; +} + namespace viz { class LocalSurfaceIdAllocation; } @@ -41,6 +45,12 @@ // Called when a child of the compositor is resizing. virtual void OnCompositingChildResizing(Compositor* compositor) {} +#if defined(USE_X11) + // Called when a swap with new size is completed. + virtual void OnCompositingCompleteSwapWithNewSize(ui::Compositor* compositor, + const gfx::Size& size) {} +#endif + // Called at the top of the compositor's destructor, to give observers a // chance to remove themselves. virtual void OnCompositingShuttingDown(Compositor* compositor) {}
diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc index f8b1e4b..0ff1e052 100644 --- a/ui/compositor/host/host_context_factory_private.cc +++ b/ui/compositor/host/host_context_factory_private.cc
@@ -28,7 +28,38 @@ namespace ui { namespace { + static const char* kBrowser = "Browser"; + +#if defined(USE_X11) +class HostDisplayClient : public viz::HostDisplayClient { + public: + explicit HostDisplayClient(ui::Compositor* compositor) + : viz::HostDisplayClient(compositor->widget()), compositor_(compositor) {} + ~HostDisplayClient() override = default; + + // viz::HostDisplayClient: + void DidCompleteSwapWithNewSize(const gfx::Size& size) override { + compositor_->OnCompleteSwapWithNewSize(size); + } + + private: + ui::Compositor* const compositor_; + + DISALLOW_COPY_AND_ASSIGN(HostDisplayClient); +}; +#else +class HostDisplayClient : public viz::HostDisplayClient { + public: + explicit HostDisplayClient(ui::Compositor* compositor) + : viz::HostDisplayClient(compositor->widget()) {} + ~HostDisplayClient() override = default; + + private: + DISALLOW_COPY_AND_ASSIGN(HostDisplayClient); +}; +#endif + } // namespace HostContextFactoryPrivate::HostContextFactoryPrivate( @@ -58,11 +89,9 @@ gfx::RenderingWindowManager::GetInstance()->RegisterParent( compositor->widget()); #endif - auto& compositor_data = compositor_data_map_[compositor]; auto root_params = viz::mojom::RootCompositorFrameSinkParams::New(); - // Create interfaces for a root CompositorFrameSink. viz::mojom::CompositorFrameSinkAssociatedPtrInfo sink_info; root_params->compositor_frame_sink = mojo::MakeRequest(&sink_info); @@ -71,7 +100,7 @@ root_params->display_private = mojo::MakeRequest(&compositor_data.display_private); compositor_data.display_client = - std::make_unique<viz::HostDisplayClient>(compositor->widget()); + std::make_unique<HostDisplayClient>(compositor); root_params->display_client = compositor_data.display_client->GetBoundPtr(resize_task_runner_) .PassInterface();
diff --git a/ui/display/manager/apply_content_protection_task_unittest.cc b/ui/display/manager/apply_content_protection_task_unittest.cc index d3088f08..a179ada 100644 --- a/ui/display/manager/apply_content_protection_task_unittest.cc +++ b/ui/display/manager/apply_content_protection_task_unittest.cc
@@ -23,11 +23,12 @@ namespace { +constexpr int64_t kDisplayId = 1; + std::unique_ptr<DisplaySnapshot> CreateDisplaySnapshot( - int64_t id, DisplayConnectionType type) { return FakeDisplaySnapshot::Builder() - .SetId(id) + .SetId(kDisplayId) .SetNativeMode(gfx::Size(1024, 768)) .SetType(type) .Build(); @@ -55,8 +56,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToInternalDisplay) { std::vector<std::unique_ptr<DisplaySnapshot>> displays; - displays.push_back( - CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_INTERNAL)); + displays.push_back(CreateDisplaySnapshot(DISPLAY_CONNECTION_TYPE_INTERNAL)); TestDisplayLayoutManager layout_manager(std::move(displays), MULTIPLE_DISPLAY_STATE_SINGLE); @@ -74,7 +74,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToExternalDisplay) { std::vector<std::unique_ptr<DisplaySnapshot>> displays; - displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); + displays.push_back(CreateDisplaySnapshot(DISPLAY_CONNECTION_TYPE_HDMI)); TestDisplayLayoutManager layout_manager(std::move(displays), MULTIPLE_DISPLAY_STATE_SINGLE); @@ -87,17 +87,13 @@ task.Run(); EXPECT_EQ(Response::SUCCESS, response_); - EXPECT_EQ( - JoinActions(GetSetHDCPStateAction(*layout_manager.GetDisplayStates()[0], - HDCP_STATE_DESIRED) - .c_str(), - NULL), - log_.GetActionsAndClear()); + EXPECT_EQ(GetSetHDCPStateAction(kDisplayId, HDCP_STATE_DESIRED).c_str(), + log_.GetActionsAndClear()); } TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToUnknownDisplay) { std::vector<std::unique_ptr<DisplaySnapshot>> displays; - displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_UNKNOWN)); + displays.push_back(CreateDisplaySnapshot(DISPLAY_CONNECTION_TYPE_UNKNOWN)); TestDisplayLayoutManager layout_manager(std::move(displays), MULTIPLE_DISPLAY_STATE_SINGLE); @@ -115,7 +111,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToDisplayThatCannotGetHdcp) { std::vector<std::unique_ptr<DisplaySnapshot>> displays; - displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); + displays.push_back(CreateDisplaySnapshot(DISPLAY_CONNECTION_TYPE_HDMI)); TestDisplayLayoutManager layout_manager(std::move(displays), MULTIPLE_DISPLAY_STATE_SINGLE); display_delegate_.set_get_hdcp_state_expectation(false); @@ -134,7 +130,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToDisplayThatCannotSetHdcp) { std::vector<std::unique_ptr<DisplaySnapshot>> displays; - displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); + displays.push_back(CreateDisplaySnapshot(DISPLAY_CONNECTION_TYPE_HDMI)); TestDisplayLayoutManager layout_manager(std::move(displays), MULTIPLE_DISPLAY_STATE_SINGLE); display_delegate_.set_set_hdcp_state_expectation(false); @@ -148,17 +144,13 @@ task.Run(); EXPECT_EQ(Response::FAILURE, response_); - EXPECT_EQ( - JoinActions(GetSetHDCPStateAction(*layout_manager.GetDisplayStates()[0], - HDCP_STATE_DESIRED) - .c_str(), - NULL), - log_.GetActionsAndClear()); + EXPECT_EQ(GetSetHDCPStateAction(kDisplayId, HDCP_STATE_DESIRED).c_str(), + log_.GetActionsAndClear()); } TEST_F(ApplyContentProtectionTaskTest, ApplyNoProtectionToExternalDisplay) { std::vector<std::unique_ptr<DisplaySnapshot>> displays; - displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); + displays.push_back(CreateDisplaySnapshot(DISPLAY_CONNECTION_TYPE_HDMI)); TestDisplayLayoutManager layout_manager(std::move(displays), MULTIPLE_DISPLAY_STATE_SINGLE); display_delegate_.set_hdcp_state(HDCP_STATE_UNDESIRED);
diff --git a/ui/display/manager/display_configurator_unittest.cc b/ui/display/manager/display_configurator_unittest.cc index 26d74e8..13934ac 100644 --- a/ui/display/manager/display_configurator_unittest.cc +++ b/ui/display/manager/display_configurator_unittest.cc
@@ -261,9 +261,10 @@ uint32_t connection_mask, uint32_t protection_mask) { query_content_protection_success_ = success; - query_content_protection_connection_mask_ = connection_mask; - query_content_protection_protection_mask_ = protection_mask; query_content_protection_call_count_++; + + connection_mask_ = connection_mask; + protection_mask_ = protection_mask; } // Predefined modes that can be used by outputs. @@ -340,8 +341,8 @@ int apply_content_protection_call_count_ = 0; bool query_content_protection_success_ = false; int query_content_protection_call_count_ = 0; - uint32_t query_content_protection_connection_mask_ = 0; - uint32_t query_content_protection_protection_mask_ = 0; + uint32_t connection_mask_ = DISPLAY_CONNECTION_TYPE_NONE; + uint32_t protection_mask_ = CONTENT_PROTECTION_METHOD_NONE; static constexpr size_t kNumOutputs = 3; std::unique_ptr<DisplaySnapshot> outputs_[kNumOutputs]; @@ -871,10 +872,8 @@ base::Unretained(this))); EXPECT_EQ(1, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_INTERNAL), - query_content_protection_connection_mask_); - EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_NONE), - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_NONE, protection_mask_); EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); UpdateOutputs(2, true); @@ -886,10 +885,8 @@ base::Unretained(this))); EXPECT_EQ(2, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI), - query_content_protection_connection_mask_); - EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_NONE), - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_NONE, protection_mask_); EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); configurator_.ApplyContentProtection( @@ -898,21 +895,19 @@ base::Unretained(this))); EXPECT_EQ(1, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_DESIRED), + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_DESIRED), log_->GetActionsAndClear()); - // Enable protection. - native_display_delegate_->set_hdcp_state(HDCP_STATE_ENABLED); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); + configurator_.QueryContentProtection( id, outputs_[1]->display_id(), base::BindOnce(&DisplayConfiguratorTest::QueryContentProtectionCallback, base::Unretained(this))); EXPECT_EQ(3, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI), - query_content_protection_connection_mask_); - EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_HDCP), - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_HDCP, protection_mask_); EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); // Requests on invalid display should fail. @@ -928,18 +923,20 @@ EXPECT_EQ(4, query_content_protection_call_count_); EXPECT_FALSE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_NONE), - query_content_protection_connection_mask_); - EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_NONE), - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_NONE, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_NONE, protection_mask_); EXPECT_EQ(2, apply_content_protection_call_count_); EXPECT_FALSE(apply_content_protection_success_); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); + // Protections should be disabled after unregister. configurator_.UnregisterContentProtectionClient(id); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_UNDESIRED), + + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_UNDESIRED), log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_UNDESIRED, native_display_delegate_->hdcp_state()); } TEST_F(DisplayConfiguratorTest, ContentProtectionAsync) { @@ -966,8 +963,9 @@ EXPECT_EQ(0, apply_content_protection_call_count_); EXPECT_EQ(0, query_content_protection_call_count_); + EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_UNDESIRED, native_display_delegate_->hdcp_state()); - native_display_delegate_->set_hdcp_state(HDCP_STATE_ENABLED); base::RunLoop().RunUntilIdle(); EXPECT_EQ(kTaskCount, apply_content_protection_call_count_); @@ -975,13 +973,12 @@ EXPECT_EQ(kTaskCount, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI), - query_content_protection_connection_mask_); - EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_HDCP), - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_HDCP, protection_mask_); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_DESIRED), + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_DESIRED), log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); // Pending task should run even if previous task fails. native_display_delegate_->set_set_hdcp_state_expectation(false); @@ -1006,13 +1003,13 @@ EXPECT_EQ(kTaskCount + 1, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI), - query_content_protection_connection_mask_); - EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_HDCP), - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_HDCP, protection_mask_); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_UNDESIRED), + // Disabling protection should fail. + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_UNDESIRED), log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); } TEST_F(DisplayConfiguratorTest, DoNotConfigureWithSuspendedDisplays) { @@ -1096,9 +1093,10 @@ base::Unretained(this))); EXPECT_EQ(1, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_DESIRED).c_str(), + + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_DESIRED), log_->GetActionsAndClear()); - native_display_delegate_->set_hdcp_state(HDCP_STATE_ENABLED); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); configurator_.QueryContentProtection( client1, outputs_[1]->display_id(), @@ -1106,10 +1104,8 @@ base::Unretained(this))); EXPECT_EQ(1, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI), - query_content_protection_connection_mask_); - EXPECT_EQ(CONTENT_PROTECTION_METHOD_HDCP, - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_HDCP, protection_mask_); configurator_.QueryContentProtection( client2, outputs_[1]->display_id(), @@ -1117,10 +1113,8 @@ base::Unretained(this))); EXPECT_EQ(2, query_content_protection_call_count_); EXPECT_TRUE(query_content_protection_success_); - EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI), - query_content_protection_connection_mask_); - EXPECT_EQ(CONTENT_PROTECTION_METHOD_NONE, - query_content_protection_protection_mask_); + EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, connection_mask_); + EXPECT_EQ(CONTENT_PROTECTION_METHOD_NONE, protection_mask_); // Protections will be disabled only if no more clients request them. configurator_.ApplyContentProtection( @@ -1129,7 +1123,9 @@ base::Unretained(this))); EXPECT_EQ(2, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); + EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); configurator_.ApplyContentProtection( client1, outputs_[1]->display_id(), CONTENT_PROTECTION_METHOD_NONE, @@ -1137,8 +1133,9 @@ base::Unretained(this))); EXPECT_EQ(3, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_UNDESIRED).c_str(), + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_UNDESIRED), log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_UNDESIRED, native_display_delegate_->hdcp_state()); } TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClientsEnable) { @@ -1155,16 +1152,17 @@ base::Unretained(this))); EXPECT_EQ(1, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); - native_display_delegate_->set_hdcp_state(HDCP_STATE_DESIRED); + configurator_.ApplyContentProtection( client2, outputs_[1]->display_id(), CONTENT_PROTECTION_METHOD_HDCP, base::BindOnce(&DisplayConfiguratorTest::ApplyContentProtectionCallback, base::Unretained(this))); EXPECT_EQ(2, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); - EXPECT_EQ(GetSetHDCPStateAction(*outputs_[1], HDCP_STATE_DESIRED).c_str(), + + EXPECT_EQ(GetSetHDCPStateAction(kDisplayIds[1], HDCP_STATE_DESIRED), log_->GetActionsAndClear()); - native_display_delegate_->set_hdcp_state(HDCP_STATE_ENABLED); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); // Don't enable again if HDCP is already active. configurator_.ApplyContentProtection( @@ -1173,13 +1171,16 @@ base::Unretained(this))); EXPECT_EQ(3, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); + configurator_.ApplyContentProtection( client2, outputs_[1]->display_id(), CONTENT_PROTECTION_METHOD_HDCP, base::BindOnce(&DisplayConfiguratorTest::ApplyContentProtectionCallback, base::Unretained(this))); EXPECT_EQ(4, apply_content_protection_call_count_); EXPECT_TRUE(apply_content_protection_success_); + EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); + EXPECT_EQ(HDCP_STATE_ENABLED, native_display_delegate_->hdcp_state()); } TEST_F(DisplayConfiguratorTest, HandleConfigureCrtcFailure) {
diff --git a/ui/display/manager/test/action_logger_util.cc b/ui/display/manager/test/action_logger_util.cc index 8f65810..53c0958 100644 --- a/ui/display/manager/test/action_logger_util.cc +++ b/ui/display/manager/test/action_logger_util.cc
@@ -32,10 +32,9 @@ mode ? mode->ToString().c_str() : "NULL"); } -std::string GetSetHDCPStateAction(const DisplaySnapshot& output, - HDCPState state) { - return base::StringPrintf("set_hdcp(id=%" PRId64 ",state=%d)", - output.display_id(), state); +std::string GetSetHDCPStateAction(int64_t display_id, HDCPState state) { + return base::StringPrintf("set_hdcp(id=%" PRId64 ",state=%d)", display_id, + state); } std::string SetColorMatrixAction(int64_t display_id,
diff --git a/ui/display/manager/test/action_logger_util.h b/ui/display/manager/test/action_logger_util.h index a2b1375..8fb80d6 100644 --- a/ui/display/manager/test/action_logger_util.h +++ b/ui/display/manager/test/action_logger_util.h
@@ -43,8 +43,7 @@ const gfx::Point& origin); // Returns a string describing a TestNativeDisplayDelegate::SetHDCPState() call. -std::string GetSetHDCPStateAction(const DisplaySnapshot& output, - HDCPState state); +std::string GetSetHDCPStateAction(int64_t display_id, HDCPState state); // Returns a string describing a TestNativeDisplayDelegate::SetColorMatrix() // call.
diff --git a/ui/display/manager/test/test_native_display_delegate.cc b/ui/display/manager/test/test_native_display_delegate.cc index ec2490f..b0bffa77 100644 --- a/ui/display/manager/test/test_native_display_delegate.cc +++ b/ui/display/manager/test/test_native_display_delegate.cc
@@ -10,6 +10,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "ui/display/manager/test/action_logger.h" #include "ui/display/types/display_mode.h" +#include "ui/display/types/display_snapshot.h" #include "ui/display/types/native_display_observer.h" namespace display { @@ -95,16 +96,40 @@ void TestNativeDisplayDelegate::SetHDCPState(const DisplaySnapshot& output, HDCPState state, SetHDCPStateCallback callback) { - log_->AppendAction(GetSetHDCPStateAction(output, state)); - if (run_async_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), set_hdcp_expectation_)); + FROM_HERE, base::BindOnce(&TestNativeDisplayDelegate::DoSetHDCPState, + base::Unretained(this), output.display_id(), + state, std::move(callback))); } else { - std::move(callback).Run(set_hdcp_expectation_); + DoSetHDCPState(output.display_id(), state, std::move(callback)); } } +void TestNativeDisplayDelegate::DoSetHDCPState(int64_t display_id, + HDCPState state, + SetHDCPStateCallback callback) { + log_->AppendAction(GetSetHDCPStateAction(display_id, state)); + + switch (state) { + case HDCP_STATE_ENABLED: + NOTREACHED(); + break; + + case HDCP_STATE_DESIRED: + hdcp_state_ = + set_hdcp_expectation_ ? HDCP_STATE_ENABLED : HDCP_STATE_DESIRED; + break; + + case HDCP_STATE_UNDESIRED: + if (set_hdcp_expectation_) + hdcp_state_ = HDCP_STATE_UNDESIRED; + break; + } + + std::move(callback).Run(set_hdcp_expectation_); +} + bool TestNativeDisplayDelegate::SetColorMatrix( int64_t display_id, const std::vector<float>& color_matrix) {
diff --git a/ui/display/manager/test/test_native_display_delegate.h b/ui/display/manager/test/test_native_display_delegate.h index 9589274..0b2143c 100644 --- a/ui/display/manager/test/test_native_display_delegate.h +++ b/ui/display/manager/test/test_native_display_delegate.h
@@ -47,6 +47,7 @@ set_hdcp_expectation_ = success; } + HDCPState hdcp_state() const { return hdcp_state_; } void set_hdcp_state(HDCPState state) { hdcp_state_ = state; } void set_run_async(bool run_async) { run_async_ = run_async; } @@ -80,6 +81,10 @@ const DisplayMode* mode, const gfx::Point& origin); + void DoSetHDCPState(int64_t display_id, + HDCPState state, + SetHDCPStateCallback callback); + // Outputs to be returned by GetDisplays(). std::vector<DisplaySnapshot*> outputs_;
diff --git a/ui/gfx/x/x11.h b/ui/gfx/x/x11.h index 4bce2bc..3a93a98 100644 --- a/ui/gfx/x/x11.h +++ b/ui/gfx/x/x11.h
@@ -36,6 +36,7 @@ #include <X11/extensions/record.h> #include <X11/extensions/scrnsaver.h> #include <X11/extensions/shape.h> +#include <X11/extensions/sync.h> // Define XK_xxx before the #include of <X11/keysym.h> so that <X11/keysym.h> // defines all KeySyms we need.
diff --git a/ui/gfx/x/x11_atom_cache.cc b/ui/gfx/x/x11_atom_cache.cc index 7405b88..2c87436 100644 --- a/ui/gfx/x/x11_atom_cache.cc +++ b/ui/gfx/x/x11_atom_cache.cc
@@ -91,6 +91,7 @@ }; constexpr const char* kAtomsToCache[] = { + "ATOM_PAIR", "Abs Dbl End Timestamp", "Abs Dbl Fling X Velocity", "Abs Dbl Fling Y Velocity", @@ -101,7 +102,6 @@ "Abs Dbl Start Timestamp", "Abs Finger Count", "Abs Fling State", - "Abs Metrics Type", "Abs MT Orientation", "Abs MT Position X", "Abs MT Position Y", @@ -109,25 +109,11 @@ "Abs MT Touch Major", "Abs MT Touch Minor", "Abs MT Tracking ID", - "application/octet-stream", - "application/vnd.chromium.test", - "ATOM_PAIR", + "Abs Metrics Type", "CHECK", - "_CHROME_DISPLAY_INTERNAL", - "_CHROME_DISPLAY_ROTATION", - "_CHROME_DISPLAY_SCALE_FACTOR", "CHOME_SELECTION", "CHROME_SELECTION", - "_CHROMIUM_DRAG_RECEIVER", - "chromium/filename", "CHROMIUM_TIMESTAMP", - "chromium/x-bookmark-entries", - "chromium/x-browser-actions", - "chromium/x-file-system-files", - "chromium/x-pepper-custom-data", - "chromium/x-renderer-taint", - "chromium/x-web-custom-data", - "chromium/x-webkit-paste", "CLIPBOARD", "CLIPBOARD_MANAGER", "Content Protection", @@ -138,74 +124,26 @@ "Enabled", "FAKE_SELECTION", "Full aspect", - "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED", - "_GTK_THEME_VARIANT", - "_ICC_PROFILE", - "image/png", "INCR", "KEYBOARD", "LOCK", - "marker_event", - "_MOTIF_WM_HINTS", "MOUSE", "MULTIPLE", - "_NET_ACTIVE_WINDOW", - "_NET_CLIENT_LIST_STACKING", - "_NET_CURRENT_DESKTOP", - "_NET_FRAME_EXTENTS", - "_NETSCAPE_URL", - "_NET_SUPPORTED", - "_NET_SUPPORTING_WM_CHECK", - "_NET_WM_BYPASS_COMPOSITOR", - "_NET_WM_CM_S0", - "_NET_WM_DESKTOP", - "_NET_WM_ICON", - "_NET_WM_MOVERESIZE", - "_NET_WM_NAME", - "_NET_WM_PID", - "_NET_WM_PING", - "_NET_WM_STATE", - "_NET_WM_STATE_ABOVE", - "_NET_WM_STATE_FOCUSED", - "_NET_WM_STATE_FULLSCREEN", - "_NET_WM_STATE_HIDDEN", - "_NET_WM_STATE_MAXIMIZED_HORZ", - "_NET_WM_STATE_MAXIMIZED_VERT", - "_NET_WM_STATE_SKIP_TASKBAR", - "_NET_WM_STATE_STICKY", - "_NET_WM_USER_TIME", - "_NET_WM_WINDOW_OPACITY", - "_NET_WM_WINDOW_TYPE", - "_NET_WM_WINDOW_TYPE_DND", - "_NET_WM_WINDOW_TYPE_MENU", - "_NET_WM_WINDOW_TYPE_NORMAL", - "_NET_WM_WINDOW_TYPE_NOTIFICATION", - "_NET_WM_WINDOW_TYPE_TOOLTIP", - "_NET_WORKAREA", "Rel Horiz Wheel", "Rel Vert Wheel", "SAVE_TARGETS", - "_SCREENSAVER_STATUS", - "_SCREENSAVER_VERSION", - "scaling mode", "SELECTION_STRING", - "Tap Paused", - "TARGETS", "TARGET1", "TARGET2", + "TARGETS", "TEXT", - "text/html", - "text/plain", - "text/plain;charset=utf-8", - "text/uri-list", - "text/rtf", - "text/x-moz-url", "TIMESTAMP", "TOUCHPAD", "TOUCHSCREEN", + "Tap Paused", "Touch Timestamp", - "Undesired", "UTF8_STRING", + "Undesired", "WM_DELETE_WINDOW", "WM_PROTOCOLS", "WM_WINDOW_ROLE", @@ -227,6 +165,70 @@ "XdndSelection", "XdndStatus", "XdndTypeList", + "_CHROME_DISPLAY_INTERNAL", + "_CHROME_DISPLAY_ROTATION", + "_CHROME_DISPLAY_SCALE_FACTOR", + "_CHROMIUM_DRAG_RECEIVER", + "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED", + "_GTK_THEME_VARIANT", + "_ICC_PROFILE", + "_MOTIF_WM_HINTS", + "_NETSCAPE_URL", + "_NET_ACTIVE_WINDOW", + "_NET_CLIENT_LIST_STACKING", + "_NET_CURRENT_DESKTOP", + "_NET_FRAME_EXTENTS", + "_NET_SUPPORTED", + "_NET_SUPPORTING_WM_CHECK", + "_NET_WM_BYPASS_COMPOSITOR", + "_NET_WM_CM_S0", + "_NET_WM_DESKTOP", + "_NET_WM_ICON", + "_NET_WM_MOVERESIZE", + "_NET_WM_NAME", + "_NET_WM_PID", + "_NET_WM_PING", + "_NET_WM_STATE", + "_NET_WM_STATE_ABOVE", + "_NET_WM_STATE_FOCUSED", + "_NET_WM_STATE_FULLSCREEN", + "_NET_WM_STATE_HIDDEN", + "_NET_WM_STATE_MAXIMIZED_HORZ", + "_NET_WM_STATE_MAXIMIZED_VERT", + "_NET_WM_STATE_SKIP_TASKBAR", + "_NET_WM_STATE_STICKY", + "_NET_WM_SYNC_REQUEST", + "_NET_WM_SYNC_REQUEST_COUNTER", + "_NET_WM_USER_TIME", + "_NET_WM_WINDOW_OPACITY", + "_NET_WM_WINDOW_TYPE", + "_NET_WM_WINDOW_TYPE_DND", + "_NET_WM_WINDOW_TYPE_MENU", + "_NET_WM_WINDOW_TYPE_NORMAL", + "_NET_WM_WINDOW_TYPE_NOTIFICATION", + "_NET_WM_WINDOW_TYPE_TOOLTIP", + "_NET_WORKAREA", + "_SCREENSAVER_STATUS", + "_SCREENSAVER_VERSION", + "application/octet-stream", + "application/vnd.chromium.test", + "chromium/filename", + "chromium/x-bookmark-entries", + "chromium/x-browser-actions", + "chromium/x-file-system-files", + "chromium/x-pepper-custom-data", + "chromium/x-renderer-taint", + "chromium/x-web-custom-data", + "chromium/x-webkit-paste", + "image/png", + "marker_event", + "scaling mode", + "text/html", + "text/plain", + "text/plain;charset=utf-8", + "text/rtf", + "text/uri-list", + "text/x-moz-url", }; constexpr int kCacheCount = base::size(kAtomsToCache);
diff --git a/ui/gfx/x/x11_atom_cache.h b/ui/gfx/x/x11_atom_cache.h index 19bebbe..cc97b5a 100644 --- a/ui/gfx/x/x11_atom_cache.h +++ b/ui/gfx/x/x11_atom_cache.h
@@ -5,9 +5,9 @@ #ifndef UI_GFX_X_X11_ATOM_CACHE_H_ #define UI_GFX_X_X11_ATOM_CACHE_H_ -#include <map> #include <string> +#include "base/containers/flat_map.h" #include "base/macros.h" #include "ui/gfx/gfx_export.h" #include "ui/gfx/x/x11_types.h" @@ -42,7 +42,7 @@ XDisplay* xdisplay_; - mutable std::map<std::string, XAtom> cached_atoms_; + mutable base::flat_map<std::string, XAtom> cached_atoms_; DISALLOW_COPY_AND_ASSIGN(X11AtomCache); };
diff --git a/ui/ozone/public/platform_screen.h b/ui/ozone/public/platform_screen.h index d998751..d98bed8e 100644 --- a/ui/ozone/public/platform_screen.h +++ b/ui/ozone/public/platform_screen.h
@@ -19,30 +19,48 @@ namespace ui { +// PlatformScreen is an abstract base class for an interface to an Ozone +// platform's functionality exposed to Chrome via display::Screen. +// +// Recall that in Chrome, a |Screen| is the union of all attached |Display| +// instances. The |Screen|'s coordinate system is in DIP pixels (so that +// it can reasonably support |Display|s of differing pixel densities.) The +// |Screen|'s origin is the top-left corner of the primary |Display| in the +// |Screen|. Coordinates increase down and to the right. +// +// TODO(rjkroege): Add ascii art? class PlatformScreen { public: PlatformScreen() = default; virtual ~PlatformScreen() = default; + // Provide a |display:;Display| for each physical display available to Chrome. virtual const std::vector<display::Display>& GetAllDisplays() const = 0; + // Returns the |Display| whose origin (top left corner) is 0,0 in the + // |Screen|. virtual display::Display GetPrimaryDisplay() const = 0; - // Returns Desktop objects that the |widget| belongs to. + // Returns the Display occupied by |widget|. + // TODO(rjkroege) This method might be unused? + // TODO(rjkroege): How should we support unified mode? virtual display::Display GetDisplayForAcceleratedWidget( gfx::AcceleratedWidget widget) const = 0; - // Returns cursor position in DIPs relative to the desktop. + // Returns cursor position in DIPs relative to the |Screen|'s origin. + // TODO(rjkroege): Verify these semantics. virtual gfx::Point GetCursorScreenPoint() const = 0; virtual gfx::AcceleratedWidget GetAcceleratedWidgetAtScreenPoint( const gfx::Point& point) const = 0; - // Returns the display nearest the specified point. |point| must be in DIPs. + // Returns the |Display| nearest the specified point. |point| must be in DIPs. virtual display::Display GetDisplayNearestPoint( const gfx::Point& point) const = 0; - // Returns the display that most closely intersects the provided rect. + // Returns the |Display| that most closely intersects the provided rect if one + // exists. + // TODO(rjk): Update the code to track this. virtual display::Display GetDisplayMatching( const gfx::Rect& match_rect) const = 0;
diff --git a/ui/views/accessibility/ax_view_obj_wrapper.cc b/ui/views/accessibility/ax_view_obj_wrapper.cc index e9f4327..3c6d18ba 100644 --- a/ui/views/accessibility/ax_view_obj_wrapper.cc +++ b/ui/views/accessibility/ax_view_obj_wrapper.cc
@@ -61,11 +61,8 @@ out_children->push_back(aura_obj_cache_->GetOrCreate(child)); } - for (int i = 0; i < view_accessibility.virtual_child_count(); ++i) { - AXVirtualView* child = - const_cast<AXVirtualView*>(view_accessibility.virtual_child_at(i)); + for (const auto& child : view_accessibility.virtual_children()) out_children->push_back(child->GetOrCreateWrapper(aura_obj_cache_)); - } } void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
diff --git a/ui/views/accessibility/ax_virtual_view.cc b/ui/views/accessibility/ax_virtual_view.cc index 13e1fff..cb05ae4e 100644 --- a/ui/views/accessibility/ax_virtual_view.cc +++ b/ui/views/accessibility/ax_virtual_view.cc
@@ -153,17 +153,6 @@ } } -const AXVirtualView* AXVirtualView::child_at(int index) const { - DCHECK_GE(index, 0); - DCHECK_LT(index, static_cast<int>(children_.size())); - return children_[index].get(); -} - -AXVirtualView* AXVirtualView::child_at(int index) { - return const_cast<AXVirtualView*>( - const_cast<const AXVirtualView*>(this)->child_at(index)); -} - bool AXVirtualView::Contains(const AXVirtualView* view) const { DCHECK(view); for (const AXVirtualView* v = view; v; v = v->virtual_parent_view_) {
diff --git a/ui/views/accessibility/ax_virtual_view.h b/ui/views/accessibility/ax_virtual_view.h index dea22fe..de69e08 100644 --- a/ui/views/accessibility/ax_virtual_view.h +++ b/ui/views/accessibility/ax_virtual_view.h
@@ -53,6 +53,8 @@ // ViewAccessibility or an AXVirtualView. class VIEWS_EXPORT AXVirtualView : public ui::AXPlatformNodeDelegateBase { public: + using AXVirtualViews = std::vector<std::unique_ptr<AXVirtualView>>; + static AXVirtualView* GetFromId(int32_t id); AXVirtualView(); @@ -79,10 +81,7 @@ // The virtual views are deleted. void RemoveAllChildViews(); - bool has_children() const { return !children_.empty(); } - - const AXVirtualView* child_at(int index) const; - AXVirtualView* child_at(int index); + const AXVirtualViews& children() const { return children_; } // Returns the parent ViewAccessibility if the parent is a real View and not // an AXVirtualView. Returns nullptr otherwise. @@ -179,7 +178,7 @@ AXVirtualView* virtual_parent_view_ = nullptr; // We own our children. - std::vector<std::unique_ptr<AXVirtualView>> children_; + AXVirtualViews children_; ui::AXUniqueId unique_id_; ui::AXNodeData custom_data_;
diff --git a/ui/views/accessibility/ax_virtual_view_wrapper.cc b/ui/views/accessibility/ax_virtual_view_wrapper.cc index f9bb872..65a7b57 100644 --- a/ui/views/accessibility/ax_virtual_view_wrapper.cc +++ b/ui/views/accessibility/ax_virtual_view_wrapper.cc
@@ -34,9 +34,8 @@ void AXVirtualViewWrapper::GetChildren( std::vector<AXAuraObjWrapper*>* out_children) { - for (int i = 0; i < virtual_view_->GetChildCount(); ++i) - out_children->push_back( - virtual_view_->child_at(i)->GetOrCreateWrapper(aura_obj_cache_)); + for (const auto& child : virtual_view_->children()) + out_children->push_back(child->GetOrCreateWrapper(aura_obj_cache_)); } void AXVirtualViewWrapper::Serialize(ui::AXNodeData* out_node_data) {
diff --git a/ui/views/accessibility/view_accessibility.cc b/ui/views/accessibility/view_accessibility.cc index 34ff23e..aca46ef 100644 --- a/ui/views/accessibility/view_accessibility.cc +++ b/ui/views/accessibility/view_accessibility.cc
@@ -58,25 +58,14 @@ DCHECK(virtual_view); if (virtual_view->parent_view() == this) return; - AddVirtualChildViewAt(std::move(virtual_view), virtual_child_count()); -} - -void ViewAccessibility::AddVirtualChildViewAt( - std::unique_ptr<AXVirtualView> virtual_view, - int index) { - DCHECK(virtual_view); DCHECK(!virtual_view->parent_view()) << "This |view| already has a View " "parent. Call RemoveVirtualChildView " "first."; DCHECK(!virtual_view->virtual_parent_view()) << "This |view| already has an " "AXVirtualView parent. Call " "RemoveChildView first."; - DCHECK_GE(index, 0); - DCHECK_LE(index, virtual_child_count()); - virtual_view->set_parent_view(this); - virtual_children_.insert(virtual_children_.begin() + index, - std::move(virtual_view)); + virtual_children_.push_back(std::move(virtual_view)); } std::unique_ptr<AXVirtualView> ViewAccessibility::RemoveVirtualChildView(
diff --git a/ui/views/accessibility/view_accessibility.h b/ui/views/accessibility/view_accessibility.h index 866305b..0eb196e 100644 --- a/ui/views/accessibility/view_accessibility.h +++ b/ui/views/accessibility/view_accessibility.h
@@ -35,6 +35,8 @@ // that implements the native accessibility APIs on a specific platform. class VIEWS_EXPORT ViewAccessibility { public: + using AXVirtualViews = AXVirtualView::AXVirtualViews; + static std::unique_ptr<ViewAccessibility> Create(View* view); virtual ~ViewAccessibility(); @@ -100,11 +102,9 @@ // Methods for managing virtual views. // - // Adds |virtual_view| as a child of this View, optionally at |index|. - // We take ownership of our virtual children. + // Adds |virtual_view| as a child of this View. We take ownership of our + // virtual children. void AddVirtualChildView(std::unique_ptr<AXVirtualView> virtual_view); - void AddVirtualChildViewAt(std::unique_ptr<AXVirtualView> virtual_view, - int index); // Removes |virtual_view| from this View. The virtual view's parent will // change to nullptr. Hands ownership back to the caller. @@ -115,20 +115,7 @@ // The virtual views are deleted. void RemoveAllVirtualChildViews(); - int virtual_child_count() const { - return static_cast<int>(virtual_children_.size()); - } - - AXVirtualView* virtual_child_at(int index) { - return const_cast<AXVirtualView*>( - const_cast<const ViewAccessibility*>(this)->virtual_child_at(index)); - } - - const AXVirtualView* virtual_child_at(int index) const { - DCHECK_GE(index, 0); - DCHECK_LT(index, virtual_child_count()); - return virtual_children_[index].get(); - } + const AXVirtualViews& virtual_children() const { return virtual_children_; } // Returns true if |virtual_view| is contained within the hierarchy of this // View, even as an indirect descendant. @@ -153,7 +140,7 @@ // If there are any virtual children, they override any real children. // We own our virtual children. - std::vector<std::unique_ptr<AXVirtualView>> virtual_children_; + AXVirtualViews virtual_children_; // The virtual child that is currently focused. // This is nullptr if no virtual child is focused.
diff --git a/ui/views/accessibility/view_ax_platform_node_delegate.cc b/ui/views/accessibility/view_ax_platform_node_delegate.cc index 24d4606..49769ae 100644 --- a/ui/views/accessibility/view_ax_platform_node_delegate.cc +++ b/ui/views/accessibility/view_ax_platform_node_delegate.cc
@@ -235,8 +235,8 @@ if (IsLeaf()) return 0; - if (virtual_child_count()) - return virtual_child_count(); + if (!virtual_children().empty()) + return int{virtual_children().size()}; const auto child_widgets_result = GetChildWidgets(); if (child_widgets_result.is_tab_modal_showing) { @@ -254,8 +254,9 @@ if (IsLeaf()) return nullptr; - if (virtual_child_count()) - return virtual_child_at(index)->GetNativeObject(); + size_t child_index = size_t{index}; + if (!virtual_children().empty()) + return virtual_children()[child_index]->GetNativeObject(); // If this is a root view, our widget might have child widgets. Include const auto child_widgets_result = GetChildWidgets(); @@ -268,7 +269,6 @@ return child_widgets[0]->GetRootView()->GetNativeViewAccessible(); } - size_t child_index = size_t{index}; if (child_index < view()->children().size()) return view()->children()[child_index]->GetNativeViewAccessible();
diff --git a/ui/views/controls/table/table_view.cc b/ui/views/controls/table/table_view.cc index 9b6f2567..13f00b3 100644 --- a/ui/views/controls/table/table_view.cc +++ b/ui/views/controls/table/table_view.cc
@@ -1354,12 +1354,12 @@ DCHECK_GE(row, 0); DCHECK_LT(row, RowCount()); if (header_) - row += 1; - if (row < GetViewAccessibility().virtual_child_count()) { - AXVirtualView* ax_row = GetViewAccessibility().virtual_child_at(row); + ++row; + if (size_t{row} < GetViewAccessibility().virtual_children().size()) { + const auto& ax_row = GetViewAccessibility().virtual_children()[size_t{row}]; DCHECK(ax_row); DCHECK_EQ(ax_row->GetData().role, ax::mojom::Role::kRow); - return ax_row; + return ax_row.get(); } NOTREACHED() << "|row| not found. Did you forget to call " "UpdateVirtualAccessibilityChildren()?"; @@ -1370,25 +1370,22 @@ int row, int visible_column_index) { AXVirtualView* ax_row = GetVirtualAccessibilityRow(row); - if (!ax_row) { - NOTREACHED() << "|row| not found. Did you forget to call " + DCHECK(ax_row) << "|row| not found. Did you forget to call " "UpdateVirtualAccessibilityChildren()?"; - return nullptr; - } - for (int i = 0; i < ax_row->GetChildCount(); ++i) { - AXVirtualView* ax_cell = ax_row->child_at(i); + const auto matches_index = [visible_column_index](const auto& ax_cell) { DCHECK(ax_cell); DCHECK(ax_cell->GetData().role == ax::mojom::Role::kColumnHeader || ax_cell->GetData().role == ax::mojom::Role::kCell); - if (ax_cell->GetData().GetIntAttribute( - ax::mojom::IntAttribute::kTableCellColumnIndex) == - visible_column_index) { - return ax_cell; - } - } - NOTREACHED() << "|visible_column_index| not found. Did you forget to call " - "UpdateVirtualAccessibilityChildren()?"; - return nullptr; + return ax_cell->GetData().GetIntAttribute( + ax::mojom::IntAttribute::kTableCellColumnIndex) == + visible_column_index; + }; + const auto i = std::find_if(ax_row->children().cbegin(), + ax_row->children().cend(), matches_index); + DCHECK(i != ax_row->children().cend()) + << "|visible_column_index| not found. Did you forget to call " + << "UpdateVirtualAccessibilityChildren()?"; + return i->get(); } } // namespace views
diff --git a/ui/views/controls/table/table_view_unittest.cc b/ui/views/controls/table/table_view_unittest.cc index f79833e..addb250 100644 --- a/ui/views/controls/table/table_view_unittest.cc +++ b/ui/views/controls/table/table_view_unittest.cc
@@ -375,43 +375,42 @@ ax::mojom::IntAttribute::kTableColumnCount))); // The header takes up another row. - ASSERT_EQ(table_->RowCount() + 1, view_accessibility.virtual_child_count()); - const AXVirtualView* header = view_accessibility.virtual_child_at(0); + ASSERT_EQ(size_t{table_->RowCount() + 1}, + view_accessibility.virtual_children().size()); + const auto& header = view_accessibility.virtual_children().front(); ASSERT_TRUE(header); EXPECT_EQ(ax::mojom::Role::kRow, header->GetData().role); - ASSERT_EQ( - helper_->visible_col_count(), - static_cast<size_t>(const_cast<AXVirtualView*>(header)->GetChildCount())); - for (int j = 0; j < static_cast<int>(helper_->visible_col_count()); ++j) { - const AXVirtualView* header_cell = header->child_at(j); + ASSERT_EQ(helper_->visible_col_count(), header->children().size()); + int j = 0; + for (const auto& header_cell : header->children()) { ASSERT_TRUE(header_cell); const ui::AXNodeData& header_cell_data = header_cell->GetData(); EXPECT_EQ(ax::mojom::Role::kColumnHeader, header_cell_data.role); - EXPECT_EQ(j, static_cast<int>(header_cell_data.GetIntAttribute( - ax::mojom::IntAttribute::kTableCellColumnIndex))); + EXPECT_EQ(j++, header_cell_data.GetIntAttribute( + ax::mojom::IntAttribute::kTableCellColumnIndex)); } - for (int i = 1; i < table_->RowCount() + 1; ++i) { - const AXVirtualView* row = view_accessibility.virtual_child_at(i); + int i = 0; + for (auto child_iter = view_accessibility.virtual_children().begin() + 1; + i < table_->RowCount(); ++child_iter, ++i) { + const auto& row = *child_iter; ASSERT_TRUE(row); const ui::AXNodeData& row_data = row->GetData(); EXPECT_EQ(ax::mojom::Role::kRow, row_data.role); - EXPECT_EQ(i - 1, static_cast<int>(row_data.GetIntAttribute( - ax::mojom::IntAttribute::kTableRowIndex))); + EXPECT_EQ( + i, row_data.GetIntAttribute(ax::mojom::IntAttribute::kTableRowIndex)); - ASSERT_EQ( - helper_->visible_col_count(), - static_cast<size_t>(const_cast<AXVirtualView*>(row)->GetChildCount())); - for (int j = 0; j < static_cast<int>(helper_->visible_col_count()); ++j) { - const AXVirtualView* cell = row->child_at(j); + ASSERT_EQ(helper_->visible_col_count(), row->children().size()); + j = 0; + for (const auto& cell : row->children()) { ASSERT_TRUE(cell); const ui::AXNodeData& cell_data = cell->GetData(); EXPECT_EQ(ax::mojom::Role::kCell, cell_data.role); - EXPECT_EQ(i - 1, static_cast<int>(cell_data.GetIntAttribute( - ax::mojom::IntAttribute::kTableCellRowIndex))); - EXPECT_EQ(j, static_cast<int>(cell_data.GetIntAttribute( - ax::mojom::IntAttribute::kTableCellColumnIndex))); + EXPECT_EQ(i, cell_data.GetIntAttribute( + ax::mojom::IntAttribute::kTableCellRowIndex)); + EXPECT_EQ(j++, cell_data.GetIntAttribute( + ax::mojom::IntAttribute::kTableCellColumnIndex)); } } }
diff --git a/ui/views/metadata/type_conversion.cc b/ui/views/metadata/type_conversion.cc index 7d43735b..1f30697 100644 --- a/ui/views/metadata/type_conversion.cc +++ b/ui/views/metadata/type_conversion.cc
@@ -17,55 +17,22 @@ /***** String Conversions *****/ -template <> -base::string16 ConvertToString<int8_t>(int8_t source_value) { - return base::NumberToString16(source_value); -} +#define CONVERT_NUMBER_TO_STRING(T) \ + template <> \ + base::string16 ConvertToString<T>(T source_value) { \ + return base::NumberToString16(source_value); \ + } -template <> -base::string16 ConvertToString<int16_t>(int16_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<int32_t>(int32_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<int64_t>(int64_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<uint8_t>(uint8_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<uint16_t>(uint16_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<uint32_t>(uint32_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<uint64_t>(uint64_t source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<float>(float source_value) { - return base::NumberToString16(source_value); -} - -template <> -base::string16 ConvertToString<double>(double source_value) { - return base::NumberToString16(source_value); -} +CONVERT_NUMBER_TO_STRING(int8_t) +CONVERT_NUMBER_TO_STRING(int16_t) +CONVERT_NUMBER_TO_STRING(int32_t) +CONVERT_NUMBER_TO_STRING(int64_t) +CONVERT_NUMBER_TO_STRING(uint8_t) +CONVERT_NUMBER_TO_STRING(uint16_t) +CONVERT_NUMBER_TO_STRING(uint32_t) +CONVERT_NUMBER_TO_STRING(uint64_t) +CONVERT_NUMBER_TO_STRING(float) +CONVERT_NUMBER_TO_STRING(double) template <> base::string16 ConvertToString<bool>(bool source_value) {
diff --git a/ui/views/metadata/type_conversion.h b/ui/views/metadata/type_conversion.h index 5050bb9..57e427e 100644 --- a/ui/views/metadata/type_conversion.h +++ b/ui/views/metadata/type_conversion.h
@@ -92,110 +92,30 @@ // String Conversions --------------------------------------------------------- -template <> -VIEWS_EXPORT base::string16 ConvertToString<int8_t>(int8_t source_value); +#define DECLARE_CONVERSIONS(T) \ + template <> \ + VIEWS_EXPORT base::string16 ConvertToString<T>(ArgType<T> source_value); \ + template <> \ + VIEWS_EXPORT base::Optional<T> ConvertFromString<T>( \ + const base::string16& source_value); -template <> -VIEWS_EXPORT base::string16 ConvertToString<int16_t>(int16_t source_value); +DECLARE_CONVERSIONS(int8_t) +DECLARE_CONVERSIONS(int16_t) +DECLARE_CONVERSIONS(int32_t) +DECLARE_CONVERSIONS(int64_t) +DECLARE_CONVERSIONS(uint8_t) +DECLARE_CONVERSIONS(uint16_t) +DECLARE_CONVERSIONS(uint32_t) +DECLARE_CONVERSIONS(uint64_t) +DECLARE_CONVERSIONS(float) +DECLARE_CONVERSIONS(double) +DECLARE_CONVERSIONS(bool) +DECLARE_CONVERSIONS(gfx::Size) +DECLARE_CONVERSIONS(gfx::HorizontalAlignment) +DECLARE_CONVERSIONS(base::string16) +DECLARE_CONVERSIONS(const char*) -template <> -VIEWS_EXPORT base::string16 ConvertToString<int32_t>(int32_t source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<int64_t>(int64_t source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<uint8_t>(uint8_t source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<uint16_t>(uint16_t source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<uint32_t>(uint32_t source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<uint64_t>(uint64_t source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<float>(float source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<double>(double source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<bool>(bool source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<gfx::Size>( - const gfx::Size& source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<gfx::HorizontalAlignment>( - gfx::HorizontalAlignment source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<base::string16>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::string16 ConvertToString<const char*>( - const char* source_value); - -template <> -VIEWS_EXPORT base::Optional<int8_t> ConvertFromString<int8_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<int16_t> ConvertFromString<int16_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<int32_t> ConvertFromString<int32_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<int64_t> ConvertFromString<int64_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<uint8_t> ConvertFromString<uint8_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<uint16_t> ConvertFromString<uint16_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<uint32_t> ConvertFromString<uint32_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<uint64_t> ConvertFromString<uint64_t>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<double> ConvertFromString<double>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<float> ConvertFromString<float>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<bool> ConvertFromString<bool>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<gfx::Size> ConvertFromString<gfx::Size>( - const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<gfx::HorizontalAlignment> -ConvertFromString<gfx::HorizontalAlignment>(const base::string16& source_value); - -template <> -VIEWS_EXPORT base::Optional<base::string16> ConvertFromString<base::string16>( - const base::string16& source_value); +#undef DECLARE_CONVERSIONS } // namespace metadata } // namespace views
diff --git a/ui/views/style/typography.h b/ui/views/style/typography.h index aa1a874..e5a6c3c 100644 --- a/ui/views/style/typography.h +++ b/ui/views/style/typography.h
@@ -83,12 +83,6 @@ // Active tab in a tabbed pane. STYLE_TAB_ACTIVE, - // Hovered tab in a tabbed pane. - STYLE_TAB_HOVERED, - - // Inactive tab in a tabbed pane. - STYLE_TAB_INACTIVE, - // Embedders must start TextStyle enum values from here. VIEWS_TEXT_STYLE_END };
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index fb996ff..9d57971 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -128,6 +128,12 @@ return 0; } +bool SyncSetCounter(XDisplay* display, XID counter, int64_t value) { + XSyncValue sync_value; + XSyncIntsToValue(&sync_value, value & 0xFFFFFFFF, value >> 32); + return XSyncSetCounter(display, counter, sync_value) == x11::True; +} + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -486,6 +492,13 @@ XDestroyWindow(xdisplay_, xwindow_); xwindow_ = x11::None; + if (update_counter_ != x11::None) { + XSyncDestroyCounter(xdisplay_, update_counter_); + XSyncDestroyCounter(xdisplay_, extended_update_counter_); + update_counter_ = x11::None; + extended_update_counter_ = x11::None; + } + desktop_native_widget_aura_->OnHostClosed(); } @@ -1337,6 +1350,31 @@ // the same tap-to-click disabling here that chromeos does. } +void DesktopWindowTreeHostX11::OnCompositingCompleteSwapWithNewSize( + ui::Compositor* compositor, + const gfx::Size& size) { + if (update_counter_ == x11::None) + return; + + if (configure_counter_value_is_extended_) { + if ((current_counter_value_ % 2) == 1) { + // An increase 3 means that the frame was not drawn as fast as possible. + // This can trigger different handling from the compositor. + // Setting an even number to |extended_update_counter_| will trigger a + // new resize. + current_counter_value_ += 3; + SyncSetCounter(xdisplay_, extended_update_counter_, + current_counter_value_); + } + return; + } + + if (configure_counter_value_ != 0) { + SyncSetCounter(xdisplay_, update_counter_, configure_counter_value_); + configure_counter_value_ = 0; + } +} + //////////////////////////////////////////////////////////////////////////////// // DesktopWindowTreeHostX11, display::DisplayObserver implementation: @@ -1476,10 +1514,27 @@ // TODO(erg): We currently only request window deletion events. We also // should listen for activation events and anything else that GTK+ listens // for, and do something useful. - XAtom protocols[2]; - protocols[0] = gfx::GetAtom("WM_DELETE_WINDOW"); - protocols[1] = gfx::GetAtom("_NET_WM_PING"); - XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); + // Request the _NET_WM_SYNC_REQUEST protocol which is used for synchronizing + // between chrome and desktop compositor (or WM) during resizing. + // The resizing behavior with _NET_WM_SYNC_REQUEST is: + // 1. Desktop compositor (or WM) sends client message _NET_WM_SYNC_REQUEST + // with a 64 bits counter to notify about an incoming resize. + // 2. Desktop compositor resizes chrome browser window. + // 3. Desktop compositor waits on an alert on value change of XSyncCounter on + // chrome window. + // 4. Chrome handles the ConfigureNotify event, and renders a new frame with + // the new size. + // 5. Chrome increases the XSyncCounter on chrome window + // 6. Desktop compositor gets the alert of counter change, and draws a new + // frame with new content from chrome. + // 7. Desktop compositor responses user mouse move events, and starts a new + // resize process, go to step 1. + XAtom protocols[] = { + gfx::GetAtom("WM_DELETE_WINDOW"), + gfx::GetAtom("_NET_WM_PING"), + gfx::GetAtom("_NET_WM_SYNC_REQUEST"), + }; + XSetWMProtocols(xdisplay_, xwindow_, protocols, base::size(protocols)); // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with // the desktop environment. @@ -1566,6 +1621,24 @@ kDarkGtkThemeVariant, base::size(kDarkGtkThemeVariant) - 1); } + if (ui::IsSyncExtensionAvailable()) { + XSyncValue value; + XSyncIntToValue(&value, 0); + update_counter_ = XSyncCreateCounter(xdisplay_, value); + extended_update_counter_ = XSyncCreateCounter(xdisplay_, value); + XID counters[2] = { + update_counter_, + extended_update_counter_, + }; + + // Set XSyncCounter as window property _NET_WM_SYNC_REQUEST_COUNTER. the + // compositor will listen on them during resizing. + XChangeProperty( + xdisplay_, xwindow_, gfx::GetAtom("_NET_WM_SYNC_REQUEST_COUNTER"), + XA_CARDINAL, 32, PropModeReplace, + reinterpret_cast<const unsigned char*>(counters), base::size(counters)); + } + // Always composite Chromium windows if a compositing WM is used. Sometimes, // WMs will not composite fullscreen windows as an optimization, but this can // lead to tearing of fullscreen videos. @@ -2077,6 +2150,11 @@ case ConfigureNotify: { DCHECK_EQ(xwindow_, xev->xconfigure.window); DCHECK_EQ(xwindow_, xev->xconfigure.event); + + configure_counter_value_ = pending_counter_value_; + configure_counter_value_is_extended_ = pending_counter_value_is_extended_; + pending_counter_value_ = 0; + // It's possible that the X window may be resized by some other means than // from within aura (e.g. the X window manager can change the size). Make // sure the root window size is maintained properly. @@ -2239,6 +2317,11 @@ XSendEvent(xdisplay_, reply_event.xclient.window, x11::False, SubstructureRedirectMask | SubstructureNotifyMask, &reply_event); + } else if (protocol == gfx::GetAtom("_NET_WM_SYNC_REQUEST")) { + pending_counter_value_ = + xev->xclient.data.l[2] + + (static_cast<int64_t>(xev->xclient.data.l[3]) << 32); + pending_counter_value_is_extended_ = xev->xclient.data.l[4] != 0; } } else if (message_type == gfx::GetAtom("XdndEnter")) { drag_drop_client_->OnXdndEnter(xev->xclient); @@ -2315,6 +2398,15 @@ } void DesktopWindowTreeHostX11::DelayedResize(const gfx::Size& size_in_pixels) { + if (configure_counter_value_is_extended_ && + (current_counter_value_ % 2) == 0) { + // Increase the |extended_update_counter_|, so the compositor will know we + // are not frozen and re-enable _NET_WM_SYNC_REQUEST, if it was disabled. + // Increase the |extended_update_counter_| to an odd number will not trigger + // a new resize. + SyncSetCounter(xdisplay_, extended_update_counter_, + ++current_counter_value_); + } OnHostResizedInPixels(size_in_pixels); ResetWindowRegion(); delayed_resize_task_.Cancel(); @@ -2363,11 +2455,30 @@ } void DesktopWindowTreeHostX11::RestartDelayedResizeTask() { - delayed_resize_task_.Reset(base::BindOnce( - &DesktopWindowTreeHostX11::DelayedResize, - close_widget_factory_.GetWeakPtr(), bounds_in_pixels_.size())); - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, delayed_resize_task_.callback()); + if (update_counter_ == x11::None || configure_counter_value_ == 0) { + // WM doesn't support _NET_WM_SYNC_REQUEST. + // Or we are too slow, so _NET_WM_SYNC_REQUEST is disabled by the + // compositor. + delayed_resize_task_.Reset(base::BindOnce( + &DesktopWindowTreeHostX11::DelayedResize, + close_widget_factory_.GetWeakPtr(), bounds_in_pixels_.size())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, delayed_resize_task_.callback()); + return; + } + + if (configure_counter_value_is_extended_) { + current_counter_value_ = configure_counter_value_; + configure_counter_value_ = 0; + // Make sure the counter is even number. + if ((current_counter_value_ % 2) == 1) + ++current_counter_value_; + } + + // If _NET_WM_SYNC_REQUEST is used to synchronize with compositor during + // resizing, the compositor will not resize the window, until last resize is + // handled, so we don't need accumulate resize events. + DelayedResize(bounds_in_pixels_.size()); } aura::Window* DesktopWindowTreeHostX11::content_window() {
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h index 593cdfb..a855397 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -180,6 +180,8 @@ void MoveCursorToScreenLocationInPixels( const gfx::Point& location_in_pixels) override; void OnCursorVisibilityChangedNative(bool show) override; + void OnCompositingCompleteSwapWithNewSize(ui::Compositor* compositor, + const gfx::Size& size) override; // Overridden from display::DisplayObserver via aura::WindowTreeHost: void OnDisplayMetricsChanged(const display::Display& display, @@ -461,6 +463,16 @@ uint32_t modal_dialog_counter_ = 0; + // Used for synchronizing between |xwindow_| between desktop compositor during + // resizing. + XID update_counter_ = x11::None; + XID extended_update_counter_ = x11::None; + int64_t pending_counter_value_ = 0; + int64_t configure_counter_value_ = 0; + int64_t current_counter_value_ = 0; + bool pending_counter_value_is_extended_ = false; + bool configure_counter_value_is_extended_ = false; + base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_{this}; base::WeakPtrFactory<DesktopWindowTreeHostX11> weak_factory_{this};
diff --git a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html index 26d7aca6..c0b077d 100644 --- a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html +++ b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html
@@ -14,7 +14,6 @@ font-size: var(--cr-tabs-font-size, 14px); font-weight: 500; height: var(--cr-tabs-height); - outline: none; position: relative; user-select: none; } @@ -27,14 +26,19 @@ height: 100%; justify-content: center; opacity: .8; + outline: none; + transition: opacity 100ms cubic-bezier(.4, 0, 1, 1); } .selected { color: var(--google-blue-600); - font-weight: 700; opacity: 1; } + .selected:focus { + font-weight: 700; + } + :host-context([dark]) .selected { color: var(--google-blue-refresh-300); } @@ -70,9 +74,9 @@ </style> <template is="dom-repeat" items="[[tabNames]]" on-dom-change="updateSelectionBar_"> - <div class$="tab [[getTabCssClass_(index, selected)]]" - role="tab" aria-selected$="[[getTabAriaSelected_(index, selected)]]" - on-click="onTabClick_"> + <div class$="tab [[getCssClass_(index, selected)]]" role="tab" + aria-selected$="[[getAriaSelected_(index, selected)]]" + tabindex$="[[getTabIndex_(index, selected)]]" on-click="onTabClick_"> [[item]] </div> </template>
diff --git a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.js b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.js index a372a4a..be0ca2c 100644 --- a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.js +++ b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.js
@@ -11,8 +11,7 @@ * cr-tabs takes its #selectionBar animation from paper-tabs. * * Keyboard behavior - * - left/right changes the tab selection - * - space/enter selects the currently focused tab + * - Home, End, ArrowLeft and ArrowRight changes the tab selection * * Known limitations * - no "disabled" state for the cr-tabs as a whole or individual tabs @@ -43,7 +42,6 @@ hostAttributes: { role: 'tablist', - tabindex: 0, }, listeners: { @@ -66,7 +64,7 @@ * @return {string} * @private */ - getTabAriaSelected_: function(index) { + getAriaSelected_: function(index) { return this.selected == index ? 'true' : 'false'; }, @@ -75,25 +73,40 @@ * @return {string} * @private */ - getTabCssClass_: function(index) { + getCssClass_: function(index) { return this.selected == index ? 'selected' : ''; }, /** + * @param {number} index + * @return {number} + * @private + */ + getTabIndex_: function(index) { + return this.selected == index ? 0 : -1; + }, + + /** * @param {!KeyboardEvent} e * @private */ onKeyDown_: function(e) { - if (e.key != 'ArrowLeft' && e.key != 'ArrowRight') { + const count = this.tabNames.length; + let newSelection; + if (e.key == 'Home') { + newSelection = 0; + } else if (e.key == 'End') { + newSelection = count - 1; + } else if (e.key == 'ArrowLeft' || e.key == 'ArrowRight') { + const delta = e.key == 'ArrowLeft' ? (this.isRtl_ ? 1 : -1) : + (this.isRtl_ ? -1 : 1); + newSelection = (count + this.selected + delta) % count; + } else { return; } - e.preventDefault(); e.stopPropagation(); - const delta = - e.key == 'ArrowLeft' ? (this.isRtl_ ? 1 : -1) : (this.isRtl_ ? -1 : 1); - const count = this.tabNames.length; - this.selected = (count + this.selected + delta) % count; + this.selected = newSelection; }, /** @@ -124,6 +137,7 @@ return; } + selectedTab.focus(); this.$.selectionBar.classList.remove('expand', 'contract'); const {offsetLeft: selectedLeft, offsetWidth: selectedWidth} = selectedTab; const oldValue = this.lastSelected_;