diff --git a/.gn b/.gn index 15ddd275..95050bf 100644 --- a/.gn +++ b/.gn
@@ -93,7 +93,6 @@ "//extensions/browser/api/bluetooth_low_energy:*", # 22 errors "//extensions/browser/api/bluetooth_socket:*", # 12 errors "//extensions/browser/api/cast_channel:*", # 3 errors - "//extensions/browser/api/cec_private:*", # 4 errors "//extensions/browser/api/declarative:*", # 20 errors "//extensions/browser/api/declarative_content:*", # 2 errors "//extensions/browser/api/declarative_net_request:*", # 18 errors
diff --git a/DEPS b/DEPS index a4201b4..b23b0ad5 100644 --- a/DEPS +++ b/DEPS
@@ -199,7 +199,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '2a735ba1cb32d7688c73845e92cbc2173a3b98e4', + 'skia_revision': '8f282f5d9f30aeb5e3122735723b403203511370', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -211,15 +211,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': 'fa449cf3b0d00e411a47039408fd31389d79beb0', + 'angle_revision': '6e909d9407534e3b7e4eb42e49941256a14066b5', # 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': '2e89a70e3561793871480d971f4e958d04faf37a', + 'swiftshader_revision': '588d32cb3f172d1a6092c2b3c7e5a5c5d8b3b06e', # 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': '4f67a285e22100c9dc9d175e8269c8fed1734f34', + 'pdfium_revision': 'f3b585e8edf5b271445c1ef7ce07f461e87a038f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -274,7 +274,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '59450acba8d5e784fcce316100c2aa938a105604', + 'devtools_frontend_revision': 'ba12c16f393a978fe8d3f7ad9d9db4d3ad1125b0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -314,7 +314,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'c4efeef8333435ef770fdf72f3ffdca9d7d19bfc', + 'dawn_revision': 'c9a22bcb93db27e200a184c1f7b9bf0f288815c7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -893,7 +893,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '0e4e5ae5944afdca30a6228cb2b56c8298e07a70', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'c1aa4ecfcc8cbbbcf21e1b77125aa602339846ec', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1266,7 +1266,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '61125414310ae1df95fc378cd432071283783a81', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '35f78f4a4562f61cde3b096492628e1d47acb04e', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1485,7 +1485,7 @@ 'src/third_party/usrsctp/usrsctplib': Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + 'a3c3ef666b7a5e4c93ebae5a7462add6f86f5cf2', - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@a86dded0f15e65811c89bd2ccb27fd8c9aa1b47e', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@b229877c6d2dd194a61794fa12e69405b09d8677', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '6c656df63da5995a932aafd45b32af1974e497d9', @@ -1518,7 +1518,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '3c2fe3888658d82b47ca831d59a2e07579619c2d', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '644164c9c4b368d96bde2b3dcce68c57c2b7f749', + Var('webrtc_git') + '/src.git' + '@' + '783278a3109df8d2e362861e52fd0deea851633c', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1590,7 +1590,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@e12745c2764b5d739d8de2d7dd92687868396961', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@a51f14911dda538375d1f4da1925ce667ac3ca6f', 'condition': 'checkout_src_internal', },
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index 81d1569..92d6310 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -191,16 +191,6 @@ } } - // Used to record the UMA histogram Android.WebView.LoadDataWithBaseUrl.HistoryUrl. Since these - // values are persisted to logs, they should never be renumbered or reused. - @IntDef({HistoryUrl.EMPTY, HistoryUrl.BASEURL, HistoryUrl.DIFFERENT, HistoryUrl.COUNT}) - @interface HistoryUrl { - int EMPTY = 0; - int BASEURL = 1; - int DIFFERENT = 2; - int COUNT = 3; - } - // Used to record the UMA histogram Android.WebView.LoadDataWithBaseUrl.UrlScheme. Since these // values are persisted to logs, they should never be renumbered or reused. @VisibleForTesting @@ -1912,11 +1902,6 @@ return "base64".equals(encoding); } - private static void recordHistoryUrl(@HistoryUrl int value) { - RecordHistogram.recordEnumeratedHistogram( - "Android.WebView.LoadDataWithBaseUrl.HistoryUrl", value, HistoryUrl.COUNT); - } - private static void recordBaseUrl(@UrlScheme int value) { RecordHistogram.recordEnumeratedHistogram( DATA_BASE_URL_SCHEME_HISTOGRAM_NAME, value, UrlScheme.COUNT); @@ -2016,14 +2001,6 @@ baseUrl = fixupBase(baseUrl); historyUrl = fixupHistory(historyUrl); - if (historyUrl.equals(ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)) { - recordHistoryUrl(HistoryUrl.EMPTY); - } else if (historyUrl.equals(baseUrl)) { - recordHistoryUrl(HistoryUrl.BASEURL); - } else { - recordHistoryUrl(HistoryUrl.DIFFERENT); - } - recordBaseUrl(schemeForUrl(baseUrl)); if (baseUrl.startsWith("data:")) {
diff --git a/android_webview/test/shell/src/draw_fn/DEPS b/android_webview/test/shell/src/draw_fn/DEPS index d1fb631..a127cd33 100644 --- a/android_webview/test/shell/src/draw_fn/DEPS +++ b/android_webview/test/shell/src/draw_fn/DEPS
@@ -3,10 +3,4 @@ "+android_webview/public/browser", "+android_webview/test/draw_fn_impl_jni_headers", "+android_webview/test/shell/src/draw_fn", - - # For initializing GL bindings - "+android_webview/browser/gfx/gpu_service_webview.h", - - # For EGL bindings - "+ui/gl/gl_bindings.h", -] +] \ No newline at end of file
diff --git a/android_webview/test/shell/src/draw_fn/context_manager.cc b/android_webview/test/shell/src/draw_fn/context_manager.cc index cd981dd..4ed561f 100644 --- a/android_webview/test/shell/src/draw_fn/context_manager.cc +++ b/android_webview/test/shell/src/draw_fn/context_manager.cc
@@ -4,19 +4,104 @@ #include "android_webview/test/shell/src/draw_fn/context_manager.h" +#include <EGL/egl.h> +#include <GLES2/gl2.h> #include <android/native_window_jni.h> -#include "android_webview/browser/gfx/gpu_service_webview.h" #include "android_webview/public/browser/draw_fn.h" #include "android_webview/test/draw_fn_impl_jni_headers/ContextManager_jni.h" #include "android_webview/test/shell/src/draw_fn/allocator.h" #include "base/android/jni_array.h" #include "base/logging.h" +#include "base/native_library.h" #include "base/notreached.h" -#include "ui/gl/gl_bindings.h" +#include "base/threading/thread_restrictions.h" namespace draw_fn { +namespace { + +// TODO(penghuang): remove those proc types when EGL header is updated to 1.5. +typedef EGLBoolean(EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC)( + EGLDisplay dpy, + const EGLint* attrib_list, + EGLConfig* configs, + EGLint config_size, + EGLint* num_config); +typedef EGLContext(EGLAPIENTRYP PFNEGLCREATECONTEXTPROC)( + EGLDisplay dpy, + EGLConfig config, + EGLContext share_context, + const EGLint* attrib_list); +typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC)( + EGLDisplay dpy, + EGLConfig config, + EGLNativeWindowType win, + const EGLint* attrib_list); +typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC)(EGLDisplay dpy, + EGLContext ctx); +typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC)(EGLDisplay dpy, + EGLSurface surface); +typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETDISPLAYPROC)( + EGLNativeDisplayType display_id); +typedef __eglMustCastToProperFunctionPointerType( + EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC)(const char* procname); +typedef EGLBoolean(EGLAPIENTRYP PFNEGLMAKECURRENTPROC)(EGLDisplay dpy, + EGLSurface draw, + EGLSurface read, + EGLContext ctx); +typedef EGLBoolean(EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC)(EGLDisplay dpy, + EGLSurface surface); +typedef EGLBoolean(EGLAPIENTRYP PFNEGLBINDAPIPROC)(EGLenum api); + +PFNEGLGETPROCADDRESSPROC eglGetProcAddressFn = nullptr; +PFNEGLBINDAPIPROC eglBindAPIFn = nullptr; +PFNEGLGETDISPLAYPROC eglGetDisplayFn = nullptr; +PFNEGLMAKECURRENTPROC eglMakeCurrentFn = nullptr; +PFNEGLSWAPBUFFERSPROC eglSwapBuffersFn = nullptr; +PFNEGLCHOOSECONFIGPROC eglChooseConfigFn = nullptr; +PFNEGLCREATECONTEXTPROC eglCreateContextFn = nullptr; +PFNEGLDESTROYCONTEXTPROC eglDestroyContextFn = nullptr; +PFNEGLCREATEWINDOWSURFACEPROC eglCreateWindowSurfaceFn = nullptr; +PFNEGLDESTROYSURFACEPROC eglDestroySurfaceFn = nullptr; +PFNGLREADPIXELSPROC glReadPixelsFn = nullptr; + +template <typename T> +void AssignProc(T& fn, const char* name) { + fn = reinterpret_cast<T>(eglGetProcAddressFn(name)); + CHECK(fn) << "Failed to get " << name; +} + +void InitializeBindings() { + if (eglGetProcAddressFn) + return; + + base::ScopedAllowBlockingForTesting allow_blocking; + base::NativeLibraryLoadError error; + base::FilePath filename("libEGL.so"); + base::NativeLibrary egl_library = base::LoadNativeLibrary(filename, &error); + CHECK(egl_library) << "Failed to load " << filename.MaybeAsASCII() << ": " + << error.ToString(); + + eglGetProcAddressFn = reinterpret_cast<PFNEGLGETPROCADDRESSPROC>( + base::GetFunctionPointerFromNativeLibrary(egl_library, + "eglGetProcAddress")); + CHECK(eglGetProcAddressFn) << "Failed to get eglGetProcAddress."; + + AssignProc(eglBindAPIFn, "eglBindAPI"); + AssignProc(eglGetDisplayFn, "eglGetDisplay"); + AssignProc(eglMakeCurrentFn, "eglMakeCurrent"); + AssignProc(eglSwapBuffersFn, "eglSwapBuffers"); + AssignProc(eglChooseConfigFn, "eglChooseConfig"); + AssignProc(eglCreateContextFn, "eglCreateContext"); + AssignProc(eglDestroyContextFn, "eglDestroyContext"); + AssignProc(eglCreateWindowSurfaceFn, "eglCreateWindowSurface"); + AssignProc(eglDestroySurfaceFn, "eglDestroySurface"); + AssignProc(glReadPixelsFn, "glReadPixels"); +} + +} // namespace + static jlong JNI_ContextManager_GetDrawFnFunctionTable(JNIEnv* env) { return reinterpret_cast<intptr_t>(draw_fn::GetDrawFnFunctionTable()); } @@ -25,7 +110,9 @@ return reinterpret_cast<intptr_t>(new ContextManager); } -ContextManager::ContextManager() = default; +ContextManager::ContextManager() { + InitializeBindings(); +} ContextManager::~ContextManager() { DestroyContext(); @@ -67,7 +154,7 @@ } EGLDisplay GetDisplay() { - static EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); + static EGLDisplay display = eglGetDisplayFn(EGL_DEFAULT_DISPLAY); CHECK_NE(display, EGL_NO_DISPLAY); return display; } @@ -152,21 +239,21 @@ int quarter_width = width / 4; int quarter_height = height / 4; GLubyte bytes[4] = {}; - glReadPixels(quarter_width, quarter_height * 3, 1, 1, GL_RGBA, - GL_UNSIGNED_BYTE, bytes); + glReadPixelsFn(quarter_width, quarter_height * 3, 1, 1, GL_RGBA, + GL_UNSIGNED_BYTE, bytes); results[0] = rgbaToArgb(bytes); - glReadPixels(quarter_width * 3, quarter_height * 3, 1, 1, GL_RGBA, - GL_UNSIGNED_BYTE, bytes); + glReadPixelsFn(quarter_width * 3, quarter_height * 3, 1, 1, GL_RGBA, + GL_UNSIGNED_BYTE, bytes); results[1] = rgbaToArgb(bytes); - glReadPixels(quarter_width, quarter_height, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, - bytes); + glReadPixelsFn(quarter_width, quarter_height, 1, 1, GL_RGBA, + GL_UNSIGNED_BYTE, bytes); results[2] = rgbaToArgb(bytes); - glReadPixels(quarter_width * 3, quarter_height, 1, 1, GL_RGBA, - GL_UNSIGNED_BYTE, bytes); + glReadPixelsFn(quarter_width * 3, quarter_height, 1, 1, GL_RGBA, + GL_UNSIGNED_BYTE, bytes); results[3] = rgbaToArgb(bytes); } - CHECK(eglSwapBuffers(GetDisplay(), surface_)); + CHECK(eglSwapBuffersFn(GetDisplay(), surface_)); return readback_quadrants ? base::android::ToJavaIntArray(env, results) : nullptr; @@ -206,14 +293,14 @@ EGL_WINDOW_BIT | EGL_PBUFFER_BIT, EGL_NONE}; EGLint num_configs = 0; - if (!eglChooseConfig(GetDisplay(), config_attribs, nullptr, 0, - &num_configs) || + if (!eglChooseConfigFn(GetDisplay(), config_attribs, nullptr, 0, + &num_configs) || num_configs == 0) { continue; } - CHECK(eglChooseConfig(GetDisplay(), config_attribs, &config, 1, - &num_configs)); + CHECK(eglChooseConfigFn(GetDisplay(), config_attribs, &config, 1, + &num_configs)); use_es3 = try_es3; break; } @@ -227,9 +314,6 @@ void ContextManager::CreateContext( JNIEnv* env, const base::android::JavaRef<jobject>& surface) { - // Initialize bindings. - android_webview::GpuServiceWebView::GetInstance(); - java_surface_.Reset(surface); if (java_surface_.is_null()) return; @@ -242,8 +326,8 @@ std::vector<EGLint> egl_window_attributes; egl_window_attributes.push_back(EGL_NONE); surface_ = - eglCreateWindowSurface(GetDisplay(), GetConfig(&use_es3), - native_window_, &egl_window_attributes[0]); + eglCreateWindowSurfaceFn(GetDisplay(), GetConfig(&use_es3), + native_window_, &egl_window_attributes[0]); CHECK(surface_); } @@ -253,10 +337,10 @@ context_attributes.push_back(use_es3 ? 3 : 2); context_attributes.push_back(EGL_NONE); - CHECK(eglBindAPI(EGL_OPENGL_ES_API)); + CHECK(eglBindAPIFn(EGL_OPENGL_ES_API)); - context_ = eglCreateContext(GetDisplay(), GetConfig(&use_es3), nullptr, - context_attributes.data()); + context_ = eglCreateContextFn(GetDisplay(), GetConfig(&use_es3), nullptr, + context_attributes.data()); CHECK(context_); } } @@ -272,11 +356,11 @@ } DCHECK(context_); - CHECK(eglDestroyContext(GetDisplay(), context_)); + CHECK(eglDestroyContextFn(GetDisplay(), context_)); context_ = nullptr; DCHECK(surface_); - CHECK(eglDestroySurface(GetDisplay(), surface_)); + CHECK(eglDestroySurfaceFn(GetDisplay(), surface_)); surface_ = nullptr; ANativeWindow_release(native_window_); java_surface_.Reset(); @@ -285,7 +369,7 @@ void ContextManager::MakeCurrent() { DCHECK(surface_); DCHECK(context_); - CHECK(eglMakeCurrent(GetDisplay(), surface_, surface_, context_)); + CHECK(eglMakeCurrentFn(GetDisplay(), surface_, surface_, context_)); } } // namespace draw_fn
diff --git a/ash/accelerometer/accelerometer_file_reader.cc b/ash/accelerometer/accelerometer_file_reader.cc index 79feba2f..294e2a1 100644 --- a/ash/accelerometer/accelerometer_file_reader.cc +++ b/ash/accelerometer/accelerometer_file_reader.cc
@@ -373,7 +373,7 @@ // If we haven't yet passed the timeout cutoff, try this again. This will // be scheduled at the same rate as reading. if (base::TimeTicks::Now() < initialization_timeout_) { - blocking_task_runner_->PostDelayedTask( + ui_task_runner_->PostDelayedTask( FROM_HERE, base::BindOnce(&AccelerometerFileReader::TryScheduleInitialize, this),
diff --git a/ash/assistant/assistant_interaction_controller_impl.cc b/ash/assistant/assistant_interaction_controller_impl.cc index 2cb2463..43ca62a 100644 --- a/ash/assistant/assistant_interaction_controller_impl.cc +++ b/ash/assistant/assistant_interaction_controller_impl.cc
@@ -148,24 +148,6 @@ assistant_->StartTextInteraction(text, query_source, allow_tts); } -void AssistantInteractionControllerImpl::StartBloomInteraction() { - // TODO(jeroendh): Test. - StopActiveInteraction(false); - - AssistantUiController::Get()->ShowUi(AssistantEntryPoint::kBloom); - - OnInteractionStarted(AssistantInteractionMetadata( - AssistantInteractionType::kText, AssistantQuerySource::kBloom, - /*query=*/"processing query")); -} - -void AssistantInteractionControllerImpl::ShowBloomResult( - const std::string& html) { - // TODO(jeroendh) ensure we're in a bloom interaction - - OnHtmlResponse(html, /*fallback=*/""); -} - void AssistantInteractionControllerImpl::OnAssistantControllerConstructed() { AssistantUiController::Get()->GetModel()->AddObserver(this); assistant_controller_->view_delegate()->AddObserver(this);
diff --git a/ash/assistant/assistant_interaction_controller_impl.h b/ash/assistant/assistant_interaction_controller_impl.h index ff0345c..c83dc0b 100644 --- a/ash/assistant/assistant_interaction_controller_impl.h +++ b/ash/assistant/assistant_interaction_controller_impl.h
@@ -69,8 +69,6 @@ void StartTextInteraction(const std::string& text, bool allow_tts, AssistantQuerySource query_source) override; - void StartBloomInteraction() override; - void ShowBloomResult(const std::string& html) override; // AssistantControllerObserver: void OnAssistantControllerConstructed() override;
diff --git a/ash/assistant/util/assistant_util.cc b/ash/assistant/util/assistant_util.cc index e826342f..6ad78c7 100644 --- a/ash/assistant/util/assistant_util.cc +++ b/ash/assistant/util/assistant_util.cc
@@ -47,7 +47,6 @@ case AssistantEntryPoint::kProactiveSuggestions: case AssistantEntryPoint::kSetup: case AssistantEntryPoint::kStylus: - case AssistantEntryPoint::kBloom: return false; } }
diff --git a/ash/public/cpp/assistant/controller/assistant_interaction_controller.h b/ash/public/cpp/assistant/controller/assistant_interaction_controller.h index a282954..62f2a781 100644 --- a/ash/public/cpp/assistant/controller/assistant_interaction_controller.h +++ b/ash/public/cpp/assistant/controller/assistant_interaction_controller.h
@@ -41,10 +41,6 @@ bool allow_tts, chromeos::assistant::AssistantQuerySource source) = 0; - // Start Bloom interaction. - virtual void StartBloomInteraction() = 0; - virtual void ShowBloomResult(const std::string& html) = 0; - protected: AssistantInteractionController(); virtual ~AssistantInteractionController();
diff --git a/ash/public/cpp/holding_space/holding_space_constants.h b/ash/public/cpp/holding_space/holding_space_constants.h index 2f700e6..aea8462 100644 --- a/ash/public/cpp/holding_space/holding_space_constants.h +++ b/ash/public/cpp/holding_space/holding_space_constants.h
@@ -16,22 +16,13 @@ constexpr int kHoldingSpaceBubbleWidth = 360; constexpr gfx::Insets kHoldingSpaceChildBubblePadding(16); constexpr int kHoldingSpaceChildBubbleChildSpacing = 16; -constexpr gfx::Insets kHoldingSpaceChipPadding(8); -constexpr int kHoldingSpaceChipChildSpacing = 8; -constexpr int kHoldingSpaceChipHeight = 40; constexpr int kHoldingSpaceChipIconSize = 24; -constexpr int kHoldingSpaceChipWidth = 160; -constexpr int kHoldingSpaceChipLabelMaskGradientWidth = 16; -constexpr int kHoldingSpaceChipsPerRow = 2; -constexpr int kHoldingSpaceColumnSpacing = 8; -constexpr int kHoldingSpaceColumnWidth = 160; constexpr int kHoldingSpaceContextMenuMargin = 8; constexpr int kHoldingSpaceCornerRadius = 8; constexpr int kHoldingSpaceDownloadsChevronIconSize = 20; constexpr int kHoldingSpaceDownloadsHeaderSpacing = 16; constexpr int kHoldingSpaceFocusInsets = -2; constexpr int kHoldingSpaceIconSize = 20; -constexpr int kHoldingSpaceRowSpacing = 8; constexpr gfx::Insets kHoldingSpaceScreenCapturePadding(8); constexpr gfx::Size kHoldingSpaceScreenCapturePinButtonSize(24, 24); constexpr gfx::Size kHoldingSpaceScreenCapturePlayIconSize(32, 32);
diff --git a/ash/public/cpp/holding_space/holding_space_controller.cc b/ash/public/cpp/holding_space/holding_space_controller.cc index b444a565..bbbed40 100644 --- a/ash/public/cpp/holding_space/holding_space_controller.cc +++ b/ash/public/cpp/holding_space/holding_space_controller.cc
@@ -83,8 +83,10 @@ void HoldingSpaceController::SetModel(HoldingSpaceModel* model) { if (model_) { + HoldingSpaceModel* const old_model = model_; + model_ = nullptr; for (auto& observer : observers_) - observer.OnHoldingSpaceModelDetached(model_); + observer.OnHoldingSpaceModelDetached(old_model); } model_ = model;
diff --git a/ash/system/accessibility/select_to_speak_constants.h b/ash/system/accessibility/select_to_speak_constants.h index 89075c9..bc2deaa 100644 --- a/ash/system/accessibility/select_to_speak_constants.h +++ b/ash/system/accessibility/select_to_speak_constants.h
@@ -20,6 +20,8 @@ kSelectToSpeakSpeechRateFaster, }; +const char kSelectToSpeakSpeedBubbleWindowName[] = "SelectToSpeakSpeedBubble"; + } // namespace ash #endif // ASH_SYSTEM_ACCESSIBILITY_SELECT_TO_SPEAK_CONSTANTS_H_ \ No newline at end of file
diff --git a/ash/system/accessibility/select_to_speak_menu_bubble_controller.cc b/ash/system/accessibility/select_to_speak_menu_bubble_controller.cc index f3b4da5e..a41707d 100644 --- a/ash/system/accessibility/select_to_speak_menu_bubble_controller.cc +++ b/ash/system/accessibility/select_to_speak_menu_bubble_controller.cc
@@ -9,6 +9,7 @@ #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/accessibility/floating_menu_utils.h" +#include "ash/system/accessibility/select_to_speak_constants.h" #include "ash/system/tray/tray_background_view.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/unified/unified_system_tray_view.h" @@ -111,7 +112,11 @@ views::Widget* gained_widget = views::Widget::GetWidgetForNativeView(gained_active); - if (gained_widget == bubble_widget_ && menu_view_) { + if (gained_widget == bubble_widget_ && menu_view_ && + (!lost_active || + lost_active->GetName() != kSelectToSpeakSpeedBubbleWindowName)) { + // Reset initial focus of the menu view, unless we're coming from the + // reading speed selector. menu_view_->SetInitialFocus(); } } @@ -141,9 +146,10 @@ void SelectToSpeakMenuBubbleController::OnSpeechRateSelected( double speech_rate) { if (speed_bubble_controller_) { + menu_view_->SetSpeedButtonToggled(false); + menu_view_->SetSpeedButtonFocused(); speed_bubble_controller_->Hide(); speed_bubble_controller_.reset(); - menu_view_->SetSpeedButtonToggled(false); } Shell::Get()->accessibility_controller()->OnSelectToSpeakPanelAction( SelectToSpeakPanelAction::kChangeSpeed, /*value=*/speech_rate);
diff --git a/ash/system/accessibility/select_to_speak_menu_view.cc b/ash/system/accessibility/select_to_speak_menu_view.cc index 61bb1d4..5ec0354 100644 --- a/ash/system/accessibility/select_to_speak_menu_view.cc +++ b/ash/system/accessibility/select_to_speak_menu_view.cc
@@ -217,6 +217,10 @@ pause_button_->RequestFocus(); } +void SelectToSpeakMenuView::SetSpeedButtonFocused() { + speed_button_->RequestFocus(); +} + void SelectToSpeakMenuView::SetSpeedButtonToggled(bool toggled) { speed_button_->SetToggled(toggled); }
diff --git a/ash/system/accessibility/select_to_speak_menu_view.h b/ash/system/accessibility/select_to_speak_menu_view.h index 75102cab..b1bbc07c 100644 --- a/ash/system/accessibility/select_to_speak_menu_view.h +++ b/ash/system/accessibility/select_to_speak_menu_view.h
@@ -54,6 +54,8 @@ void SetInitialFocus(); + void SetSpeedButtonFocused(); + // Sets the speech rate that should be selected. void SetInitialSpeechRate(double initial_speech_rate);
diff --git a/ash/system/accessibility/select_to_speak_speed_bubble_controller.cc b/ash/system/accessibility/select_to_speak_speed_bubble_controller.cc index 9f18abc..297d758 100644 --- a/ash/system/accessibility/select_to_speak_speed_bubble_controller.cc +++ b/ash/system/accessibility/select_to_speak_speed_bubble_controller.cc
@@ -9,6 +9,7 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" #include "ash/system/accessibility/floating_menu_utils.h" +#include "ash/system/accessibility/select_to_speak_constants.h" #include "ash/system/accessibility/select_to_speak_speed_view.h" #include "ash/system/tray/tray_background_view.h" #include "ash/system/tray/tray_constants.h" @@ -67,6 +68,8 @@ bubble_widget_ = views::BubbleDialogDelegateView::CreateBubble(bubble_view_); + bubble_widget_->GetNativeView()->SetName( + kSelectToSpeakSpeedBubbleWindowName); TrayBackgroundView::InitializeBubbleAnimations(bubble_widget_); bubble_view_->InitializeAndShowBubble(); } else {
diff --git a/ash/system/accessibility/select_to_speak_speed_bubble_controller_unittest.cc b/ash/system/accessibility/select_to_speak_speed_bubble_controller_unittest.cc index 388a54e8..8173abb1 100644 --- a/ash/system/accessibility/select_to_speak_speed_bubble_controller_unittest.cc +++ b/ash/system/accessibility/select_to_speak_speed_bubble_controller_unittest.cc
@@ -174,4 +174,15 @@ EXPECT_EQ(client.last_select_to_speak_panel_action_value(), 6.2); } +TEST_F(SelectToSpeakSpeedBubbleControllerTest, FocusRestoredToSpeedButton) { + ShowSelectToSpeakSpeedBubble(/*rate=*/1.2); + + GetEventGenerator()->GestureTapAt( + GetOption(5)->GetBoundsInScreen().CenterPoint()); + + FloatingMenuButton* speed_button = + GetMenuButton(SelectToSpeakMenuView::ButtonId::kSpeed); + EXPECT_TRUE(speed_button->HasFocus()); +} + } // namespace ash \ No newline at end of file
diff --git a/ash/system/holding_space/holding_space_item_chip_view.cc b/ash/system/holding_space/holding_space_item_chip_view.cc index 8d1e1ee3..ed0fa29 100644 --- a/ash/system/holding_space/holding_space_item_chip_view.cc +++ b/ash/system/holding_space/holding_space_item_chip_view.cc
@@ -15,6 +15,7 @@ #include "ui/compositor/paint_recorder.h" #include "ui/gfx/skia_paint_util.h" #include "ui/views/background.h" +#include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" @@ -23,6 +24,14 @@ namespace ash { +// Appearance. +constexpr int kChildSpacing = 8; +constexpr int kLabelMaskGradientWidth = 16; +constexpr gfx::Insets kLabelMargins(0, 0, 0, /*right=*/2); +constexpr gfx::Insets kPadding(8, 8, 8, /*right=*/10); +constexpr int kPreferredHeight = 40; +constexpr int kPreferredWidth = 160; + // CirclePainter --------------------------------------------------------------- class CirclePainter : public views::Painter { @@ -91,9 +100,8 @@ flags.setAntiAlias(false); gfx::Point gradient_end(size.width() - kHoldingSpaceIconSize, 0); - gfx::Point gradient_start( - gradient_end.x() - kHoldingSpaceChipLabelMaskGradientWidth, - gradient_end.y()); + gfx::Point gradient_start(gradient_end.x() - kLabelMaskGradientWidth, + gradient_end.y()); flags.setShader(gfx::CreateGradientShader( gradient_start, gradient_end, SK_ColorBLACK, SK_ColorTRANSPARENT)); @@ -113,12 +121,11 @@ const HoldingSpaceItem* item) : HoldingSpaceItemView(delegate, item) { auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kHorizontal, - gfx::Insets(kHoldingSpaceChipPadding), kHoldingSpaceChipChildSpacing)); + views::BoxLayout::Orientation::kHorizontal, kPadding, kChildSpacing)); layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kCenter); - SetPreferredSize(gfx::Size(kHoldingSpaceChipWidth, kHoldingSpaceChipHeight)); + SetPreferredSize(gfx::Size(kPreferredWidth, kPreferredHeight)); image_ = AddChildView(std::make_unique<RoundedImageView>( kHoldingSpaceChipIconSize / 2, RoundedImageView::Alignment::kLeading)); @@ -145,6 +152,7 @@ label_ = label_and_pin_button_container_->AddChildView( holding_space_util::CreateLabel(holding_space_util::LabelStyle::kChip)); + label_->SetBorder(views::CreateEmptyBorder(kLabelMargins)); label_->SetElideBehavior(gfx::ELIDE_MIDDLE); label_->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); label_->SetText(item->text()); @@ -172,6 +180,13 @@ HoldingSpaceItemChipView::~HoldingSpaceItemChipView() = default; +views::View* HoldingSpaceItemChipView::GetTooltipHandlerForPoint( + const gfx::Point& point) { + // Tooltips for this view are handled by `label_`, which will only show + // tooltips if the underlying text has been elided due to insufficient space. + return HitTestPoint(point) ? label_ : nullptr; +} + void HoldingSpaceItemChipView::OnHoldingSpaceItemUpdated( const HoldingSpaceItem* item) { HoldingSpaceItemView::OnHoldingSpaceItemUpdated(item);
diff --git a/ash/system/holding_space/holding_space_item_chip_view.h b/ash/system/holding_space/holding_space_item_chip_view.h index f5a1343..3877ec6 100644 --- a/ash/system/holding_space/holding_space_item_chip_view.h +++ b/ash/system/holding_space/holding_space_item_chip_view.h
@@ -38,6 +38,7 @@ class LabelMaskLayerOwner; // HoldingSpaceItemView: + views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; void OnHoldingSpaceItemUpdated(const HoldingSpaceItem* item) override; void OnPinVisiblityChanged(bool pin_visible) override;
diff --git a/ash/system/holding_space/holding_space_item_chips_container.cc b/ash/system/holding_space/holding_space_item_chips_container.cc index d0c0a15..1c3e51d 100644 --- a/ash/system/holding_space/holding_space_item_chips_container.cc +++ b/ash/system/holding_space/holding_space_item_chips_container.cc
@@ -12,6 +12,10 @@ namespace ash { namespace { +// Appearance. +constexpr int kNumberOfChipsPerRow = 2; +constexpr int kSpacing = 8; + // Need a custom grid layout to facilitate removal of views from the grid, // which can change the number of rows required. views::GridLayout makes this // case difficult. @@ -110,8 +114,8 @@ HoldingSpaceItemChipsContainer::HoldingSpaceItemChipsContainer() { SetLayoutManager(std::make_unique<SimpleGridLayout>( - kHoldingSpaceChipsPerRow, kHoldingSpaceColumnSpacing, - kHoldingSpaceRowSpacing)); + kNumberOfChipsPerRow, /*column_spacing=*/kSpacing, + /*row_spacing=*/kSpacing)); } HoldingSpaceItemChipsContainer::~HoldingSpaceItemChipsContainer() = default;
diff --git a/ash/system/holding_space/holding_space_item_screen_capture_view.cc b/ash/system/holding_space/holding_space_item_screen_capture_view.cc index 9afbb76..610fa2b 100644 --- a/ash/system/holding_space/holding_space_item_screen_capture_view.cc +++ b/ash/system/holding_space/holding_space_item_screen_capture_view.cc
@@ -66,6 +66,24 @@ HoldingSpaceItemScreenCaptureView::~HoldingSpaceItemScreenCaptureView() = default; +views::View* HoldingSpaceItemScreenCaptureView::GetTooltipHandlerForPoint( + const gfx::Point& point) { + // Tooltip events should be handled top level, not by descendents. + return HitTestPoint(point) ? this : nullptr; +} + +base::string16 HoldingSpaceItemScreenCaptureView::GetTooltipText( + const gfx::Point& point) const { + return item()->text(); +} + +void HoldingSpaceItemScreenCaptureView::OnHoldingSpaceItemUpdated( + const HoldingSpaceItem* item) { + HoldingSpaceItemView::OnHoldingSpaceItemUpdated(item); + if (this->item() == item) + TooltipTextChanged(); +} + void HoldingSpaceItemScreenCaptureView::UpdateImage() { image_->SetImage( item()->image().GetImageSkia(kHoldingSpaceScreenCaptureSize));
diff --git a/ash/system/holding_space/holding_space_item_screen_capture_view.h b/ash/system/holding_space/holding_space_item_screen_capture_view.h index 87ddf45d..86dbe49 100644 --- a/ash/system/holding_space/holding_space_item_screen_capture_view.h +++ b/ash/system/holding_space/holding_space_item_screen_capture_view.h
@@ -30,6 +30,11 @@ ~HoldingSpaceItemScreenCaptureView() override; private: + // HoldingSpaceItemView: + views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; + base::string16 GetTooltipText(const gfx::Point& point) const override; + void OnHoldingSpaceItemUpdated(const HoldingSpaceItem* item) override; + void UpdateImage(); // Overlays a play icon over `image_`.
diff --git a/ash/system/holding_space/holding_space_tray.cc b/ash/system/holding_space/holding_space_tray.cc index 903cac8f..5daa7d15 100644 --- a/ash/system/holding_space/holding_space_tray.cc +++ b/ash/system/holding_space/holding_space_tray.cc
@@ -59,7 +59,6 @@ kHoldingSpaceIcon, kHoldingSpaceTrayIconSize, AshColorProvider::Get()->GetContentLayerColor( AshColorProvider::ContentLayerType::kIconColorPrimary))); - icon->SetTooltipText(l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE)); icon->SetPreferredSize(gfx::Size(kTrayItemSize, kTrayItemSize)); return icon; } @@ -111,11 +110,18 @@ return l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_A11Y_NAME); } +views::View* HoldingSpaceTray::GetTooltipHandlerForPoint( + const gfx::Point& point) { + // Tooltip events should be handled top level, not by descendents. + return HitTestPoint(point) ? this : nullptr; +} + +base::string16 HoldingSpaceTray::GetTooltipText(const gfx::Point& point) const { + return l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE); +} + void HoldingSpaceTray::HandleLocaleChange() { - default_tray_icon_->SetTooltipText( - l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE)); - if (previews_tray_icon_) - previews_tray_icon_->OnLocaleChanged(); + TooltipTextChanged(); } void HoldingSpaceTray::HideBubbleWithView(const TrayBubbleView* bubble_view) {} @@ -195,12 +201,16 @@ } } +void HoldingSpaceTray::FirePreviewsUpdateTimerIfRunningForTesting() { + if (previews_update_.IsRunning()) + previews_update_.FireNow(); +} + void HoldingSpaceTray::UpdateVisibility() { HoldingSpaceModel* model = HoldingSpaceController::Get()->model(); LoginStatus login_status = shelf()->GetStatusAreaWidget()->login_status(); const bool in_active_session = login_status != LoginStatus::NOT_LOGGED_IN && login_status != LoginStatus::LOCKED; - if (!model || !in_active_session) { SetVisiblePreferred(false); return; @@ -378,6 +388,9 @@ DCHECK(previews_tray_icon_); previews_tray_icon_->SetVisible(show_previews); + + if (!show_previews) + previews_update_.Stop(); } void HoldingSpaceTray::SchedulePreviewsIconUpdate() {
diff --git a/ash/system/holding_space/holding_space_tray.h b/ash/system/holding_space/holding_space_tray.h index 2cc03fb..935accb 100644 --- a/ash/system/holding_space/holding_space_tray.h +++ b/ash/system/holding_space/holding_space_tray.h
@@ -58,6 +58,8 @@ // TrayBackgroundView: void ClickedOutsideBubble() override; base::string16 GetAccessibleNameForTray() override; + views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; + base::string16 GetTooltipText(const gfx::Point& point) const override; void HandleLocaleChange() override; void HideBubbleWithView(const TrayBubbleView* bubble_view) override; void AnchorUpdated() override; @@ -72,6 +74,8 @@ use_zero_previews_update_delay_ = zero_delay; } + void FirePreviewsUpdateTimerIfRunningForTesting(); + private: void UpdateVisibility();
diff --git a/ash/system/holding_space/holding_space_tray_icon.cc b/ash/system/holding_space/holding_space_tray_icon.cc index 4f0c4e6..5370da4 100644 --- a/ash/system/holding_space/holding_space_tray_icon.cc +++ b/ash/system/holding_space/holding_space_tray_icon.cc
@@ -121,15 +121,6 @@ removed_previews_.clear(); } -void HoldingSpaceTrayIcon::OnLocaleChanged() { - TooltipTextChanged(); -} - -base::string16 HoldingSpaceTrayIcon::GetTooltipText( - const gfx::Point& point) const { - return l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE); -} - int HoldingSpaceTrayIcon::GetHeightForWidth(int width) const { // The parent for this view (`TrayContainer`) uses a `BoxLayout` for its // `LayoutManager`. When the shelf orientation is vertical, the `BoxLayout`
diff --git a/ash/system/holding_space/holding_space_tray_icon.h b/ash/system/holding_space/holding_space_tray_icon.h index e738b488..4a358d6 100644 --- a/ash/system/holding_space/holding_space_tray_icon.h +++ b/ash/system/holding_space/holding_space_tray_icon.h
@@ -43,9 +43,6 @@ // 4. Animate new items in. void UpdatePreviews(const std::vector<const HoldingSpaceItem*> items); - // Invoked when the system locale has changed. - void OnLocaleChanged(); - // Clears the icon. void Clear(); @@ -63,7 +60,6 @@ class ResizeAnimation; // views::View: - base::string16 GetTooltipText(const gfx::Point& point) const override; int GetHeightForWidth(int width) const override; gfx::Size CalculatePreferredSize() const override;
diff --git a/ash/system/holding_space/holding_space_tray_unittest.cc b/ash/system/holding_space/holding_space_tray_unittest.cc index 0496a3cc..3985105 100644 --- a/ash/system/holding_space/holding_space_tray_unittest.cc +++ b/ash/system/holding_space/holding_space_tray_unittest.cc
@@ -17,6 +17,9 @@ #include "ash/public/cpp/holding_space/holding_space_model.h" #include "ash/public/cpp/holding_space/holding_space_prefs.h" #include "ash/public/cpp/holding_space/holding_space_test_api.h" +#include "ash/shelf/shelf.h" +#include "ash/shelf/shelf_widget.h" +#include "ash/shell.h" #include "ash/system/holding_space/holding_space_item_view.h" #include "ash/test/ash_test_base.h" #include "base/files/file_path.h" @@ -37,6 +40,11 @@ // Helpers --------------------------------------------------------------------- +// A wrapper around `views::View::GetVisible()` with a null check for `view`. +bool IsViewVisible(views::View* view) { + return view && view->GetVisible(); +} + void Click(views::View* view, int flags) { auto* root_window = view->GetWidget()->GetNativeWindow()->GetRootWindow(); ui::test::EventGenerator event_generator(root_window); @@ -139,6 +147,12 @@ HoldingSpaceItem* AddItem(HoldingSpaceItem::Type type, const base::FilePath& path) { + return AddItemToModel(model(), type, path); + } + + HoldingSpaceItem* AddItemToModel(HoldingSpaceModel* target_model, + HoldingSpaceItem::Type type, + const base::FilePath& path) { GURL file_system_url( base::StrCat({"filesystem:", path.BaseName().value()})); std::unique_ptr<HoldingSpaceItem> item = @@ -146,10 +160,9 @@ type, path, file_system_url, base::BindOnce(&CreateStubHoldingSpaceImage)); HoldingSpaceItem* item_ptr = item.get(); - model()->AddItem(std::move(item)); + target_model->AddItem(std::move(item)); return item_ptr; } - HoldingSpaceItem* AddPartiallyInitializedItem(HoldingSpaceItem::Type type, const base::FilePath& path) { // Create a holding space item, and use it to create a serialized item @@ -195,6 +208,30 @@ GetSessionControllerClient()->GetUserPrefService(user_account)); } + void SwitchToSecondaryUser(const std::string& user_id, + HoldingSpaceClient* client, + HoldingSpaceModel* model) { + AccountId user_account = AccountId::FromUserEmail(user_id); + HoldingSpaceController::Get()->RegisterClientAndModelForUser(user_account, + client, model); + GetSessionControllerClient()->AddUserSession(user_id); + + holding_space_prefs::MarkTimeOfFirstAvailability( + GetSessionControllerClient()->GetUserPrefService(user_account)); + holding_space_prefs::MarkTimeOfFirstAdd( + GetSessionControllerClient()->GetUserPrefService(user_account)); + holding_space_prefs::MarkTimeOfFirstPin( + GetSessionControllerClient()->GetUserPrefService(user_account)); + + GetSessionControllerClient()->SwitchActiveUser(user_account); + } + + void UnregisterModelForUser(const std::string& user_id) { + AccountId user_account = AccountId::FromUserEmail(user_id); + HoldingSpaceController::Get()->RegisterClientAndModelForUser( + user_account, nullptr, nullptr); + } + bool IsPreviewsFeatureEnabled() const { return GetParam(); } HoldingSpaceTestApi* test_api() { return test_api_.get(); } @@ -205,6 +242,13 @@ HoldingSpaceModel* model() { return &holding_space_model_; } + HoldingSpaceTray* GetTray() { + return Shelf::ForWindow(Shell::GetRootWindowForNewWindows()) + ->shelf_widget() + ->status_area_widget() + ->holding_space_tray(); + } + private: std::unique_ptr<HoldingSpaceTestApi> test_api_; testing::NiceMock<MockHoldingSpaceClient> holding_space_client_; @@ -216,6 +260,7 @@ TEST_P(HoldingSpaceTrayTest, ShowTrayButtonOnFirstUse) { StartSession(/*pre_mark_time_of_first_add=*/false); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); // The tray button should *not* be shown for users that have never added // anything to the holding space. @@ -225,7 +270,12 @@ HoldingSpaceItem* item = AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake")); MarkTimeOfFirstAdd(); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); // Show the bubble - both the pinned files and recent files child bubbles // should be shown. @@ -242,6 +292,9 @@ test_api()->Close(); EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_TRUE(IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_FALSE(IsViewVisible(test_api()->GetPreviewsTrayIcon())); + test_api()->Show(); // Add and remove a pinned item. @@ -256,6 +309,92 @@ EXPECT_FALSE(test_api()->IsShowingInShelf()); } +TEST_P(HoldingSpaceTrayTest, HideButtonWhenModelDetached) { + MarkTimeOfFirstPin(); + StartSession(); + + // The tray button should be hidden if the user has previously pinned an item, + // and the holding space is empty. + EXPECT_FALSE(test_api()->IsShowingInShelf()); + + // Add a download item - the button should be shown. + AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1")); + EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + + SwitchToSecondaryUser("user@secondary", /*client=*/nullptr, + /*model=*/nullptr); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); + + EXPECT_FALSE(test_api()->IsShowingInShelf()); + UnregisterModelForUser("user@secondary"); +} + +TEST_P(HoldingSpaceTrayTest, HideButtonOnChangeToEmptyModel) { + MarkTimeOfFirstPin(); + StartSession(); + + // The tray button should be hidden if the user has previously pinned an item, + // and the holding space is empty. + EXPECT_FALSE(test_api()->IsShowingInShelf()); + + // Add a download item - the button should be shown. + AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1")); + EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + + HoldingSpaceModel secondary_holding_space_model; + SwitchToSecondaryUser("user@secondary", /*client=*/nullptr, + /*model=*/&secondary_holding_space_model); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); + EXPECT_FALSE(test_api()->IsShowingInShelf()); + + AddItemToModel(&secondary_holding_space_model, + HoldingSpaceItem::Type::kDownload, + base::FilePath("/tmp/fake_2")); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); + EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + + UnregisterModelForUser("user@secondary"); +} + +TEST_P(HoldingSpaceTrayTest, HideButtonOnChangeToNonEmptyModel) { + MarkTimeOfFirstPin(); + StartSession(); + + // The tray button should be hidden if the user has previously pinned an item, + // and the holding space is empty. + EXPECT_FALSE(test_api()->IsShowingInShelf()); + + HoldingSpaceModel secondary_holding_space_model; + AddItemToModel(&secondary_holding_space_model, + HoldingSpaceItem::Type::kDownload, + base::FilePath("/tmp/fake_2")); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); + EXPECT_FALSE(test_api()->IsShowingInShelf()); + + SwitchToSecondaryUser("user@secondary", /*client=*/nullptr, + /*model=*/&secondary_holding_space_model); + EXPECT_TRUE(test_api()->IsShowingInShelf()); + + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + + UnregisterModelForUser("user@secondary"); +} + TEST_P(HoldingSpaceTrayTest, AddingItemShowsTrayBubble) { MarkTimeOfFirstPin(); StartSession(); @@ -267,25 +406,45 @@ // Add a download item - the button should be shown. HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1")); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + // Remove the only item - the button should be hidden. model()->RemoveItem(item_1->id()); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_FALSE(test_api()->IsShowingInShelf()); // Add a screen capture item - the button should be shown. HoldingSpaceItem* item_2 = AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_2")); EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + // Remove the only item - the button should be hidden. model()->RemoveItem(item_2->id()); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_FALSE(test_api()->IsShowingInShelf()); // Add a pinned item - the button should be shown. HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_3")); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); + // Remove the only item - the button should be hidden. model()->RemoveItem(item_3->id()); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_FALSE(test_api()->IsShowingInShelf()); } @@ -309,15 +468,22 @@ EXPECT_FALSE(test_api()->IsShowingInShelf()); AddPartiallyInitializedItem(HoldingSpaceItem::Type::kPinnedFile, base::FilePath("/tmp/fake_4")); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_FALSE(test_api()->IsShowingInShelf()); // Finalize one item, and verify the tray button gets shown. model()->FinalizeOrRemoveItem(item_2->id(), GURL("filesystem:fake_2")); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_TRUE(test_api()->IsShowingInShelf()); + EXPECT_EQ(!IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetDefaultTrayIcon())); + EXPECT_EQ(IsPreviewsFeatureEnabled(), + IsViewVisible(test_api()->GetPreviewsTrayIcon())); // Remove the finalized item - the shelf button should get hidden. model()->RemoveItem(item_2->id()); + GetTray()->FirePreviewsUpdateTimerIfRunningForTesting(); EXPECT_FALSE(test_api()->IsShowingInShelf()); }
diff --git a/base/allocator/allocator_shim.h b/base/allocator/allocator_shim.h index 2cdcfad..9a33d005 100644 --- a/base/allocator/allocator_shim.h +++ b/base/allocator/allocator_shim.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_features.h" #include "base/base_export.h" #include "build/build_config.h" @@ -163,9 +164,8 @@ BASE_EXPORT void EnablePartitionAllocMemoryReclaimer(); #endif -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && ALLOW_PCSCAN BASE_EXPORT void EnablePCScan(); -BASE_EXPORT void EnablePCScanIfNeeded(); #endif } // namespace allocator
diff --git a/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc b/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc index 20c07457..d93b4ced 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc
@@ -278,10 +278,12 @@ AlignedAllocator()); } +#if ALLOW_PCSCAN void EnablePCScan() { Allocator()->EnablePCScan(); AlignedAllocator()->EnablePCScan(); } +#endif #if defined(OS_WIN) // Call this as soon as possible during startup. @@ -293,12 +295,6 @@ } #endif // defined(OS_WIN) -void EnablePCScanIfNeeded() { - if (!features::IsPartitionAllocPCScanEnabled()) - return; - EnablePCScan(); -} - } // namespace allocator } // namespace base
diff --git a/base/allocator/partition_allocator/partition_alloc_features.cc b/base/allocator/partition_allocator/partition_alloc_features.cc index a32aa19..66e834d 100644 --- a/base/allocator/partition_allocator/partition_alloc_features.cc +++ b/base/allocator/partition_allocator/partition_alloc_features.cc
@@ -20,16 +20,18 @@ FEATURE_ENABLED_BY_DEFAULT}; #endif +#if ALLOW_PCSCAN // If enabled, PCScan is turned on by default for all partitions that don't // disable it explicitly. const Feature kPartitionAllocPCScan{"PartitionAllocPCScan", FEATURE_DISABLED_BY_DEFAULT}; +#endif // ALLOW_PCSCAN #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) // If enabled, PCScan is turned on only for the browser's malloc partition. const Feature kPartitionAllocPCScanBrowserOnly{ "PartitionAllocPCScanBrowserOnly", FEATURE_DISABLED_BY_DEFAULT}; -#endif +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) } // namespace features } // namespace base
diff --git a/base/allocator/partition_allocator/partition_alloc_features.h b/base/allocator/partition_allocator/partition_alloc_features.h index cada8485..ab9ae7e 100644 --- a/base/allocator/partition_allocator/partition_alloc_features.h +++ b/base/allocator/partition_allocator/partition_alloc_features.h
@@ -20,6 +20,12 @@ #include <VersionHelpers.h> #endif +#if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR +#define ALLOW_PCSCAN 1 +#else +#define ALLOW_PCSCAN 0 +#endif + namespace base { struct Feature; @@ -27,10 +33,13 @@ namespace features { extern const BASE_EXPORT Feature kPartitionAllocGigaCage; + +#if ALLOW_PCSCAN extern const BASE_EXPORT Feature kPartitionAllocPCScan; +#endif // ALLOW_PCSCAN #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) extern const BASE_EXPORT Feature kPartitionAllocPCScanBrowserOnly; -#endif +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) ALWAYS_INLINE bool IsPartitionAllocGigaCageEnabled() { #if defined(PA_HAS_64_BITS_POINTERS) && defined(OS_WIN) @@ -64,24 +73,6 @@ #endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) } -ALWAYS_INLINE bool IsPartitionAllocPCScanEnabled() { -#if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR - return FeatureList::IsEnabled(kPartitionAllocPCScan); -#else // PA_HAS_64_BITS_POINTERS - return false; -#endif -} - -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) -ALWAYS_INLINE bool IsPartitionAllocPCScanBrowserOnlyEnabled() { -#if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR - return FeatureList::IsEnabled(kPartitionAllocPCScanBrowserOnly); -#else // PA_HAS_64_BITS_POINTERS - return false; -#endif -} -#endif - } // namespace features } // namespace base
diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc index be331b3e..b266ceb 100644 --- a/base/allocator/partition_allocator/partition_root.cc +++ b/base/allocator/partition_allocator/partition_root.cc
@@ -4,10 +4,10 @@ #include "base/allocator/partition_allocator/partition_root.h" -#include "base/allocator/partition_allocator/checked_ptr_support.h" #include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" +#include "base/allocator/partition_allocator/partition_alloc_features.h" #include "base/allocator/partition_allocator/partition_bucket.h" #include "base/allocator/partition_allocator/partition_cookie.h" #include "base/allocator/partition_allocator/partition_oom.h" @@ -25,10 +25,9 @@ typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode( PartitionOptions::PCScan opt) { using Root = PartitionRoot<thread_safe>; - // PCScan is currently only supported on 64-bit systems. - // Mark partitions non-scannable on 32-bit systems unconditionally, so that - // address space for quarantine bitmaps doesn't get reserved. -#if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR + // Mark partitions non-scannable unconditionally when PCScan isn't allowed, so + // that address space for quarantine bitmaps doesn't get reserved. +#if ALLOW_PCSCAN switch (opt) { case PartitionOptions::PCScan::kAlwaysDisabled: return Root::PCScanMode::kNonScannable;
diff --git a/base/allocator/partition_allocator/pcscan_unittest.cc b/base/allocator/partition_allocator/pcscan_unittest.cc index 16de3e0..05f8dc7 100644 --- a/base/allocator/partition_allocator/pcscan_unittest.cc +++ b/base/allocator/partition_allocator/pcscan_unittest.cc
@@ -4,13 +4,15 @@ #include "base/allocator/partition_allocator/partition_root.h" #if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) -#if defined(PA_HAS_64_BITS_POINTERS) #include "base/allocator/partition_allocator/pcscan.h" #include "base/allocator/partition_allocator/partition_alloc.h" +#include "base/allocator/partition_allocator/partition_alloc_features.h" #include "testing/gtest/include/gtest/gtest.h" +#if ALLOW_PCSCAN + namespace base { namespace internal { @@ -330,5 +332,5 @@ } // namespace internal } // namespace base -#endif // defined(PA_HAS_64_BITS_POINTERS) +#endif // ALLOW_PCSCAN #endif // defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 3629cf1..e163596 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -0.20210108.1.1 +0.20210108.2.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 3629cf1..e163596 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -0.20210108.1.1 +0.20210108.2.1
diff --git a/chrome/VERSION b/chrome/VERSION index e372072..976092f 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=89 MINOR=0 -BUILD=4383 +BUILD=4384 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 6c7a2402..5e9796b 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -906,6 +906,7 @@ "//components/omnibox/browser:browser_java", "//components/optimization_guide/proto:optimization_guide_proto_java", "//components/page_info/android:java", + "//components/paint_preview/player/android:java", "//components/payments/content/android:java", "//components/payments/content/android:service_java", "//components/payments/mojom:mojom_java", @@ -969,7 +970,7 @@ "//url/mojom:url_mojom_gurl_java", ] - deps += feed_test_deps + deps += chrome_junit_test_java_deps data_deps = [ "//testing/buildbot/filters:chrome_junit_tests_filters" ]
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java index 67b4849..dbca556 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java
@@ -788,6 +788,7 @@ // clang-format off @CommandLineFlags.Add({BASE_PARAMS + "/single/exclude_mv_tiles/true" + "/show_last_active_tab_only/true/show_stack_tab_switcher/true"}) + @DisabledTest(message = "https://crbug.com/1164485") public void testShow_SingleAsTabSwitcher_V2() { // clang-format on if (mImmediateReturn) {
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index deecf8c..0407e32 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -46,9 +46,7 @@ <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> - {% if target_sdk_version|int > 27 or target_sdk_version == "Q" %} - <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> - {% endif %} + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index b5a8a66..01620861 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -41,6 +41,8 @@ chrome_test_java_sources += tab_management_test_java_sources chrome_test_java_sources += share_test_java_sources chrome_junit_test_java_sources += share_junit_test_java_sources +chrome_junit_test_java_deps = share_junit_test_java_deps +chrome_junit_test_java_deps += feed_test_deps if (enable_arcore) { chrome_java_sources += [
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 8717e22..b26d6013 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -360,6 +360,12 @@ <message name="IDS_CELLULAR_SETUP_CLOSE_EID_POPUP_BUTTON_LABEL" desc="A11y and tooltip label for EID and QR code popup close button when viewing EID and QR code popup"> Close EID and QR code popup </message> + <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_MESSAGE" desc="Message, prompting the user to enter the confirmation code to activate an eSIM profile."> + Please enter your confirmation code for <ph name="PROFILE_NAME">$1<ex>Google Fi</ex></ph>. + </message> + <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_INPUT" desc="Label for the input used to enter the confirmation code to activate an eSIM profile."> + Confirmation code + </message> <!-- Upgrade notifications --> <message name="IDS_RELAUNCH_REQUIRED_TITLE_DAYS" desc="The title of a dialog that tells users the device must be restarted within two or more days.">
diff --git a/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_INPUT.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_INPUT.png.sha1 new file mode 100644 index 0000000..51e7421 --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_INPUT.png.sha1
@@ -0,0 +1 @@ +010932e9ce938b6970f3c0c11b363376d1168b0d \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_MESSAGE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_MESSAGE.png.sha1 new file mode 100644 index 0000000..51e7421 --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_MESSAGE.png.sha1
@@ -0,0 +1 @@ +010932e9ce938b6970f3c0c11b363376d1168b0d \ No newline at end of file
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 57c66276..7cdf325 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd
@@ -1231,6 +1231,11 @@ Chromium OS can always restore your apps & pages after reboot without asking every time. </message> </if> + + <!-- ChromeBeta bubble --> + <message name="IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE" desc="Text that shows in the footer of the Chrome Beta bubble when relaunch is needed for changes to take effect."> + Your changes will take effect the next time you relaunch Chromium. + </message> </messages> </release> </grit>
diff --git a/chrome/app/chromium_strings_grd/IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE.png.sha1 b/chrome/app/chromium_strings_grd/IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE.png.sha1 new file mode 100644 index 0000000..51fd860 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE.png.sha1
@@ -0,0 +1 @@ +9fe5fe3f47d4059771289e9db8419e8e86cf26cc \ No newline at end of file
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 2c075d95..362410e 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -11103,6 +11103,12 @@ desc="Menu item to launch the Chrome watch feature"> Watch </message> + + <!-- ChromeBeta bubble --> + <message name="IDS_CHROMEBETA_RELAUNCH_BUTTON_LABEL" + desc="Label on the button in the footer of the Chrome Beta bubble which will relaunch the browser."> + Relaunch + </message> </messages> </release> </grit>
diff --git a/chrome/app/generated_resources_grd/IDS_CHROMEBETA_RELAUNCH_BUTTON_LABEL.png.sha1 b/chrome/app/generated_resources_grd/IDS_CHROMEBETA_RELAUNCH_BUTTON_LABEL.png.sha1 new file mode 100644 index 0000000..895df59 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_CHROMEBETA_RELAUNCH_BUTTON_LABEL.png.sha1
@@ -0,0 +1 @@ +5d829aaebb289b5e55b0c4e88dc0e5ca9c8549c3 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index e9da47f7..490f486 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -1247,6 +1247,11 @@ Chrome OS can always restore your apps & pages after reboot without asking every time. </message> </if> + + <!-- ChromeBeta bubble --> + <message name="IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE" desc="Text that shows in the footer of the Chrome Beta bubble when relaunch is needed for changes to take effect."> + Your changes will take effect the next time you relaunch Google Chrome. + </message> </messages> </release> </grit>
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE.png.sha1 new file mode 100644 index 0000000..51fd860 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE.png.sha1
@@ -0,0 +1 @@ +9fe5fe3f47d4059771289e9db8419e8e86cf26cc \ No newline at end of file
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 68b872e..06b76986 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -981,6 +981,18 @@ <message name="IDS_SETTINGS_ASSIGN_PREVIOUS_SWITCH_LABEL" desc="Label for the setting to assign a switch to the action 'Previous', which moves focus to the previous element."> Previous </message> + <message name="IDS_SETTINGS_SWITCH_ACCESS_INTERNAL_DEVICE_TYPE_LABEL" desc="Label to apply to a switch key from the built-in keyboard. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> + Built-in Keyboard + </message> + <message name="IDS_SETTINGS_SWITCH_ACCESS_USB_DEVICE_TYPE_LABEL" desc="Label to apply to a switch key from a USB device. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> + USB + </message> + <message name="IDS_SETTINGS_SWITCH_ACCESS_BLUETOOTH_DEVICE_TYPE_LABEL" desc="Label to apply to a switch key from a Bluetooth device. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> + Bluetooth + </message> + <message name="IDS_SETTINGS_SWITCH_ACCESS_UNKNOWN_DEVICE_TYPE_LABEL" desc="Label to apply to a switch key from an unknown device. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> + Unknown + </message> <message name="IDS_SETTINGS_SWITCH_ACCESS_AUTO_SCAN_HEADING" desc="Heading for the settings section containing preferences around Switch Access automatically scanning between elements."> Auto-scan </message> @@ -1018,6 +1030,9 @@ <message name="IDS_SETTINGS_SWITCH_ACCESS_ACTION_ASSIGNMENT_DIALOG_WARN_CANNOT_REMOVE_LAST_SELECT_SWITCH" desc="A message warning the user that they cannot remove the last switch for the Select action. The text for the 'Select' action should be the same as the text from IDS_SETTINGS_ASSIGN_SELECT_SWITCH_LABEL. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> Can’t remove the only switch assigned to Select. Press any key to exit. </message> + <message name="IDS_SETTINGS_SWITCH_AND_DEVICE_TYPE" desc="Label describing a switch key and the type of device where the switch key exists. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> + <ph name="SWITCH">$1<ex>backspace</ex></ph> (<ph name="DEVICE_TYPE">$2<ex>USB</ex></ph>) + </message> <message name="IDS_SETTINGS_ASSIGN_SWITCH_SUB_LABEL_0_SWITCHES" desc="A sub-label for the link that brings up a dialog to assign a switch key to an action. Mentions zero switches assigned. Switch Access is an alternative input method designed for users with limited mobility, where the user has as little as one switch (for example, a button) to control the computer."> 0 switches assigned </message>
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_BLUETOOTH_DEVICE_TYPE_LABEL.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_BLUETOOTH_DEVICE_TYPE_LABEL.png.sha1 new file mode 100644 index 0000000..612df65c --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_BLUETOOTH_DEVICE_TYPE_LABEL.png.sha1
@@ -0,0 +1 @@ +78fd8642607158a85cccfdae2f9010d31159557a \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_INTERNAL_DEVICE_TYPE_LABEL.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_INTERNAL_DEVICE_TYPE_LABEL.png.sha1 new file mode 100644 index 0000000..34ebcc7 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_INTERNAL_DEVICE_TYPE_LABEL.png.sha1
@@ -0,0 +1 @@ +8f25638a049f853967bb36884a5268cc1a6bb900 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_UNKNOWN_DEVICE_TYPE_LABEL.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_UNKNOWN_DEVICE_TYPE_LABEL.png.sha1 new file mode 100644 index 0000000..7e33db8 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_UNKNOWN_DEVICE_TYPE_LABEL.png.sha1
@@ -0,0 +1 @@ +68520afc794c4bbe462225083e5ffd4260609c21 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_USB_DEVICE_TYPE_LABEL.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_USB_DEVICE_TYPE_LABEL.png.sha1 new file mode 100644 index 0000000..aab660e --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_ACCESS_USB_DEVICE_TYPE_LABEL.png.sha1
@@ -0,0 +1 @@ +89ff98103ccc56bed9c14266bb14d98f21e95062 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_AND_DEVICE_TYPE.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_AND_DEVICE_TYPE.png.sha1 new file mode 100644 index 0000000..900b226e --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_SWITCH_AND_DEVICE_TYPE.png.sha1
@@ -0,0 +1 @@ +b68015e4ec78c3b22610a284e6180f8bcaa676d1 \ No newline at end of file
diff --git a/chrome/browser/autofill/address_accessory_controller_impl_unittest.cc b/chrome/browser/autofill/address_accessory_controller_impl_unittest.cc index b13d681..5b6f062 100644 --- a/chrome/browser/autofill/address_accessory_controller_impl_unittest.cc +++ b/chrome/browser/autofill/address_accessory_controller_impl_unittest.cc
@@ -76,7 +76,10 @@ web_contents(), mock_manual_filling_controller_.AsWeakPtr()); } - void TearDown() override { personal_data_manager()->ClearProfiles(); } + void TearDown() override { + personal_data_manager()->ClearProfiles(); + ChromeRenderViewHostTestHarness::TearDown(); + } AddressAccessoryController* controller() { return AddressAccessoryControllerImpl::FromWebContents(web_contents());
diff --git a/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc b/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc index 84c918e..2b975cee 100644 --- a/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc +++ b/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc
@@ -124,12 +124,13 @@ CreditCardAccessoryControllerImpl::CreateForWebContentsForTesting( web_contents(), mock_mf_controller_.AsWeakPtr(), &data_manager_, &af_manager_, &mock_af_driver_); - data_manager_.SetPrefService(profile_.GetPrefs()); + data_manager_.SetPrefService(profile()->GetPrefs()); } void TearDown() override { data_manager_.SetPrefService(nullptr); data_manager_.ClearCreditCards(); + ChromeRenderViewHostTestHarness::TearDown(); } CreditCardAccessoryController* controller() { @@ -152,7 +153,6 @@ MockAutocompleteHistoryManager history_; testing::NiceMock<MockManualFillingController> mock_mf_controller_; TestAutofillManager af_manager_; - TestingProfile profile_; }; TEST_F(CreditCardAccessoryControllerTest, RefreshSuggestions) {
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 3523ee4d..f0d4bf1 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -1460,8 +1460,6 @@ "first_run/first_run.h", "full_restore/app_launch_handler.cc", "full_restore/app_launch_handler.h", - "full_restore/full_restore_data_handler.cc", - "full_restore/full_restore_data_handler.h", "full_restore/full_restore_prefs.cc", "full_restore/full_restore_prefs.h", "full_restore/full_restore_service.cc",
diff --git a/chrome/browser/chromeos/crosapi/browser_loader_unittest.cc b/chrome/browser/chromeos/crosapi/browser_loader_unittest.cc index 30824b9..d2e8cf0 100644 --- a/chrome/browser/chromeos/crosapi/browser_loader_unittest.cc +++ b/chrome/browser/chromeos/crosapi/browser_loader_unittest.cc
@@ -21,6 +21,10 @@ namespace crosapi { namespace { +// Copied from browser_loader.cc +constexpr char kLacrosComponentName[] = "lacros-dogfood-dev"; +constexpr char kLacrosComponentId[] = "ldobopbhiamakmncndpkeelenhdmgfhk"; + // Delegate for testing. class DelegateImpl : public BrowserLoader::Delegate { public: @@ -52,9 +56,9 @@ // Create dependencies for object under test. scoped_refptr<component_updater::FakeCrOSComponentManager> component_manager = base::MakeRefCounted<component_updater::FakeCrOSComponentManager>(); - component_manager->set_supported_components({"lacros-fishfood"}); + component_manager->set_supported_components({kLacrosComponentName}); component_manager->ResetComponentState( - "lacros-fishfood", + kLacrosComponentName, component_updater::FakeCrOSComponentManager::ComponentInfo( component_updater::CrOSComponentManager::Error::NONE, base::FilePath("/install/path"), base::FilePath("/mount/path"))); @@ -78,21 +82,20 @@ EXPECT_EQ(0, delegate->set_lacros_update_available_); // Update check does not trigger an update notification. - constexpr char kLacrosFishfoodId[] = "ldobopbhiamakmncndpkeelenhdmgfhk"; browser_loader.OnEvent( UpdateClient::Observer::Events::COMPONENT_CHECKING_FOR_UPDATES, - kLacrosFishfoodId); + kLacrosComponentId); EXPECT_EQ(0, delegate->set_lacros_update_available_); // Update download does not trigger an update notification. browser_loader.OnEvent( UpdateClient::Observer::Events::COMPONENT_UPDATE_DOWNLOADING, - kLacrosFishfoodId); + kLacrosComponentId); EXPECT_EQ(0, delegate->set_lacros_update_available_); // Update completion trigger the notification. browser_loader.OnEvent(UpdateClient::Observer::Events::COMPONENT_UPDATED, - kLacrosFishfoodId); + kLacrosComponentId); EXPECT_EQ(1, delegate->set_lacros_update_available_); browser_part.ShutdownCrosComponentManager();
diff --git a/chrome/browser/chromeos/full_restore/full_restore_data_handler.cc b/chrome/browser/chromeos/full_restore/full_restore_data_handler.cc deleted file mode 100644 index 946b2a29..0000000 --- a/chrome/browser/chromeos/full_restore/full_restore_data_handler.cc +++ /dev/null
@@ -1,49 +0,0 @@ -// Copyright 2021 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/full_restore/full_restore_data_handler.h" - -#include "chrome/browser/apps/app_service/app_service_proxy.h" -#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" -#include "chrome/browser/profiles/profile.h" -#include "components/full_restore/full_restore_read_handler.h" -#include "components/full_restore/full_restore_save_handler.h" -#include "components/services/app_service/public/cpp/app_update.h" - -namespace chromeos { -namespace full_restore { - -FullRestoreDataHandler::FullRestoreDataHandler(Profile* profile) - : profile_(profile) { - DCHECK( - apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile_)); - Observe(&apps::AppServiceProxyFactory::GetForProfile(profile_) - ->AppRegistryCache()); -} - -FullRestoreDataHandler::~FullRestoreDataHandler() = default; - -void FullRestoreDataHandler::OnAppUpdate(const apps::AppUpdate& update) { - if (!update.ReadinessChanged() || - update.Readiness() != apps::mojom::Readiness::kUninstalledByUser) { - return; - } - - // If the user uninstalls an app, then installs it again at the system - // startup phase, its restore data will be removed if the app isn't reopened. - ::full_restore::FullRestoreReadHandler* read_handler = - ::full_restore::FullRestoreReadHandler::GetInstance(); - read_handler->RemoveApp(profile_->GetPath(), update.AppId()); - - ::full_restore::FullRestoreSaveHandler::GetInstance()->RemoveApp( - profile_->GetPath(), update.AppId()); -} - -void FullRestoreDataHandler::OnAppRegistryCacheWillBeDestroyed( - apps::AppRegistryCache* cache) { - apps::AppRegistryCache::Observer::Observe(nullptr); -} - -} // namespace full_restore -} // namespace chromeos
diff --git a/chrome/browser/chromeos/full_restore/full_restore_data_handler.h b/chrome/browser/chromeos/full_restore/full_restore_data_handler.h deleted file mode 100644 index 29267d6..0000000 --- a/chrome/browser/chromeos/full_restore/full_restore_data_handler.h +++ /dev/null
@@ -1,39 +0,0 @@ -// Copyright 2021 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_FULL_RESTORE_FULL_RESTORE_DATA_HANDLER_H_ -#define CHROME_BROWSER_CHROMEOS_FULL_RESTORE_FULL_RESTORE_DATA_HANDLER_H_ - -#include "components/services/app_service/public/cpp/app_registry_cache.h" - -class Profile; - -namespace chromeos { -namespace full_restore { - -// The FullRestoreDataHandler class observes AppRegistryCache to remove the app -// launching and app windows when the app is removed. -class FullRestoreDataHandler : public apps::AppRegistryCache::Observer { - public: - explicit FullRestoreDataHandler(Profile* profile); - ~FullRestoreDataHandler() override; - - FullRestoreDataHandler(const FullRestoreDataHandler&) = delete; - FullRestoreDataHandler& operator=(const FullRestoreDataHandler&) = delete; - - // apps::AppRegistryCache::Observer: - void OnAppUpdate(const apps::AppUpdate& update) override; - void OnAppRegistryCacheWillBeDestroyed( - apps::AppRegistryCache* cache) override; - - private: - Profile* profile_ = nullptr; - - base::WeakPtrFactory<FullRestoreDataHandler> weak_ptr_factory_{this}; -}; - -} // namespace full_restore -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_FULL_RESTORE_FULL_RESTORE_DATA_HANDLER_H_
diff --git a/chrome/browser/chromeos/full_restore/full_restore_service.cc b/chrome/browser/chromeos/full_restore/full_restore_service.cc index 04c01e38..385a71d 100644 --- a/chrome/browser/chromeos/full_restore/full_restore_service.cc +++ b/chrome/browser/chromeos/full_restore/full_restore_service.cc
@@ -8,7 +8,6 @@ #include "base/strings/string_util.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/chromeos/full_restore/app_launch_handler.h" -#include "chrome/browser/chromeos/full_restore/full_restore_data_handler.h" #include "chrome/browser/chromeos/full_restore/full_restore_prefs.h" #include "chrome/browser/chromeos/full_restore/full_restore_service_factory.h" #include "chrome/browser/chromeos/full_restore/new_user_restore_pref_handler.h" @@ -41,9 +40,7 @@ FullRestoreService::FullRestoreService(Profile* profile) : profile_(profile), - app_launch_handler_(std::make_unique<AppLaunchHandler>(profile_)), - restore_data_handler_( - std::make_unique<FullRestoreDataHandler>(profile_)) { + app_launch_handler_(std::make_unique<AppLaunchHandler>(profile_)) { // If the system crashed before reboot, show the restore notification. if (profile->GetLastSessionExitType() == Profile::EXIT_CRASHED) { ShowRestoreNotification(kRestoreForCrashNotificationId);
diff --git a/chrome/browser/chromeos/full_restore/full_restore_service.h b/chrome/browser/chromeos/full_restore/full_restore_service.h index eed24e4..cdf64fe7 100644 --- a/chrome/browser/chromeos/full_restore/full_restore_service.h +++ b/chrome/browser/chromeos/full_restore/full_restore_service.h
@@ -18,7 +18,6 @@ namespace full_restore { class AppLaunchHandler; -class FullRestoreDataHandler; class NewUserRestorePrefHandler; extern const char kRestoreForCrashNotificationId[]; @@ -72,8 +71,6 @@ // restore data. std::unique_ptr<AppLaunchHandler> app_launch_handler_; - std::unique_ptr<FullRestoreDataHandler> restore_data_handler_; - base::WeakPtrFactory<FullRestoreService> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.cc b/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.cc index b6c6361b..29f6cb5 100644 --- a/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.cc +++ b/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.cc
@@ -33,12 +33,19 @@ constexpr base::TimeDelta kConnectionStatusChangeTimeout = base::TimeDelta::FromSeconds(10); +// The amount of time by which we can expect a WebRTC upgrade to have been +// completed. According to metrics, 30 seconds is the 95th+ percentile of how +// long it takes to upgrade to WebRTC. +constexpr base::TimeDelta kWebRtcUpgradeDelay = + base::TimeDelta::FromSeconds(30); + // Numerical values should not be reused or changed since this is used by // metrics. enum class ConnectionMedium { kConnectedViaBluetooth = 0, kUpgradedToWebRtc = 1, - kMaxValue = kUpgradedToWebRtc + kDisconnectedInUnder30Seconds = 2, + kMaxValue = kDisconnectedInUnder30Seconds }; void RecordConnectionMediumMetric(ConnectionMedium medium) { @@ -151,6 +158,15 @@ util::RecordNearbyDisconnection(reason); } + if (!has_recorded_no_webrtc_metric_ && !has_upgraded_to_webrtc_ && + !time_when_connection_accepted_.is_null() && + (base::Time::Now() - time_when_connection_accepted_) < + kWebRtcUpgradeDelay) { + has_recorded_no_webrtc_metric_ = true; + RecordConnectionMediumMetric( + ConnectionMedium::kDisconnectedInUnder30Seconds); + } + if (!need_to_disconnect_endpoint_) { TransitionToDisconnectedAndInvokeCallback(); return; @@ -202,6 +218,8 @@ } void NearbyConnectionBrokerImpl::OnRequestConnectionResult(Status status) { + util::RecordRequestConnectionResult(status); + // In the success case, OnConnectionInitiated() is expected to be called to // continue the flow, so nothing else needs to be done in this callback. if (status == Status::kSuccess) @@ -212,6 +230,8 @@ } void NearbyConnectionBrokerImpl::OnAcceptConnectionResult(Status status) { + util::RecordAcceptConnectionResult(status); + if (status == Status::kSuccess) { DCHECK_EQ(ConnectionStatus::kAcceptingConnection, connection_status_); TransitionToStatus( @@ -226,6 +246,8 @@ void NearbyConnectionBrokerImpl::OnSendPayloadResult( SendMessageCallback callback, Status status) { + util::RecordSendPayloadResult(status); + bool success = status == Status::kSuccess; std::move(callback).Run(success); @@ -240,6 +262,8 @@ } void NearbyConnectionBrokerImpl::OnDisconnectFromEndpointResult(Status status) { + util::RecordDisconnectFromEndpointResult(status); + // If the disconnection was successful, wait for the OnDisconnected() // callback. if (status == Status::kSuccess) @@ -398,6 +422,7 @@ PA_LOG(INFO) << "Bandwidth changed: " << medium; if (medium == Medium::kWebRtc) { + has_upgraded_to_webrtc_ = true; RecordConnectionMediumMetric(ConnectionMedium::kUpgradedToWebRtc); DCHECK(!time_when_connection_accepted_.is_null());
diff --git a/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.h b/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.h index 313225d2..412c43b 100644 --- a/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.h +++ b/chrome/browser/chromeos/secure_channel/nearby_connection_broker_impl.h
@@ -168,6 +168,14 @@ // Starts empty, then set in OnEndpointDiscovered(). std::string remote_endpoint_id_; + // Starts as false and changes to true when WebRTC upgrade occurs. + bool has_upgraded_to_webrtc_ = false; + + // Whether or not a metric has been logged to note that a metric has been + // logged indicated that Disconnect() was called before a WebRTC upgrade + // occurred. + bool has_recorded_no_webrtc_metric_ = false; + // Starts as false; set to true in OnConnectionInitiated() and back to false // in OnDisconnected(). bool need_to_disconnect_endpoint_ = false;
diff --git a/chrome/browser/chromeos/secure_channel/nearby_endpoint_finder_impl.cc b/chrome/browser/chromeos/secure_channel/nearby_endpoint_finder_impl.cc index 7f09862..f0bfa65d 100644 --- a/chrome/browser/chromeos/secure_channel/nearby_endpoint_finder_impl.cc +++ b/chrome/browser/chromeos/secure_channel/nearby_endpoint_finder_impl.cc
@@ -6,6 +6,7 @@ #include "base/memory/ptr_util.h" #include "base/rand_util.h" +#include "chrome/browser/chromeos/secure_channel/util/histogram_util.h" #include "chromeos/components/multidevice/logging/logging.h" #include "chromeos/services/secure_channel/public/mojom/nearby_connector.mojom.h" @@ -25,6 +26,8 @@ const size_t kEndpointInfoLength = 4u; void OnStopDiscoveryDestructorResult(Status status) { + util::RecordStopDiscoveryResult(status); + if (status != Status::kSuccess) PA_LOG(WARNING) << "Failed to stop discovery as part of destructor"; } @@ -100,6 +103,8 @@ } void NearbyEndpointFinderImpl::OnStartDiscoveryResult(Status status) { + util::RecordStartDiscoveryResult(status); + if (status != Status::kSuccess) { PA_LOG(WARNING) << "Failed to start Nearby discovery: " << status; is_discovery_active_ = false; @@ -117,6 +122,8 @@ } void NearbyEndpointFinderImpl::OnInjectBluetoothEndpointResult(Status status) { + util::RecordInjectEndpointResult(status); + if (status != Status::kSuccess) { PA_LOG(WARNING) << "Failed to inject Bluetooth endpoint: " << status; NotifyEndpointDiscoveryFailure(); @@ -129,6 +136,8 @@ void NearbyEndpointFinderImpl::OnStopDiscoveryResult( location::nearby::connections::mojom::DiscoveredEndpointInfoPtr info, Status status) { + util::RecordStopDiscoveryResult(status); + is_discovery_active_ = false; if (status != Status::kSuccess) {
diff --git a/chrome/browser/chromeos/secure_channel/util/histogram_util.cc b/chrome/browser/chromeos/secure_channel/util/histogram_util.cc index 861c57a..de5adbc 100644 --- a/chrome/browser/chromeos/secure_channel/util/histogram_util.cc +++ b/chrome/browser/chromeos/secure_channel/util/histogram_util.cc
@@ -9,6 +9,49 @@ namespace chromeos { namespace secure_channel { namespace util { +namespace { +using location::nearby::connections::mojom::Status; +} // namespace + +void RecordStartDiscoveryResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.StartDiscovery", + status); +} + +void RecordInjectEndpointResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.InjectEndpoint", + status); +} + +void RecordStopDiscoveryResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.StopDiscovery", status); +} + +void RecordRequestConnectionResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.RequestConnection", + status); +} + +void RecordAcceptConnectionResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.AcceptConnection", + status); +} + +void RecordSendPayloadResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.SendPayload", status); +} + +void RecordDisconnectFromEndpointResult(Status status) { + base::UmaHistogramEnumeration( + "MultiDevice.SecureChannel.Nearby.OperationResult.DisconnectFromEndpoint", + status); +} void LogMessageAction(MessageAction message_action) { base::UmaHistogramEnumeration(
diff --git a/chrome/browser/chromeos/secure_channel/util/histogram_util.h b/chrome/browser/chromeos/secure_channel/util/histogram_util.h index 97615e8..1c250b2 100644 --- a/chrome/browser/chromeos/secure_channel/util/histogram_util.h +++ b/chrome/browser/chromeos/secure_channel/util/histogram_util.h
@@ -5,10 +5,28 @@ #ifndef CHROME_BROWSER_CHROMEOS_SECURE_CHANNEL_UTIL_HISTOGRAM_UTIL_H_ #define CHROME_BROWSER_CHROMEOS_SECURE_CHANNEL_UTIL_HISTOGRAM_UTIL_H_ +#include "chromeos/services/nearby/public/mojom/nearby_connections_types.mojom.h" + namespace chromeos { namespace secure_channel { namespace util { +// Logs the result of Nearby Connections API functions. +void RecordStartDiscoveryResult( + location::nearby::connections::mojom::Status status); +void RecordInjectEndpointResult( + location::nearby::connections::mojom::Status status); +void RecordStopDiscoveryResult( + location::nearby::connections::mojom::Status status); +void RecordRequestConnectionResult( + location::nearby::connections::mojom::Status status); +void RecordAcceptConnectionResult( + location::nearby::connections::mojom::Status status); +void RecordSendPayloadResult( + location::nearby::connections::mojom::Status status); +void RecordDisconnectFromEndpointResult( + location::nearby::connections::mojom::Status status); + // Enumeration of possible message transfer action via Nearby Connection // library. Keep in sync with corresponding enum in // tools/metrics/histograms/enums.xml. These values are persisted to logs.
diff --git a/chrome/browser/error_reporting/BUILD.gn b/chrome/browser/error_reporting/BUILD.gn index 15cff0c9..2faabc2 100644 --- a/chrome/browser/error_reporting/BUILD.gn +++ b/chrome/browser/error_reporting/BUILD.gn
@@ -39,6 +39,7 @@ "//base/test:test_support", "//build:chromeos_buildflags", "//chrome/common:constants", + "//components/crash/content/browser/error_reporting", "//components/crash/content/browser/error_reporting:mock_crash_endpoint", ] }
diff --git a/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.cc b/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.cc index 69ecc89c..5437218c 100644 --- a/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.cc +++ b/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.cc
@@ -6,12 +6,22 @@ #include "base/check.h" #include "base/logging.h" +#include "components/crash/content/browser/error_reporting/javascript_error_report.h" #include "components/crash/content/browser/error_reporting/mock_crash_endpoint.h" MockChromeJsErrorReportProcessor::MockChromeJsErrorReportProcessor() = default; MockChromeJsErrorReportProcessor::~MockChromeJsErrorReportProcessor() = default; +void MockChromeJsErrorReportProcessor::SendErrorReport( + JavaScriptErrorReport error_report, + base::OnceClosure completion_callback, + content::BrowserContext* browser_context) { + ++send_count_; + ChromeJsErrorReportProcessor::SendErrorReport( + std::move(error_report), std::move(completion_callback), browser_context); +} + void MockChromeJsErrorReportProcessor::SetAsDefault() { LOG(INFO) << "MockChromeJsErrorReportProcessor installed as error processor"; JsErrorReportProcessor::SetDefault(this);
diff --git a/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.h b/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.h index ca84262..015ca699 100644 --- a/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.h +++ b/chrome/browser/error_reporting/mock_chrome_js_error_report_processor.h
@@ -21,6 +21,13 @@ public: MockChromeJsErrorReportProcessor(); + // JsErrorReportProcessor: + void SendErrorReport(JavaScriptErrorReport error_report, + base::OnceClosure completion_callback, + content::BrowserContext* browser_context) override; + + int send_count() const { return send_count_; } + // Controls what is returned from GetCrashEndpoint() override. void SetCrashEndpoint(std::string crash_endpoint); // Controls what is returned from GetCrashEndpointStaging() override. @@ -61,6 +68,8 @@ private: ~MockChromeJsErrorReportProcessor() override; + // Number of times SendErrorReport has been called. + int send_count_ = 0; std::string crash_endpoint_; std::string crash_endpoint_staging_; #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS)
diff --git a/chrome/browser/error_reporting/webui_js_error_reporting_browsertest.cc b/chrome/browser/error_reporting/webui_js_error_reporting_browsertest.cc index c0ae65075..ac14030 100644 --- a/chrome/browser/error_reporting/webui_js_error_reporting_browsertest.cc +++ b/chrome/browser/error_reporting/webui_js_error_reporting_browsertest.cc
@@ -4,6 +4,7 @@ #include <memory> +#include "base/containers/contains.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/error_reporting/mock_chrome_js_error_report_processor.h" @@ -26,6 +27,8 @@ #include "content/public/common/content_features.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "net/test/embedded_test_server/http_response.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/page_transition_types.h" @@ -41,6 +44,83 @@ // escapes. constexpr char kPageLoadMessage[] = "WebUI%20JS%20Error%3A%20printing%20error%20on%20page%20load"; + +// A simple webpage that generates a JavaScript error on load. +constexpr char kJavaScriptErrorPage[] = R"( +<html> + <head> + <meta charset="utf-8"> + <title>Bad Page</title> + </head> + <body> + Text + <script> + console.error('special error message for WebUIJSErrorReportingTest'); + </script> + </body> +</html> +)"; + +// The error message printed by kJavaScriptErrorPage +constexpr char kWebpageErrorMessage[] = + "special error message for WebUIJSErrorReportingTest"; + +// Callback for the error_page_test_server_. Tells the server to always return +// the contents of kJavaScriptErrorPage. +std::unique_ptr<net::test_server::HttpResponse> ReturnErrorPage( + const net::test_server::HttpRequest&) { + auto http_response = std::make_unique<net::test_server::BasicHttpResponse>(); + http_response->set_code(net::HTTP_OK); + http_response->set_content(kJavaScriptErrorPage); + http_response->set_content_type("text/html"); + return http_response; +} + +// A class that waits for a log message like +// [4193947:4193947:0108/114152.942981:INFO:CONSOLE(10)] "special error message +// for WebUIJSErrorReportingTest", source: http://127.0.0.1:36521/index.html +// (10) +// to appear and then calls a callback (usually a RunLoop quit closure) +class ScopedLogMessageWatcher { + public: + explicit ScopedLogMessageWatcher(base::RepeatingClosure callback) + : callback_(std::move(callback)) { + previous_handler_ = logging::GetLogMessageHandler(); + // base::LogMessageHandlerFunction must be a pure function, not a functor, + // so we need a global to find this object again. + CHECK(current_handler_ == nullptr); + current_handler_ = this; + logging::SetLogMessageHandler(&ScopedLogMessageWatcher::MessageHandler); + } + ScopedLogMessageWatcher(const ScopedLogMessageWatcher&) = delete; + ScopedLogMessageWatcher& operator=(const ScopedLogMessageWatcher&) = delete; + ~ScopedLogMessageWatcher() { + CHECK(current_handler_ == this); + current_handler_ = nullptr; + logging::SetLogMessageHandler(previous_handler_); + } + + private: + static bool MessageHandler(int severity, + const char* file, + int line, + size_t message_start, + const std::string& str) { + CHECK(current_handler_ != nullptr); + if (base::Contains(str, kWebpageErrorMessage)) { + current_handler_->callback_.Run(); + } + if (current_handler_->previous_handler_ != nullptr) { + return (*current_handler_->previous_handler_)(severity, file, line, + message_start, str); + } + return false; + } + static ScopedLogMessageWatcher* current_handler_; + base::RepeatingClosure callback_; + logging::LogMessageHandlerFunction previous_handler_; +}; +ScopedLogMessageWatcher* ScopedLogMessageWatcher::current_handler_ = nullptr; } // namespace class WebUIJSErrorReportingTest : public InProcessBrowserTest { @@ -49,6 +129,14 @@ CHECK(error_url_.is_valid()); } + void SetUpOnMainThread() override { + error_page_test_server_.RegisterRequestHandler( + base::BindRepeating(&ReturnErrorPage)); + EXPECT_TRUE(error_page_test_server_.Start()); + + InProcessBrowserTest::SetUpOnMainThread(); + } + void SetUpInProcessBrowserTestFixture() override { scoped_feature_list_.InitAndEnableFeatureWithParameters( features::kSendWebUIJavaScriptErrorReports, @@ -58,6 +146,10 @@ } protected: + // NoErrorsAfterNavigation needs a second embedded test server to serve up + // its error page, since embedded_test_server() is in use by the + // MockCrashEndpoint. + net::test_server::EmbeddedTestServer error_page_test_server_; base::test::ScopedFeatureList scoped_feature_list_; const GURL error_url_; }; @@ -171,3 +263,41 @@ EXPECT_EQ(endpoint.report_count(), 2); EXPECT_THAT(report.query, HasSubstr(kPageLoadMessage)); } + +// Show that navigating from a WebUI page to a http page that produces +// JavaScript errors on load does not create an error report. +IN_PROC_BROWSER_TEST_F(WebUIJSErrorReportingTest, NoErrorsAfterNavigation) { + MockCrashEndpoint endpoint(embedded_test_server()); + ScopedMockChromeJsErrorReportProcessor mock_processor(endpoint); + + NavigateParams navigate(browser(), error_url_, ui::PAGE_TRANSITION_TYPED); + ui_test_utils::NavigateToURL(&navigate); + + // Wait for page load error report. + MockCrashEndpoint::Report report = endpoint.WaitForReport(); + EXPECT_EQ(endpoint.report_count(), 1); + EXPECT_EQ(mock_processor.processor().send_count(), 1); + + { + base::RunLoop run_loop; + ScopedLogMessageWatcher log_watcher(run_loop.QuitClosure()); + + NavigateParams navigate_to_http( + browser(), error_page_test_server_.GetURL("/index.html"), + ui::PAGE_TRANSITION_TYPED); + ui_test_utils::NavigateToURL(&navigate_to_http); + + run_loop.Run(); // Run until the error message is seen on the console. + } + + // Now run more to make sure the error reporter system doesn't have an + // in-flight error report. + { + base::RunLoop run_loop2; + run_loop2.RunUntilIdle(); + } + + // Count should not change. + EXPECT_EQ(endpoint.report_count(), 1); + EXPECT_EQ(mock_processor.processor().send_count(), 1); +}
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index bc9c8b6d..bc67fc02 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -89,11 +89,6 @@ const char kEditPasswordsInSettingsDescription[] = "Enables password editing in settings."; -const char kEnableBloomName[] = "Enable Bloom Integration"; -const char kEnableBloomDescription[] = - "Enables native support for bloom, an experimental vertical knowledge " - "search feature."; - const char kEnableBluetoothSerialPortProfileInSerialApiName[] = "Enable Bluetooth Serial Port Profile in Serial API"; const char kEnableBluetoothSerialPortProfileInSerialApiDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 70ad6e65..a887fc5 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -88,9 +88,6 @@ extern const char kEditPasswordsInSettingsName[]; extern const char kEditPasswordsInSettingsDescription[]; -extern const char kEnableBloomName[]; -extern const char kEnableBloomDescription[]; - extern const char kEnableBluetoothSerialPortProfileInSerialApiName[]; extern const char kEnableBluetoothSerialPortProfileInSerialApiDescription[];
diff --git a/chrome/browser/history/domain_diversity_reporter_factory.cc b/chrome/browser/history/domain_diversity_reporter_factory.cc index 56f4280..1f47d0cbb 100644 --- a/chrome/browser/history/domain_diversity_reporter_factory.cc +++ b/chrome/browser/history/domain_diversity_reporter_factory.cc
@@ -39,6 +39,10 @@ HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); + // Only build DomainDiversityReporter service with a valid |history_service|. + if (!history_service) + return nullptr; + return std::make_unique<DomainDiversityReporter>( history_service, profile->GetPrefs(), base::DefaultClock::GetInstance()); }
diff --git a/chrome/browser/lookalikes/lookalike_url_service.cc b/chrome/browser/lookalikes/lookalike_url_service.cc index 76236ed..72c67a66 100644 --- a/chrome/browser/lookalikes/lookalike_url_service.cc +++ b/chrome/browser/lookalikes/lookalike_url_service.cc
@@ -23,6 +23,7 @@ #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/lookalikes/core/lookalike_url_util.h" +#include "components/site_engagement/content/site_engagement_score.h" #include "components/url_formatter/spoof_checks/top_domains/top_domain_util.h" #include "components/url_formatter/url_formatter.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" @@ -120,16 +121,14 @@ void LookalikeUrlService::OnFetchEngagedSites( EngagedSitesCallback callback, std::vector<site_engagement::mojom::SiteEngagementDetails> details) { - site_engagement::SiteEngagementService* service = - site_engagement::SiteEngagementService::Get(profile_); engaged_sites_.clear(); for (const site_engagement::mojom::SiteEngagementDetails& detail : details) { if (!detail.origin.SchemeIsHTTPOrHTTPS()) { continue; } // Ignore sites with an engagement score below threshold. - if (!service->IsEngagementAtLeast(detail.origin, - blink::mojom::EngagementLevel::MEDIUM)) { + if (detail.total_score < + site_engagement::SiteEngagementScore::GetMediumEngagementBoundary()) { continue; } const DomainInfo domain_info = GetDomainInfo(detail.origin);
diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc index bcc1e59..b775afac 100644 --- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -559,13 +559,48 @@ ); #if defined(OS_WIN) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - // Records whether or not BackupRefPtr and/or PCScan is enabled. + // Records whether or not PartitionAlloc-Everywhere is enabled, and whether + // PCScan is enabled on top of it. This is meant for a 3-way experiment with 2 + // binaries: + // - binary A: deployed to 33% users, with PA-E and PCScan off. + // - binary B: deployed to 66% users, with PA-E on, half of which having + // PCScan on + // + // NOTE, deliberately don't use ALLOW_PCSCAN which depends on bitness. In the + // 32-bit case, PCScan is always disabled, but we'll deliberately misrepresent + // it as enabled here (and later ignored when analyzing results), in order to + // keep each population at 33%. + ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( + "PartitionAllocEverywhereAndPCScan", +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + base::FeatureList::IsEnabled( + base::features::kPartitionAllocPCScanBrowserOnly) + ? "EnabledWithPCScan" + : "EnabledWithoutPCScan" +#else + "Disabled" +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + ); +#endif // defined(OS_WIN) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + +#if defined(OS_WIN) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + // Records whether or not BackupRefPtr and/or PCScan is enabled. This is meant + // for a 3-way experiment with 2 binaries: + // - binary A: deployed to 66% users, with half of them having PCScan on and + // half off (BackupRefPtr fully off) + // - binary B: deployed to 33% users, with BackupRefPtr on (PCSCan fully off) + // + // NOTE, deliberately don't use ALLOW_PCSCAN which depends on bitness. In the + // 32-bit case, PCScan is always disabled, but we'll deliberately misrepresent + // it as enabled here (and later ignored when analyzing results), in order to + // keep each population at 33%. ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( "BackupRefPtrAndPCScan", #if ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR "BackupRefPtrEnabled" #else - base::features::IsPartitionAllocPCScanBrowserOnlyEnabled() + base::FeatureList::IsEnabled( + base::features::kPartitionAllocPCScanBrowserOnly) ? "PCScanEnabled" : "Disabled" #endif
diff --git a/chrome/browser/password_manager/android/password_accessory_controller_impl_unittest.cc b/chrome/browser/password_manager/android/password_accessory_controller_impl_unittest.cc index fbe65737..574391a8 100644 --- a/chrome/browser/password_manager/android/password_accessory_controller_impl_unittest.cc +++ b/chrome/browser/password_manager/android/password_accessory_controller_impl_unittest.cc
@@ -217,6 +217,7 @@ void TearDown() override { if (mock_password_store_) mock_password_store_->ShutdownOnUIThread(); + ChromeRenderViewHostTestHarness::TearDown(); } void CreateSheetController( @@ -869,9 +870,9 @@ } void TearDown() override { - PasswordAccessoryControllerTest::TearDown(); test_store_->ShutdownOnUIThread(); task_environment()->RunUntilIdle(); + PasswordAccessoryControllerTest::TearDown(); } void DisableFeature() { @@ -882,14 +883,13 @@ protected: PasswordStore* CreateInternalPasswordStore() override { + test_store_ = CreateAndUseTestPasswordStore(profile()); return test_store_.get(); } private: base::test::ScopedFeatureList scoped_feature_list_; - TestingProfile profile_; - scoped_refptr<TestPasswordStore> test_store_ = - CreateAndUseTestPasswordStore(&profile_); + scoped_refptr<TestPasswordStore> test_store_; }; TEST_F(PasswordAccessoryControllerWithTestStoreTest, AddsShowOtherPasswords) {
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc index b0abe2a..21d62c0 100644 --- a/chrome/browser/pdf/pdf_extension_test.cc +++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -918,7 +918,7 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesEnabledTest, ViewerPropertiesDialogTest) { - RunTestsInJsModule("viewer_properties_dialog_test.js", "test.pdf"); + RunTestsInJsModule("viewer_properties_dialog_test.js", "document_info.pdf"); } IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesEnabledTest, ViewerThumbnailBar) {
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc index 4767426..e0ba027 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc
@@ -1339,10 +1339,11 @@ {"DataLength", 0}, /* only checked for > 0 */ {"FetchDurationMS", 0}, /* only checked for > 0 */ {"NavigationStartToFetchStartMS", 0}, /* only checked for > 0 */ + {"ISPFilteringStatus", 0}, {"LinkClicked", 1}, {"LinkPosition", 1}, {"ResourceType", 1}, - {"Status", 14}, + {"Status", 0}, }}, // not eligible url #1 UkmEntry{srp_source_id,
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.cc index 63df222..7d02dca 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.cc +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.cc
@@ -182,6 +182,10 @@ std::move(on_success_callback))); return; } + // Inform the metrics collector that the main frame HTML was used and probing + // was disabled. + ReportProbeResult(frame_tree_node_id_, url_, + PrefetchProxyProbeResult::kNoProbing); EnsureCookiesCopiedAndInterceptPrefetchedNavigation( tentative_resource_request, std::move(prefetch));
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_webui_test_base.js b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_webui_test_base.js index 388f973..e7ea065 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_webui_test_base.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_webui_test_base.js
@@ -2,8 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -GEN_INCLUDE(['../../common/testing/assert_additions.js']); -GEN_INCLUDE(['common.js', '../../common/testing/callback_helper.js']); +// clang-format off +GEN_INCLUDE([ + '../../common/testing/assert_additions.js', + '../../common/testing/common.js', + '../../common/testing/callback_helper.js' +]); +// clang-format on /** * Base test fixture for ChromeVox webui tests. Run in a Blink renderer.
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/common.js b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/common.js index eaa3c5b9..bcaa3524 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/common.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/common.js
@@ -99,18 +99,3 @@ }); } } - -/** - * Similar to |TEST_F|. Generates a test for the given |testFixture|, - * |testName|, and |testFunction|. - * Used this variant when an |isAsync| fixture wants to temporarily mix in an - * sync test. - * @param {string} testFixture Fixture name. - * @param {string} testName Test name. - * @param {function} testFunction The test impl. - */ -function SYNC_TEST_F(testFixture, testName, testFunction) { - TEST_F(testFixture, testName, function() { - this.newCallback(testFunction)(); - }); -}
diff --git a/chrome/browser/resources/chromeos/accessibility/common/testing/common.js b/chrome/browser/resources/chromeos/accessibility/common/testing/common.js new file mode 100644 index 0000000..242025a --- /dev/null +++ b/chrome/browser/resources/chromeos/accessibility/common/testing/common.js
@@ -0,0 +1,20 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** @fileoverview File containing test framework helper functions. */ + +/** + * Similar to |TEST_F|. Generates a test for the given |testFixture|, + * |testName|, and |testFunction|. + * Used this variant when an |isAsync| fixture wants to temporarily mix in a + * sync test. + * @param {string} testFixture Fixture name. + * @param {string} testName Test name. + * @param {function} testFunction The test impl. + */ +function SYNC_TEST_F(testFixture, testName, testFunction) { + TEST_F(testFixture, testName, function() { + this.newCallback(testFunction)(); + }); +}
diff --git a/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js b/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js index f8c710f7..3f55300 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js +++ b/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -GEN_INCLUDE(['assert_additions.js', 'callback_helper.js', 'doc_utils.js']); +GEN_INCLUDE( + ['assert_additions.js', 'callback_helper.js', 'common.js', 'doc_utils.js']); /** * Base test fixture for end to end tests (tests that need a full extension @@ -167,18 +168,3 @@ * No UI in the background context. */ E2ETestBase.prototype.runAccessibilityChecks = false; - -/** - * Similar to |TEST_F|. Generates a test for the given |testFixture|, - * |testName|, and |testFunction|. - * Used this variant when an |isAsync| fixture wants to temporarily mix in an - * sync test. - * @param {string} testFixture Fixture name. - * @param {string} testName Test name. - * @param {function} testFunction The test impl. - */ -function SYNC_TEST_F(testFixture, testName, testFunction) { - TEST_F(testFixture, testName, function() { - this.newCallback(testFunction)(); - }); -}
diff --git a/chrome/browser/resources/chromeos/accessibility/select_to_speak/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/select_to_speak/BUILD.gn index 5a312ef..9f2f436 100644 --- a/chrome/browser/resources/chromeos/accessibility/select_to_speak/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/select_to_speak/BUILD.gn
@@ -77,6 +77,7 @@ js2gtest("select_to_speak_extjs_tests") { test_type = "extension" sources = [ + # These are end-to-end tests. "paragraph_utils_overflow_test.js", "select_to_speak_keystroke_selection_test.js", "select_to_speak_mouse_selection_test.js",
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/preference_manager.js b/chrome/browser/resources/chromeos/accessibility/switch_access/preference_manager.js index 1a4ada6..0f38196 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/preference_manager.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/preference_manager.js
@@ -62,6 +62,22 @@ return null; } + /** + * Get the preference value for the given name, or |null| if the value is not + * a dictionary or does not exist. + * + * @param {SAConstants.Preference} name + * @return {Object|null} + * @private + */ + getDict_(name) { + const pref = this.preferences_.get(name); + if (pref && pref.type === chrome.settingsPrivate.PrefType.DICTIONARY) { + return /** @type {Object} */ (pref.value); + } + return null; + } + /** @private */ init_() { chrome.settingsPrivate.onPrefsChanged.addListener( @@ -77,19 +93,26 @@ * @private */ settingsAreConfigured_() { - const selectSetting = - this.getNumber_(SAConstants.Preference.SELECT_SETTING); - const nextSetting = this.getNumber_(SAConstants.Preference.NEXT_SETTING); - const previousSetting = - this.getNumber_(SAConstants.Preference.PREVIOUS_SETTING); + const selectPref = + this.getDict_(SAConstants.Preference.SELECT_DEVICE_KEY_CODES); + const selectSet = selectPref ? Object.keys(selectPref).length : false; + + const nextPref = + this.getDict_(SAConstants.Preference.NEXT_DEVICE_KEY_CODES); + const nextSet = nextPref ? Object.keys(nextPref).length : false; + + const previousPref = + this.getDict_(SAConstants.Preference.PREVIOUS_DEVICE_KEY_CODES); + const previousSet = previousPref ? Object.keys(previousPref).length : false; + const autoScanEnabled = !!this.getBoolean_(SAConstants.Preference.AUTO_SCAN_ENABLED); - if (!selectSetting) { + if (!selectSet) { return false; } - if (nextSetting || previousSetting) { + if (nextSet || previousSet) { return true; }
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js b/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js index 73696c6..c3c3847 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js
@@ -92,9 +92,11 @@ AUTO_SCAN_TIME: 'settings.a11y.switch_access.auto_scan.speed_ms', AUTO_SCAN_KEYBOARD_TIME: 'settings.a11y.switch_access.auto_scan.keyboard.speed_ms', - NEXT_SETTING: 'settings.a11y.switch_access.next.setting', - PREVIOUS_SETTING: 'settings.a11y.switch_access.previous.setting', - SELECT_SETTING: 'settings.a11y.switch_access.select.setting', + NEXT_DEVICE_KEY_CODES: 'settings.a11y.switch_access.next.device_key_codes', + PREVIOUS_DEVICE_KEY_CODES: + 'settings.a11y.switch_access.previous.device_key_codes', + SELECT_DEVICE_KEY_CODES: + 'settings.a11y.switch_access.select.device_key_codes', }, // =========================== Sub-objects ===========================
diff --git a/chrome/browser/resources/media/BUILD.gn b/chrome/browser/resources/media/BUILD.gn index a11a2c2..4d0a7b9 100644 --- a/chrome/browser/resources/media/BUILD.gn +++ b/chrome/browser/resources/media/BUILD.gn
@@ -2,15 +2,32 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//chrome/common/features.gni") import("//third_party/closure_compiler/compile_js.gni") import("//tools/grit/grit_rule.gni") +import("//ui/webui/resources/tools/generate_grd.gni") + +generate_grd("build_grd") { + grd_prefix = "webrtc_logs" + out_grd = "$target_gen_dir/webrtc_logs_resources.grd" + input_files = [ + "webrtc_logs.css", + "webrtc_logs.html", + "webrtc_logs.js", + ] + input_files_base_dir = rebase_path(".", "//") +} grit("webrtc_logs_resources") { - source = "webrtc_logs_resources.grd" - + source = "$target_gen_dir/webrtc_logs_resources.grd" + deps = [ ":build_grd" ] + enable_input_discovery_for_gn_analyze = false + defines = chrome_grit_defines use_brotli = true outputs = [ "grit/webrtc_logs_resources.h", + "grit/webrtc_logs_resources_map.cc", + "grit/webrtc_logs_resources_map.h", "webrtc_logs_resources.pak", ] output_dir = "$root_gen_dir/chrome"
diff --git a/chrome/browser/resources/media/webrtc_logs_resources.grd b/chrome/browser/resources/media/webrtc_logs_resources.grd deleted file mode 100644 index 030e50f..0000000 --- a/chrome/browser/resources/media/webrtc_logs_resources.grd +++ /dev/null
@@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<grit latest_public_release="0" - current_release="1" - output_all_resource_defines="false"> - <outputs> - <output filename="grit/webrtc_logs_resources.h" type="rc_header"> - <emit emit_type="prepend"></emit> - </output> - <output filename="webrtc_logs_resources.pak" type="data_package" /> - </outputs> - <release seq="1"> - <includes> - <include name="IDR_WEBRTC_LOGS_HTML" - file="webrtc_logs.html" - flattenhtml="true" - allowexternalscript="true" - type="BINDATA" /> - <include name="IDR_WEBRTC_LOGS_JS" - file="webrtc_logs.js" - type="BINDATA" /> - </includes> - </release> -</grit>
diff --git a/chrome/browser/resources/ntp4/BUILD.gn b/chrome/browser/resources/ntp4/BUILD.gn index 8efe057..d6459b3d 100644 --- a/chrome/browser/resources/ntp4/BUILD.gn +++ b/chrome/browser/resources/ntp4/BUILD.gn
@@ -19,7 +19,6 @@ "//ui/webui/resources/js/cr/event_target.js", "//ui/webui/resources/js/cr/ui.js", "//ui/webui/resources/js/cr/ui/bubble.js", - "//ui/webui/resources/js/cr/ui/card_slider.js", "//ui/webui/resources/js/cr/ui/command.js", "//ui/webui/resources/js/cr/ui/context_menu_handler.js", "//ui/webui/resources/js/cr/ui/drag_wrapper.js", @@ -29,7 +28,6 @@ "//ui/webui/resources/js/cr/ui/menu_button.js", "//ui/webui/resources/js/cr/ui/menu_item.js", "//ui/webui/resources/js/cr/ui/position_util.js", - "//ui/webui/resources/js/cr/ui/touch_handler.js", "//ui/webui/resources/js/event_tracker.js", "//ui/webui/resources/js/icon.js", "//ui/webui/resources/js/load_time_data.js", @@ -37,12 +35,14 @@ "//ui/webui/resources/js/promise_resolver.js", "//ui/webui/resources/js/util.js", "apps_page.js", + "card_slider.js", "dot_list.js", "nav_dot.js", "new_tab.js", "page_list_view.js", "page_switcher.js", "tile_page.js", + "touch_handler.js", "trash.js", ]
diff --git a/ui/webui/resources/js/cr/ui/card_slider.js b/chrome/browser/resources/ntp4/card_slider.js similarity index 97% rename from ui/webui/resources/js/cr/ui/card_slider.js rename to chrome/browser/resources/ntp4/card_slider.js index af7e590..ccb363f 100644 --- a/ui/webui/resources/js/cr/ui/card_slider.js +++ b/chrome/browser/resources/ntp4/card_slider.js
@@ -23,7 +23,7 @@ // Use an anonymous function to enable strict mode just for this file (which // will be concatenated with other files when embedded in Chrome -cr.define('cr.ui', function() { +cr.define('ntp', function() { 'use strict'; /** @@ -67,10 +67,10 @@ this.cardWidth_ = cardWidth; /** - * @type {!cr.ui.TouchHandler} + * @type {!ntp.TouchHandler} * @private */ - this.touchHandler_ = new cr.ui.TouchHandler(this.container_); + this.touchHandler_ = new ntp.TouchHandler(this.container_); } @@ -146,7 +146,7 @@ // available. Note that this has minimal impact in the common case of // no touch events (eg. we're mainly just adding listeners for events that // will never trigger). - const TouchHandler = cr.ui.TouchHandler; + const TouchHandler = ntp.TouchHandler; this.container_.addEventListener( TouchHandler.EventType.TOUCH_START, this.onTouchStart_.bind(this)); this.container_.addEventListener( @@ -611,7 +611,7 @@ * @private */ onTouchStart_(e) { - e = /** @type {!cr.ui.TouchHandler.Event} */ (e); + e = /** @type {!ntp.TouchHandler.Event} */ (e); this.container_.style.transition = ''; e.enableDrag = true; }, @@ -623,7 +623,7 @@ * @private */ onDragStart_(e) { - e = /** @type {!cr.ui.TouchHandler.Event} */ (e); + e = /** @type {!ntp.TouchHandler.Event} */ (e); e.enableDrag = this.cardCount > 1 && Math.abs(e.dragDeltaX) > Math.abs(e.dragDeltaY); }, @@ -635,7 +635,7 @@ * @private */ onDragMove_(e) { - e = /** @type {!cr.ui.TouchHandler.Event} */ (e); + e = /** @type {!ntp.TouchHandler.Event} */ (e); let deltaX = e.dragDeltaX; // If dragging beyond the first or last card then apply a backoff so the // dragging feels stickier than usual. @@ -653,7 +653,7 @@ * @private */ onDragEnd_(e) { - e = /** @type {!cr.ui.TouchHandler.Event} */ (e); + e = /** @type {!ntp.TouchHandler.Event} */ (e); const deltaX = e.dragDeltaX; const velocity = this.touchHandler_.getEndVelocity().x; const newX = this.currentLeft_ + deltaX;
diff --git a/chrome/browser/resources/ntp4/new_tab.html b/chrome/browser/resources/ntp4/new_tab.html index 9eccd0db..d753a9a 100644 --- a/chrome/browser/resources/ntp4/new_tab.html +++ b/chrome/browser/resources/ntp4/new_tab.html
@@ -38,7 +38,6 @@ <script src="../../../../ui/webui/resources/js/cr/event_target.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui/bubble.js"></script> -<script src="../../../../ui/webui/resources/js/cr/ui/card_slider.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui/context_menu_handler.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui/drag_wrapper.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui/focus_manager.js"></script> @@ -46,13 +45,14 @@ <script src="../../../../ui/webui/resources/js/cr/ui/menu.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui/position_util.js"></script> <script src="../../../../ui/webui/resources/js/cr/ui/menu_button.js"></script> -<script src="../../../../ui/webui/resources/js/cr/ui/touch_handler.js"></script> <script src="../../../../ui/webui/resources/js/icon.js"></script> <script src="tile_page.js"></script> <script src="apps_page.js"></script> <script src="dot_list.js"></script> <script src="trash.js"></script> +<script src="touch_handler.js"></script> +<script src="card_slider.js"></script> <script src="page_list_view.js"></script> <script src="page_switcher.js"></script>
diff --git a/chrome/browser/resources/ntp4/page_list_view.js b/chrome/browser/resources/ntp4/page_list_view.js index 099cefb..6d7696c 100644 --- a/chrome/browser/resources/ntp4/page_list_view.js +++ b/chrome/browser/resources/ntp4/page_list_view.js
@@ -62,7 +62,7 @@ PageListView.prototype = { /** * The CardSlider object to use for changing app pages. - * @type {cr.ui.CardSlider|undefined} + * @type {ntp.CardSlider|undefined} */ cardSlider: undefined, @@ -184,7 +184,7 @@ // Initialize the cardSlider without any cards at the moment. this.sliderFrame = cardSliderFrame; - this.cardSlider = new cr.ui.CardSlider( + this.cardSlider = new ntp.CardSlider( this.sliderFrame, this.pageList, this.sliderFrame.offsetWidth); // Prevent touch events from triggering any sort of native scrolling if
diff --git a/ui/webui/resources/js/cr/ui/touch_handler.js b/chrome/browser/resources/ntp4/touch_handler.js similarity index 99% rename from ui/webui/resources/js/cr/ui/touch_handler.js rename to chrome/browser/resources/ntp4/touch_handler.js index d713539..392b17d 100644 --- a/ui/webui/resources/js/cr/ui/touch_handler.js +++ b/chrome/browser/resources/ntp4/touch_handler.js
@@ -31,7 +31,7 @@ // Use an anonymous function to enable strict mode just for this file (which // will be concatenated with other files when embedded in Chrome) -cr.define('cr.ui', function() { +cr.define('ntp', function() { 'use strict'; /**
diff --git a/chrome/browser/resources/pdf/constants.js b/chrome/browser/resources/pdf/constants.js index 37f8027..9baa2a5 100644 --- a/chrome/browser/resources/pdf/constants.js +++ b/chrome/browser/resources/pdf/constants.js
@@ -18,6 +18,18 @@ }; /** + * @typedef {{ + * title: string, + * author: string, + * subject: string, + * creator: string, + * producer: string, + * canSerializeDocument: boolean, + * }} + */ +export let DocumentMetadata; + +/** * Enumeration of page fitting types. * @enum {string} */
diff --git a/chrome/browser/resources/pdf/elements/BUILD.gn b/chrome/browser/resources/pdf/elements/BUILD.gn index 698d8aa..8586b6e 100644 --- a/chrome/browser/resources/pdf/elements/BUILD.gn +++ b/chrome/browser/resources/pdf/elements/BUILD.gn
@@ -157,6 +157,7 @@ js_library("viewer-properties-dialog") { deps = [ + "..:constants", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", ]
diff --git a/chrome/browser/resources/pdf/elements/viewer-properties-dialog.html b/chrome/browser/resources/pdf/elements/viewer-properties-dialog.html index bfc31ed..cf85812 100644 --- a/chrome/browser/resources/pdf/elements/viewer-properties-dialog.html +++ b/chrome/browser/resources/pdf/elements/viewer-properties-dialog.html
@@ -46,15 +46,21 @@ </tr> <tr> <td class="name">$i18n{propertiesTitle}</td> - <td class="value" id="title">-</td> + <td class="value" id="title"> + [[getOrPlaceholder_(documentMetadata.title)]] + </td> </tr> <tr> <td class="name">$i18n{propertiesAuthor}</td> - <td class="value" id="author">-</td> + <td class="value" id="author"> + [[getOrPlaceholder_(documentMetadata.author)]] + </td> </tr> <tr> <td class="name">$i18n{propertiesSubject}</td> - <td class="value" id="subject">-</td> + <td class="value" id="subject"> + [[getOrPlaceholder_(documentMetadata.subject)]] + </td> </tr> <tr> <td class="name">$i18n{propertiesKeywords}</td> @@ -70,11 +76,15 @@ </tr> <tr class="break"> <td class="name">$i18n{propertiesApplication}</td> - <td class="value" id="application">-</td> + <td class="value" id="application"> + [[getOrPlaceholder_(documentMetadata.creator)]] + </td> </tr> <tr> <td class="name">$i18n{propertiesPdfProducer}</td> - <td class="value" id="pdf-producer">-</td> + <td class="value" id="pdf-producer"> + [[getOrPlaceholder_(documentMetadata.producer)]] + </td> </tr> <tr> <td class="name">$i18n{propertiesPdfVersion}</td>
diff --git a/chrome/browser/resources/pdf/elements/viewer-properties-dialog.js b/chrome/browser/resources/pdf/elements/viewer-properties-dialog.js index ec71763..869678f 100644 --- a/chrome/browser/resources/pdf/elements/viewer-properties-dialog.js +++ b/chrome/browser/resources/pdf/elements/viewer-properties-dialog.js
@@ -8,6 +8,8 @@ import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {DocumentMetadata} from '../constants.js'; + export class ViewerPropertiesDialogElement extends PolymerElement { static get is() { return 'viewer-properties-dialog'; @@ -17,6 +19,13 @@ return html`{__html_template__}`; } + static get properties() { + return { + /** @type {!DocumentMetadata} */ + documentMetadata: Object, + }; + } + /** * @return {!CrDialogElement} * @private @@ -26,6 +35,15 @@ this.shadowRoot.querySelector('cr-dialog')); } + /** + * @param {string} value + * @return {string} + * @private + */ + getOrPlaceholder_(value) { + return value || '-'; + } + /** @private */ onClickClose_() { this.getDialog_().close();
diff --git a/chrome/browser/resources/pdf/pdf_viewer.html b/chrome/browser/resources/pdf/pdf_viewer.html index e54a03f..ae8986eb 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.html +++ b/chrome/browser/resources/pdf/pdf_viewer.html
@@ -226,6 +226,7 @@ <template is="dom-if" if="[[showPropertiesDialog_]]" restamp> <viewer-properties-dialog id="properties-dialog" + document-metadata="[[documentMetadata_]]" on-close="onPropertiesDialogClose_"> </viewer-properties-dialog> </template>
diff --git a/chrome/browser/resources/pdf/pdf_viewer.js b/chrome/browser/resources/pdf/pdf_viewer.js index ee362d9..71b59c0 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.js +++ b/chrome/browser/resources/pdf/pdf_viewer.js
@@ -24,7 +24,7 @@ import {Bookmark} from './bookmark_type.js'; import {BrowserApi} from './browser_api.js'; -import {Attachment, FittingType, Point, SaveRequestType} from './constants.js'; +import {Attachment, DocumentMetadata, FittingType, Point, SaveRequestType} from './constants.js'; import {PluginController} from './controller.js'; import {ViewerPdfSidenavElement} from './elements/viewer-pdf-sidenav.js'; import {ViewerPdfToolbarNewElement} from './elements/viewer-pdf-toolbar-new.js'; @@ -65,15 +65,6 @@ /** * @typedef {{ * type: string, - * title: string, - * canSerializeDocument: boolean, - * }} - */ -let MetadataMessageData; - -/** - * @typedef {{ - * type: string, * messageId: string, * page: number, * }} @@ -184,6 +175,12 @@ value: false, }, + /** @private {!DocumentMetadata} */ + documentMetadata_: { + type: Object, + value: () => {}, + }, + /** @private */ hadPassword_: { type: Boolean, @@ -940,7 +937,9 @@ destinationData.zoom); return; case 'metadata': - this.setDocumentMetadata_(/** @type {!MetadataMessageData} */ (data)); + this.setDocumentMetadata_( + /** @type {{ metadataData: !DocumentMetadata }} */ (data) + .metadataData); return; case 'setIsEditing': // Editing mode can only be entered once, and cannot be exited. @@ -1056,13 +1055,15 @@ /** * Sets document metadata from the current controller. - * @param {!MetadataMessageData} metadata + * @param {!DocumentMetadata} metadata * @private */ setDocumentMetadata_(metadata) { - this.title_ = metadata.title || getFilenameFromURL(this.originalUrl); + this.documentMetadata_ = metadata; + this.title_ = + this.documentMetadata_.title || getFilenameFromURL(this.originalUrl); document.title = this.title_; - this.canSerializeDocument_ = metadata.canSerializeDocument; + this.canSerializeDocument_ = this.documentMetadata_.canSerializeDocument; } /**
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/BUILD.gn b/chrome/browser/resources/settings/chromeos/os_a11y_page/BUILD.gn index e0a992e2..adc43275 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/BUILD.gn +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/BUILD.gn
@@ -129,9 +129,9 @@ # ":os_a11y_page.m", ":os_a11y_page_browser_proxy.m", - ":switch_access_action_assignment_dialog.m", ":switch_access_constants.m", + # ":switch_access_subpage.m", ":switch_access_subpage_browser_proxy.m", ":tts_subpage.m",
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.html b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.html index c400a80c..f422a454 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.html +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.html
@@ -91,7 +91,7 @@ class$="icon [[computeIcon_(assignment, assignmentState_)]]-icon" aria-label="[[computeIconLabel_(assignment, assignmentState_)]]"> </iron-icon> - [[assignment.key]] + [[getLabelForAssignment_(assignment)]] </div> </template> </template>
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js index ebabb01..bec226129 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js
@@ -37,18 +37,6 @@ }; /** - * Possible device types for Switch Access. - * @enum {string} - * @private - */ -/* #export */ const SwitchAccessDeviceType = { - INTERNAL: 'internal', - USB: 'usb', - BLUETOOTH: 'bluetooth', - UNKNOWN: 'unknown' -}; - -/** * Various icons representing the state of a given key assignment. * @enum {string} */ @@ -59,9 +47,44 @@ }; /** - * @typedef {!Array<!Object<string, !Array<!SwitchAccessDeviceType>>>} + * Mapping of a stringified key code to a list of Switch Access device types + * for that key code. + * @typedef {!Object<string, !Array<!SwitchAccessDeviceType>>} */ -let SwitchAccessKeyAssignmentInfoList; +let SwitchAccessKeyAssignmentInfoMapping; + +/** + * @param {!SwitchAccessDeviceType} deviceType + * @return {string} + */ +/* #export */ function getLabelForDeviceType(deviceType) { + switch (deviceType) { + case SwitchAccessDeviceType.INTERNAL: + return I18nBehavior.i18nAdvanced( + 'switchAccessInternalDeviceTypeLabel', {}); + case SwitchAccessDeviceType.USB: + return I18nBehavior.i18nAdvanced('switchAccessUsbDeviceTypeLabel', {}); + case SwitchAccessDeviceType.BLUETOOTH: + return I18nBehavior.i18nAdvanced( + 'switchAccessBluetoothDeviceTypeLabel', {}); + case SwitchAccessDeviceType.UNKNOWN: + return I18nBehavior.i18nAdvanced( + 'switchAccessUnknownDeviceTypeLabel', {}); + } + throw new Error('Invalid device type.'); +} + +/** + * Converts assignment object to pretty-formatted label. + * E.g. {key: 'Escape', device: 'usb'} -> 'Escape (USB)' + * @param {{key: string, device: !SwitchAccessDeviceType}} assignment + * @return {string} + */ +/* #export */ function getLabelForAssignment(assignment) { + return I18nBehavior.i18nAdvanced('switchAndDeviceType', { + substitutions: [assignment.key, getLabelForDeviceType(assignment.device)] + }); +} Polymer({ is: 'settings-switch-access-action-assignment-dialog', @@ -93,8 +116,7 @@ /** * Assignments for the current action. - * @private {Array<!{key: string, devices: - * !Array<!SwitchAccessDeviceType>}>} + * @private {!Array<{key: string, device: !SwitchAccessDeviceType}>} */ assignments_: { type: Array, @@ -113,12 +135,14 @@ /** * A dictionary containing all Switch Access key codes (mapped from * actions). - * Each key code is another object, mapping a stringified key code to a list - * of Switch Access device types for that key code. + * TODO: Consider changing from list of devices to a set/map of devices, + * to guarantee uniqueness and better represent the underlying state (a + * device either is or isn't associated with a given key code, and order of + * devices doesn't matter) * @private {{ - * select: SwitchAccessKeyAssignmentInfoList, - * next: SwitchAccessKeyAssignmentInfoList, - * previous: SwitchAccessKeyAssignmentInfoList + * select: SwitchAccessKeyAssignmentInfoMapping, + * next: SwitchAccessKeyAssignmentInfoMapping, + * previous: SwitchAccessKeyAssignmentInfoMapping * }} */ keyCodes_: { @@ -150,14 +174,14 @@ /** @private {!string} */ currentKey_: String, - /** @private {!string} */ - unexpectedKey_: String, - /** @private {?number} */ currentKeyCode_: { type: Number, value: null, }, + + /** @private {!SwitchAccessDeviceType} */ + currentDeviceType_: String, }, /** @private {?SwitchAccessSubpageBrowserProxy} */ @@ -234,6 +258,7 @@ handleKeyEventInWaitForKey_(event) { this.currentKeyCode_ = event.keyCode; this.currentKey_ = event.key; + this.currentDeviceType_ = event.device; if (!this.currentKey_) { this.assignmentState_ = AssignmentState.WARN_UNRECOGNIZED_KEY; @@ -242,7 +267,9 @@ // Check for pre-existing assignments in actions other than the current one. for (const action of Object.values(SwitchAccessCommand)) { - if (!this.keyCodes_[action][event.keyCode]) { + if (!this.keyCodes_[action][event.keyCode] || + !this.keyCodes_[action][event.keyCode].includes( + this.currentDeviceType_)) { continue; } @@ -261,7 +288,9 @@ return; } this.assignmentState_ = AssignmentState.WAIT_FOR_CONFIRMATION; - this.push('assignments_', this.currentKey_); + this.push( + 'assignments_', + {key: this.currentKey_, device: this.currentDeviceType_}); }, /** @@ -272,21 +301,30 @@ * @private */ handleKeyEventInWaitForConfirmation_(event) { - if (this.currentKeyCode_ === event.keyCode) { - // Confirmed. - // TODO: resolve to specific device type once UI is hooked up; - // |event.device| has the Switch Access device type. - this.keyCodes_[this.action][this.currentKeyCode_] = [ - SwitchAccessDeviceType.INTERNAL, SwitchAccessDeviceType.USB, - SwitchAccessDeviceType.BLUETOOTH - ]; - this.$.switchAccessActionAssignmentDialog.close(); + if (this.currentKeyCode_ !== event.keyCode || + this.currentDeviceType_ !== event.device) { + this.assignmentState_ = AssignmentState.WARN_NOT_CONFIRMED; return; } - // Not confirmed. - this.unexpectedKey_ = event.key; - this.assignmentState_ = AssignmentState.WARN_NOT_CONFIRMED; + // Save the key to |this.keyCodes_| for inclusion into prefs later. + const keyAssignmentInfoMapping = this.keyCodes_[this.action]; + if (!keyAssignmentInfoMapping) { + throw new Error('Expected valid pref for action: ' + this.action); + } + let devices = keyAssignmentInfoMapping[this.currentKeyCode_]; + if (!devices) { + // |this.currentKeyCode_| was not set as a switch key for |this.action| + // before. + devices = []; + keyAssignmentInfoMapping[this.currentKeyCode_] = devices; + } + if (!devices.includes(event.device)) { + // A new device for the current key code has been added. + devices.push(event.device); + } + + this.$.switchAccessActionAssignmentDialog.close(); }, /** @@ -297,14 +335,18 @@ * @private */ handleKeyEventInWaitForConfirmationRemoval_(event) { - if (this.currentKeyCode_ !== event.keyCode) { - this.unexpectedKey_ = event.key; + if (this.currentKeyCode_ !== event.keyCode || + this.currentDeviceType_ !== event.device) { this.assignmentState_ = AssignmentState.WARN_NOT_CONFIRMED_REMOVAL; return; } - // Remove this key code. - delete this.keyCodes_[this.action][this.currentKeyCode_]; + // Remove this device type for this key code. + const devices = this.keyCodes_[this.action][this.currentKeyCode_]; + devices.splice(devices.indexOf(event.device), 1); + if (!devices.length) { + delete this.keyCodes_[this.action][this.currentKeyCode_]; + } this.$.switchAccessActionAssignmentDialog.close(); }, @@ -315,8 +357,8 @@ }, /** - * @param {!Object<SwitchAccessCommand, !Array<!{key: string, devices: - * !Array<SwitchAccessDeviceType>}>>} value + * @param {!Object<SwitchAccessCommand, !Array<{key: string, device: + * !SwitchAccessDeviceType}>>} value * @private */ onAssignmentsChanged_(value) { @@ -342,6 +384,15 @@ }, /** + * @param {{key: string, device: !SwitchAccessDeviceType}} assignment + * @return {string} + * @private + */ + getLabelForAssignment_(assignment) { + return getLabelForAssignment(assignment); + }, + + /** * @param {SwitchAccessCommand} action * @return {string} * @private @@ -355,12 +406,13 @@ /** * Returns the image to use for the assignment's icon. The value must match * one of iron-icon's os-settings:(*) icon names. - * @param {string} assignment + * @param {{key: string, device: !SwitchAccessDeviceType}} assignment * @return {AssignmentIcon} * @private */ computeIcon_(assignment) { - if (assignment !== this.currentKey_) { + if (assignment.key !== this.currentKey_ || + assignment.device !== this.currentDeviceType_) { return AssignmentIcon.ASSIGNED; } @@ -382,7 +434,7 @@ /** * Returns the icon label describing the icon for the specified assignment. - * @param {string} assignment + * @param {{key: string, device: !SwitchAccessDeviceType}} assignment * @return {string} * @private */ @@ -403,7 +455,7 @@ /** * @param {!AssignmentState} assignmentState - * @param {!Array<string>} assignments + * @param {!Array<{key: string, device: !SwitchAccessDeviceType}>} assignments * @return {string} * @private */
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_constants.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_constants.js index 9cfc8ab..7e574d9 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_constants.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_constants.js
@@ -11,3 +11,14 @@ PREVIOUS: 'previous', SELECT: 'select' }; + +/** + * Possible device types for Switch Access. + * @enum {string} + */ +/* #export */ const SwitchAccessDeviceType = { + INTERNAL: 'internal', + USB: 'usb', + BLUETOOTH: 'bluetooth', + UNKNOWN: 'unknown' +}; \ No newline at end of file
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.html b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.html index 37fe6a0..31c1ab8 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.html +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.html
@@ -12,7 +12,7 @@ <link rel="import" href="../../settings_shared_css.html"> <link rel="import" href="switch_access_action_assignment_dialog.html"> <link rel="import" href="switch_access_constants.html"> -+<link rel="import" href="switch_access_subpage_browser_proxy.html"> +<link rel="import" href="switch_access_subpage_browser_proxy.html"> <dom-module id="settings-switch-access-subpage"> <template>
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.js index 807aab2..7f808de 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage.js
@@ -49,21 +49,21 @@ notify: true, }, - /** @private {Array<string>} */ + /** @private {!Array<{key: string, device: !SwitchAccessDeviceType}>} */ selectAssignments_: { type: Array, value: [], notify: true, }, - /** @private {Array<string>} */ + /** @private {!Array<{key: string, device: !SwitchAccessDeviceType}>} */ nextAssignments_: { type: Array, value: [], notify: true, }, - /** @private {Array<string>} */ + /** @private {!Array<{key: string, device: !SwitchAccessDeviceType}>} */ previousAssignments_: { type: Array, value: [], @@ -202,23 +202,34 @@ }, /** - * @param {!Object<SwitchAccessCommand, !Array<string>>} value + * @param {!Object<SwitchAccessCommand, !Array<{key: string, device: + * !SwitchAccessDeviceType}>>} value * @private */ onAssignmentsChanged_(value) { - // TODO: include |v.devices| for each key in UI. - this.selectAssignments_ = value[SwitchAccessCommand.SELECT].map(v => v.key); - this.nextAssignments_ = value[SwitchAccessCommand.NEXT].map(v => v.key); - this.previousAssignments_ = - value[SwitchAccessCommand.PREVIOUS].map(v => v.key); + this.selectAssignments_ = value[SwitchAccessCommand.SELECT]; + this.nextAssignments_ = value[SwitchAccessCommand.NEXT]; + this.previousAssignments_ = value[SwitchAccessCommand.PREVIOUS]; }, /** - * @param {!Array<string>} switches List of switch names - * @return {string} (e.g. 'Alt, Backspace, Enter, and 4 more switches') + * @param {{key: string, device: !SwitchAccessDeviceType}} assignment + * @return {string} * @private */ - getAssignSwitchSubLabel_(switches) { + getLabelForAssignment_(assignment) { + return getLabelForAssignment(assignment); + }, + + /** + * @param {!Array<{key: string, device: !SwitchAccessDeviceType}>} assignments + * List of assignments + * @return {string} (e.g. 'Alt (USB), Backspace, Enter, and 4 more switches') + * @private + */ + getAssignSwitchSubLabel_(assignments) { + const switches = + assignments.map(assignment => this.getLabelForAssignment_(assignment)); switch (switches.length) { case 0: return this.i18n('assignSwitchSubLabel0Switches');
diff --git a/chrome/browser/resources/settings/chromeos/os_settings.gni b/chrome/browser/resources/settings/chromeos/os_settings.gni index 54f6737..a0639fbb 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings.gni +++ b/chrome/browser/resources/settings/chromeos/os_settings.gni
@@ -106,7 +106,7 @@ "chrome/browser/resources/settings/chromeos/nearby_share_page/nearby_account_manager_browser_proxy.html|NearbyAccountManagerBrowserProxy,NearbyAccountManagerBrowserProxyImpl", "chrome/browser/resources/settings/chromeos/nearby_share_page/nearby_share_receive_manager.html|setReceiveManagerForTesting,getReceiveManager,observeReceiveManager", "chrome/browser/resources/settings/chromeos/nearby_share_page/types.html|NearbyShareDataUsage,dataUsageStringToEnum", - "chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_constants.html|SwitchAccessCommand", + "chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_constants.html|SwitchAccessCommand,SwitchAccessDeviceType", "chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_subpage_browser_proxy.html|SwitchAccessSubpageBrowserProxy,SwitchAccessSubpageBrowserProxyImpl", "chrome/browser/resources/settings/chromeos/os_a11y_page/tts_subpage_browser_proxy.html|TtsSubpageBrowserProxy,TtsSubpageBrowserProxyImpl", "chrome/browser/resources/settings/chromeos/os_languages_page/input_method_util.html|generateOptions,getFirstPartyInputMethodEngineId,getOptionLabelName,getOptionMenuItems,getOptionUiType,getOptionUrl,hasOptionsPageInSettings,InputToolCode,isNumberValue,OPTION_DEFAULT,OptionType,UiType",
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositor.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositor.java index d721427..851c13b0 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositor.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositor.java
@@ -4,10 +4,13 @@ package org.chromium.chrome.browser.share.long_screenshots; -import android.content.Context; import android.graphics.Bitmap; import android.graphics.Rect; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; + import org.chromium.base.Callback; import org.chromium.base.UnguessableToken; import org.chromium.components.paint_preview.common.proto.PaintPreview.PaintPreviewProto; @@ -22,32 +25,34 @@ * captured webpage. */ public class LongScreenshotsCompositor { - private Context mContext; private PlayerCompositorDelegate mDelegate; private Callback<Bitmap> mBitmapCallback; private Rect mRect; + private static PlayerCompositorDelegate.Factory sCompositorDelegateFactory = + new CompositorDelegateFactory(); + /** * Creates a new {@link LongScreenshotsCompositor}. * * @param url The URL for which the content should be composited for. - * @param context An instance of current Android {@link Context}. * @param nativePaintPreviewServiceProvider The native paint preview service. * @param directoryKey The key for the directory storing the data. * @param rect The area of the captured webpage that should be composited. * @param response The proto with the address of the captured bitmap. * @param bitmapCallback Callback to process the composited bitmap. */ - public LongScreenshotsCompositor(GURL url, Context context, + public LongScreenshotsCompositor(GURL url, NativePaintPreviewServiceProvider nativePaintPreviewServiceProvider, String directoryKey, PaintPreviewProto response, Rect rect, Callback<Bitmap> bitmapCallback) { - mContext = context; mBitmapCallback = bitmapCallback; mRect = rect; - mDelegate = new PlayerCompositorDelegateImpl(nativePaintPreviewServiceProvider, response, - url, directoryKey, true, this::onCompositorReady, this::onCompositorError); + // TODO(tgupta): Look into warmupCompositor + mDelegate = getCompositorDelegateFactory().createForProto(nativePaintPreviewServiceProvider, + response, url, directoryKey, true, this::onCompositorReady, + this::onCompositorError); } /** @@ -63,9 +68,11 @@ * method initializes a sub-component for each frame and adds the view for the root frame to * {@link #mHostView}. */ - private void onCompositorReady(UnguessableToken rootFrameGuid, UnguessableToken[] frameGuids, + @VisibleForTesting + protected void onCompositorReady(UnguessableToken rootFrameGuid, UnguessableToken[] frameGuids, int[] frameContentSize, int[] scrollOffsets, int[] subFramesCount, UnguessableToken[] subFrameGuids, int[] subFrameClipRects) { + // TODO(tgupta): Keep track of the returned id. mDelegate.requestBitmap(mRect, 1, mBitmapCallback, this::onError); } @@ -83,4 +90,35 @@ mDelegate = null; } } + + static class CompositorDelegateFactory implements PlayerCompositorDelegate.Factory { + @Override + public PlayerCompositorDelegate create(NativePaintPreviewServiceProvider service, + @NonNull GURL url, String directoryKey, boolean mainFrameMode, + @NonNull PlayerCompositorDelegate.CompositorListener compositorListener, + Callback<Integer> compositorErrorCallback) { + return new PlayerCompositorDelegateImpl(service, null, url, directoryKey, mainFrameMode, + compositorListener, compositorErrorCallback); + } + + @Override + public PlayerCompositorDelegate createForProto(NativePaintPreviewServiceProvider service, + @Nullable PaintPreviewProto proto, @NonNull GURL url, String directoryKey, + boolean mainFrameMode, + @NonNull PlayerCompositorDelegate.CompositorListener compositorListener, + Callback<Integer> compositorErrorCallback) { + return new PlayerCompositorDelegateImpl(service, proto, url, directoryKey, + mainFrameMode, compositorListener, compositorErrorCallback); + } + } + + private PlayerCompositorDelegate.Factory getCompositorDelegateFactory() { + return sCompositorDelegateFactory; + } + + @VisibleForTesting + public static void overrideCompositorDelegateFactoryForTesting( + PlayerCompositorDelegate.Factory factory) { + sCompositorDelegateFactory = factory; // IN-TEST + } }
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsEntry.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsEntry.java index 377635c..28f1182 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsEntry.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsEntry.java
@@ -114,7 +114,7 @@ public void processCapturedTab(PaintPreviewProto response, int status) { // TODO(tgupta): Process a non success status mCompositor = new LongScreenshotsCompositor(new GURL(response.getMetadata().getUrl()), - mContext, mLongScreenshotsTabService, DIR_NAME, response, + mLongScreenshotsTabService, DIR_NAME, response, new Rect(mStartXAxis, mStartYAxis, mEndXAxis, mEndYAxis), this::onBitmapResult); }
diff --git a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/DEPS b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/DEPS index 1fb67a68..349132e3 100644 --- a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/DEPS +++ b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/DEPS
@@ -1,3 +1,4 @@ include_rules = [ + "+components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player", "+content/public/android/java/src/org/chromium/content_public/browser", ] \ No newline at end of file
diff --git a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositorTest.java b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositorTest.java new file mode 100644 index 0000000..293ccd9 --- /dev/null +++ b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositorTest.java
@@ -0,0 +1,143 @@ +// Copyright 2020 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.share.long_screenshots; + +import static org.junit.Assert.assertEquals; + +import android.graphics.Bitmap; +import android.graphics.Rect; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; + +import org.chromium.base.Callback; +import org.chromium.base.UnguessableToken; +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.test.util.browser.Features; +import org.chromium.components.paint_preview.common.proto.PaintPreview.PaintPreviewProto; +import org.chromium.components.paintpreview.browser.NativePaintPreviewServiceProvider; +import org.chromium.components.paintpreview.player.PlayerCompositorDelegate; +import org.chromium.url.GURL; + +/** + * Test for {@link LongScreenshotsCompositor}. + */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +@Features.EnableFeatures(ChromeFeatureList.CHROME_SHARE_LONG_SCREENSHOT) +public class LongScreenshotsCompositorTest { + private TestPlayerCompositorDelegate mCompositorDelegate; + private Bitmap mTestBitmap = Bitmap.createBitmap(512, 1024, Bitmap.Config.ARGB_8888); + private Rect mRect = new Rect(0, 100, 200, 1100); + + @Mock + private GURL mTestGurl; + + @Mock + private NativePaintPreviewServiceProvider mNativePaintPreviewServiceProvider; + + /** + * Implementation of {@link PlayerCompositorDelegate.Factory} for tests. + */ + class TestCompositorDelegateFactory implements PlayerCompositorDelegate.Factory { + @Override + public PlayerCompositorDelegate create(NativePaintPreviewServiceProvider service, GURL url, + String directoryKey, boolean mainFrameMode, + @NonNull PlayerCompositorDelegate.CompositorListener compositorListener, + Callback<Integer> compositorErrorCallback) { + Assert.fail("create shouldn't be called"); + return null; + } + + @Override + public PlayerCompositorDelegate createForProto(NativePaintPreviewServiceProvider service, + @Nullable PaintPreviewProto proto, GURL url, String directoryKey, + boolean mainFrameMode, + @NonNull PlayerCompositorDelegate.CompositorListener compositorListener, + Callback<Integer> compositorErrorCallback) { + return mCompositorDelegate; + } + } + + /** + * Implementation of {@link PlayerCompositorDelegate} for tests. TODO(tgupta): Consider moving + * this into its own class when it starts to get used more. + */ + class TestPlayerCompositorDelegate implements PlayerCompositorDelegate { + @Override + public void addMemoryPressureListener(Runnable runnable) {} + + @Override + public int requestBitmap(UnguessableToken frameGuid, Rect clipRect, float scaleFactor, + Callback<Bitmap> bitmapCallback, Runnable errorCallback) { + Assert.fail("This version of requestBitmap should not be called"); + return 0; + } + + @Override + public int requestBitmap(Rect clipRect, float scaleFactor, Callback<Bitmap> bitmapCallback, + Runnable errorCallback) { + assertEquals(mRect, clipRect); + assertEquals(1f, scaleFactor, 0); + bitmapCallback.onResult(mTestBitmap); + return 1; + } + + @Override + public boolean cancelBitmapRequest(int requestId) { + return false; + } + + @Override + public void cancelAllBitmapRequests() {} + + @Override + public GURL onClick(UnguessableToken frameGuid, int x, int y) { + return null; + } + } + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + mCompositorDelegate = new TestPlayerCompositorDelegate(); + LongScreenshotsCompositor.overrideCompositorDelegateFactoryForTesting( + new TestCompositorDelegateFactory()); + } + + @After + public void tearDown() { + LongScreenshotsCompositor.overrideCompositorDelegateFactoryForTesting(null); + } + + @Test + public void testSuccessfullCompositing() { + Callback<Bitmap> onBitmapResult = new Callback<Bitmap>() { + @Override + public void onResult(Bitmap result) { + assertEquals(mTestBitmap, result); + } + }; + + LongScreenshotsCompositor compositor = new LongScreenshotsCompositor(mTestGurl, + mNativePaintPreviewServiceProvider, "test_directory_key", + PaintPreviewProto.getDefaultInstance(), mRect, onBitmapResult); + + // Mimic the service calling onCompositorReady + compositor.onCompositorReady(null, null, null, null, null, null, null); + + // RequestBitmap in mCompositorDelegate should match + } +}
diff --git a/chrome/browser/share/android/test_java_sources.gni b/chrome/browser/share/android/test_java_sources.gni index 7642f46e..1afafd0 100644 --- a/chrome/browser/share/android/test_java_sources.gni +++ b/chrome/browser/share/android/test_java_sources.gni
@@ -18,8 +18,16 @@ share_junit_test_java_sources = [ "//chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/link_to_text/LinkToTextCoordinatorTest.java", + "//chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/long_screenshots/LongScreenshotsCompositorTest.java", "//chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/screenshot/ScreenshotCoordinatorTest.java", "//chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/screenshot/ScreenshotShareSheetMediatorUnitTest.java", "//chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/send_tab_to_self/NotificationSharedPrefManagerTest.java", "//chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/send_tab_to_self/SendTabToSelfAndroidBridgeTest.java", ] + +share_junit_test_java_deps = [ + "//chrome/browser/paint_preview/android:java", + "//chrome/browser/paint_preview/android:java", + "//components/paint_preview/common/proto:proto_java", + "//components/paint_preview/player/android:java", +]
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc index 4c6972f4..b3d6561 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc
@@ -11,12 +11,15 @@ #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/ui/webui/flags/flags_ui.h" #include "chrome/grit/generated_resources.h" +#include "chrome/grit/google_chrome_strings.h" #include "components/flags_ui/pref_service_flags_storage.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_palette.h" #include "ui/views/background.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" +#include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_provider.h" namespace { @@ -70,24 +73,31 @@ public: ChromeLabsFooter() { SetLayoutManager(std::make_unique<views::FlexLayout>()) - ->SetOrientation(views::LayoutOrientation::kVertical); + ->SetOrientation(views::LayoutOrientation::kVertical) + .SetCrossAxisAlignment(views::LayoutAlignment::kStart); AddChildView( views::Builder<views::Label>() .CopyAddressTo(&restart_label_) - .SetText(base::ASCIIToUTF16( - "Your changes will take effect the next time you " - "relaunch Google Chrome.")) + .SetText(l10n_util::GetStringUTF16( + IDS_CHROMEBETA_RELAUNCH_FOOTER_MESSAGE)) .SetMultiLine(true) .SetHorizontalAlignment(gfx::ALIGN_LEFT) .SetProperty(views::kFlexBehaviorKey, views::FlexSpecification( views::MinimumFlexSizeRule::kPreferred, views::MaximumFlexSizeRule::kPreferred, true)) + .SetBorder(views::CreateEmptyBorder( + gfx::Insets(0, 0, + views::LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL), + 0))) .Build()); AddChildView(views::Builder<views::MdTextButton>() .CopyAddressTo(&restart_button_) .SetCallback(base::BindRepeating(&chrome::AttemptRestart)) - .SetText(base::ASCIIToUTF16("Relaunch")) + .SetText(l10n_util::GetStringUTF16( + IDS_CHROMEBETA_RELAUNCH_BUTTON_LABEL)) + .SetProminent(true) .Build()); SetBackground(views::CreateThemedSolidBackground( this, ui::NativeTheme::kColorId_BubbleFooterBackground)); @@ -153,15 +163,16 @@ flags_state_ = about_flags::GetCurrentFlagsState(); menu_item_container_ = AddChildView( - views::Builder<views::View>() + views::Builder<views::FlexLayoutView>() + .SetOrientation(views::LayoutOrientation::kVertical) .SetProperty(views::kFlexBehaviorKey, views::FlexSpecification( views::MinimumFlexSizeRule::kScaleToZero, views::MaximumFlexSizeRule::kPreferred, true)) + .SetBorder(views::CreateEmptyBorder( + views::LayoutProvider::Get()->GetInsetsMetric( + views::INSETS_DIALOG))) .Build()); - menu_item_container_->SetLayoutManager(std::make_unique<views::FlexLayout>()) - ->SetOrientation(views::LayoutOrientation::kVertical) - .SetDefault(views::kMarginsKey, gfx::Insets(10)); // Create each lab item. const std::vector<LabInfo>& all_labs = model_->GetLabInfo();
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h index 85412cb..eb37d5b 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h +++ b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h
@@ -11,11 +11,9 @@ #include "components/flags_ui/flags_state.h" #include "components/flags_ui/flags_storage.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" +#include "ui/views/layout/flex_layout_view.h" // TODO(elainechien): Use composition instead of inheritance. -// TODO(elainechien): Add screenshots and strings for translation when UI is -// finished. -// TODO(elainechien): Formatting for items in child views. class ChromeLabsBubbleView : public views::BubbleDialogDelegateView { public: static void Show(views::View* anchor_view, @@ -54,7 +52,7 @@ flags_ui::FlagsState* flags_state_; // This view will hold all the child lab items. - views::View* menu_item_container_; + views::FlexLayoutView* menu_item_container_; std::unique_ptr<ChromeLabsBubbleViewModel> model_;
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc b/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc index 0e35b72b..c524327e 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc
@@ -3,11 +3,14 @@ // found in the LICENSE file. #include "chrome/browser/ui/views/toolbar/chrome_labs_item_view.h" +#include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/browser/ui/views/toolbar/chrome_labs_bubble_view_model.h" #include "ui/base/models/combobox_model.h" #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" +#include "ui/views/layout/layout_provider.h" class LabsComboboxModel : public ui::ComboboxModel { public: @@ -39,21 +42,35 @@ : feature_entry_(feature_entry) { SetLayoutManager(std::make_unique<views::FlexLayout>()) ->SetOrientation(views::LayoutOrientation::kVertical) - .SetDefault(views::kMarginsKey, gfx::Insets(10)); + .SetCrossAxisAlignment(views::LayoutAlignment::kStart); + SetBorder(views::CreateEmptyBorder( + gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_CONTROL_LIST_VERTICAL), + 0))); + AddChildView(views::Builder<views::Label>() + .SetTextContext(views::style::CONTEXT_DIALOG_BODY_TEXT) .SetText(lab.visible_name) .SetHorizontalAlignment(gfx::ALIGN_LEFT) .Build()); AddChildView( views::Builder<views::Label>() .SetText(lab.visible_description) + .SetTextContext(ChromeTextContext::CONTEXT_DIALOG_BODY_TEXT_SMALL) + .SetTextStyle(views::style::STYLE_SECONDARY) .SetMultiLine(true) .SetHorizontalAlignment(gfx::ALIGN_LEFT) .SetProperty(views::kFlexBehaviorKey, views::FlexSpecification( views::MinimumFlexSizeRule::kPreferred, views::MaximumFlexSizeRule::kPreferred, true)) + .SetBorder(views::CreateEmptyBorder( + gfx::Insets(0, 0, + views::LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL), + 0))) .Build()); + AddChildView(views::Builder<views::Combobox>() .CopyAddressTo(&lab_state_combobox_) .SetOwnedModel(std::make_unique<LabsComboboxModel>(
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_browsertest.cc b/chrome/browser/ui/views/web_apps/web_app_integration_browsertest.cc index e0a6e95..d0f93bd7 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_browsertest.cc +++ b/chrome/browser/ui/views/web_apps/web_app_integration_browsertest.cc
@@ -38,21 +38,35 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "services/network/public/cpp/network_switches.h" #include "testing/gmock/include/gmock/gmock.h" +#include "third_party/re2/src/re2/re2.h" namespace { -std::string test_case_file = "web_app_integration_browsertest_cases.csv"; -std::string platform_name = +const std::string kTestCaseFilename = + "web_app_integration_browsertest_cases.csv"; +const std::string kExpectationsFilename = "TestExpectations"; +const std::string kPlatformName = #if BUILDFLAG(IS_CHROMEOS_ASH) - "cros"; + "ChromeOS"; #elif defined(OS_LINUX) - "linux"; + "Linux"; #elif defined(OS_MAC) - "macos"; + "Mac"; #elif defined(OS_WIN) - "win"; + "Win"; #endif // BUILDFLAG(IS_CHROMEOS_ASH) +std::string StripAllWhitespace(std::string line) { + std::string output; + output.reserve(line.size()); + for (const char& c : line) { + if (!isspace(c)) { + output += c; + } + } + return output; +} + // Returns the path of the requested file in the test data directory. base::FilePath GetTestFilePath(const std::string& file_name) { base::FilePath file_path; @@ -64,29 +78,85 @@ return file_path.AppendASCII(file_name); } -std::vector<std::string> ReadTestInputFile(std::string& file_name) { +std::vector<std::string> ReadTestInputFile(const std::string& file_name) { base::FilePath file = GetTestFilePath(file_name); std::string contents; std::vector<std::string> test_cases; if (!base::ReadFileToString(file, &contents)) { - LOG(ERROR) << "File not found: " << file.value(); return test_cases; } std::vector<std::string> file_lines = base::SplitString( contents, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); for (const auto& line : file_lines) { + if (line[0] == '#') { + continue; + } + + if (line.find('|') == std::string::npos) { + test_cases.push_back(StripAllWhitespace(line)); + continue; + } + std::vector<std::string> platforms_and_test = base::SplitString( line, "|", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - if (platforms_and_test[0] == "all" || - platforms_and_test[0].find(platform_name) != std::string::npos) { - test_cases.push_back(platforms_and_test[1]); + if (platforms_and_test[0].find(kPlatformName) != std::string::npos) { + test_cases.push_back(StripAllWhitespace(platforms_and_test[1])); } } return test_cases; } +std::vector<std::string> GetPlatformIgnoredTests(const std::string& file_name) { + base::FilePath file = GetTestFilePath(file_name); + std::string contents; + std::vector<std::string> platform_expectations; + if (!base::ReadFileToString(file, &contents)) { + return platform_expectations; + } + + std::vector<std::string> file_lines = base::SplitString( + contents, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + for (const auto& line : file_lines) { + if (line[0] == '#') { + continue; + } + + std::string platform; + std::string expectation; + std::string test_case; + RE2::FullMatch( + line, "crbug.com/\\d* \\[ (\\w*) \\] \\[ (\\w*) \\] ([\\w*,\\s*]*)", + &platform, &expectation, &test_case); + if (platform == kPlatformName) { + if (expectation == "Skip") { + platform_expectations.push_back(StripAllWhitespace(test_case)); + } else { + NOTREACHED() << "Unsupported expectation " << expectation; + } + } + } + return platform_expectations; +} + +std::vector<std::string> BuildAllPlatformTestCaseSet() { + std::vector<std::string> test_cases_all = + ReadTestInputFile(kTestCaseFilename); + std::sort(test_cases_all.begin(), test_cases_all.end()); + + std::vector<std::string> ignored_cases = + GetPlatformIgnoredTests(kExpectationsFilename); + std::sort(ignored_cases.begin(), ignored_cases.end()); + + std::vector<std::string> final_tests(test_cases_all.size()); + auto iter = std::set_difference(test_cases_all.begin(), test_cases_all.end(), + ignored_cases.begin(), ignored_cases.end(), + final_tests.begin()); + final_tests.resize(iter - final_tests.begin()); + return final_tests; +} + } // anonymous namespace namespace web_app { @@ -401,6 +471,6 @@ INSTANTIATE_TEST_SUITE_P(All, WebAppIntegrationBrowserTest, - testing::ValuesIn(ReadTestInputFile(test_case_file))); + testing::ValuesIn(BuildAllPlatformTestCaseSet())); } // namespace web_app
diff --git a/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_localized_strings_provider.cc b/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_localized_strings_provider.cc index 88650430..14ed057 100644 --- a/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_localized_strings_provider.cc
@@ -69,7 +69,11 @@ {"eidPopupTitle", IDS_CELLULAR_SETUP_EID_POPUP_TITLE}, {"eidPopupDescription", IDS_CELLULAR_SETUP_EID_POPUP_DESCRIPTION}, {"closeEidPopupButtonLabel", - IDS_CELLULAR_SETUP_CLOSE_EID_POPUP_BUTTON_LABEL}}; + IDS_CELLULAR_SETUP_CLOSE_EID_POPUP_BUTTON_LABEL}, + {"confirmationCodeMessage", + IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_MESSAGE}, + {"confirmationCodeInput", + IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_INPUT}}; // namespace struct NamedBoolean { const char* name;
diff --git a/chrome/browser/ui/webui/media/webrtc_logs_ui.cc b/chrome/browser/ui/webui/media/webrtc_logs_ui.cc index 0e3f9cb..a69083d 100644 --- a/chrome/browser/ui/webui/media/webrtc_logs_ui.cc +++ b/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
@@ -27,6 +27,7 @@ #include "chrome/common/url_constants.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/webrtc_logs_resources.h" +#include "chrome/grit/webrtc_logs_resources_map.h" #include "components/prefs/pref_service.h" #include "components/upload_list/upload_list.h" #include "components/version_info/version_info.h" @@ -78,8 +79,9 @@ AddLocalizedStringsBulk(source, kStrings); source->UseStringsJs(); - source->AddResourcePath("webrtc_logs.js", IDR_WEBRTC_LOGS_JS); - source->SetDefaultResource(IDR_WEBRTC_LOGS_HTML); + webui::AddResourcePathsBulk( + source, base::make_span(kWebrtcLogsResources, kWebrtcLogsResourcesSize)); + source->SetDefaultResource(IDR_WEBRTC_LOGS_WEBRTC_LOGS_HTML); return source; }
diff --git a/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc b/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc index 5ea3b9f8..5d861f94 100644 --- a/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc +++ b/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc
@@ -509,6 +509,14 @@ {"assignSelectSwitchLabel", IDS_SETTINGS_ASSIGN_SELECT_SWITCH_LABEL}, {"assignNextSwitchLabel", IDS_SETTINGS_ASSIGN_NEXT_SWITCH_LABEL}, {"assignPreviousSwitchLabel", IDS_SETTINGS_ASSIGN_PREVIOUS_SWITCH_LABEL}, + {"switchAccessInternalDeviceTypeLabel", + IDS_SETTINGS_SWITCH_ACCESS_INTERNAL_DEVICE_TYPE_LABEL}, + {"switchAccessUsbDeviceTypeLabel", + IDS_SETTINGS_SWITCH_ACCESS_USB_DEVICE_TYPE_LABEL}, + {"switchAccessBluetoothDeviceTypeLabel", + IDS_SETTINGS_SWITCH_ACCESS_BLUETOOTH_DEVICE_TYPE_LABEL}, + {"switchAccessUnknownDeviceTypeLabel", + IDS_SETTINGS_SWITCH_ACCESS_UNKNOWN_DEVICE_TYPE_LABEL}, {"switchAccessActionAssignmentDialogAssignedIconLabel", IDS_SETTINGS_SWITCH_ACCESS_ACTION_ASSIGNMENT_DIALOG_ASSIGNED_ICON_LABEL}, {"switchAccessActionAssignmentDialogAddAssignmentIconLabel", @@ -535,6 +543,7 @@ IDS_SETTINGS_SWITCH_ACCESS_ACTION_ASSIGNMENT_DIALOG_WAIT_FOR_CONFIRMATION_REMOVAL_PROMPT}, {"switchAccessActionAssignmentDialogWarnCannotRemoveLastSelectSwitch", IDS_SETTINGS_SWITCH_ACCESS_ACTION_ASSIGNMENT_DIALOG_WARN_CANNOT_REMOVE_LAST_SELECT_SWITCH}, + {"switchAndDeviceType", IDS_SETTINGS_SWITCH_AND_DEVICE_TYPE}, {"noSwitchesAssigned", IDS_SETTINGS_NO_SWITCHES_ASSIGNED}, {"switchAccessActionAssignmentDialogExit", IDS_SETTINGS_SWITCH_ACCESS_ACTION_ASSIGNMENT_DIALOG_EXIT},
diff --git a/chrome/browser/ui/webui/settings/chromeos/switch_access_handler.cc b/chrome/browser/ui/webui/settings/chromeos/switch_access_handler.cc index 05b573b0..b6c8ffe9 100644 --- a/chrome/browser/ui/webui/settings/chromeos/switch_access_handler.cc +++ b/chrome/browser/ui/webui/settings/chromeos/switch_access_handler.cc
@@ -137,15 +137,17 @@ base::DictionaryValue response; response.SetIntPath("keyCode", static_cast<int>(event->key_code())); response.SetStringPath("key", GetStringForKeyboardCode(event->key_code())); + ui::InputDeviceType deviceType = ui::INPUT_DEVICE_UNKNOWN; int source_device_id = event->source_device_id(); for (const auto& keyboard : ui::DeviceDataManager::GetInstance()->GetKeyboardDevices()) { if (source_device_id == keyboard.id) { - response.SetStringPath("device", GetSwitchAccessDevice(keyboard.type)); + deviceType = keyboard.type; break; } } + response.SetStringPath("device", GetSwitchAccessDevice(deviceType)); FireWebUIListener("switch-access-got-key-press-for-assignment", response); } @@ -186,17 +188,18 @@ auto* keycodes = prefs_->GetDictionary(info.pref_name); base::ListValue keys; for (const auto& item : keycodes->DictItems()) { - base::DictionaryValue key; int key_code; if (!base::StringToInt(item.first, &key_code)) { NOTREACHED(); return; } - key.SetStringPath("key", GetStringForKeyboardCode( - static_cast<ui::KeyboardCode>(key_code))); - key.SetPath("devices", item.second.Clone()); - - keys.Append(std::move(key)); + for (const base::Value& device_type : item.second.GetList()) { + base::DictionaryValue key; + key.SetStringPath("key", GetStringForKeyboardCode( + static_cast<ui::KeyboardCode>(key_code))); + key.SetStringPath("device", device_type.GetString()); + keys.Append(std::move(key)); + } } response.SetPath(info.action_name_for_js, std::move(keys)); }
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 213d885..be83b691 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-master-1610128749-0f05f817c8023f7311c3f1f138caa77d30d9071d.profdata +chrome-linux-master-1610150355-4a8e87c65afe038c52dde92bd9ad8141fba84ab9.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 77596d27..c151657 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-master-1610107094-52dce87c233c024b300dbf806becfa12ff1bc3d4.profdata +chrome-win64-master-1610161046-8bb47bdff715346cff6fa6c623eb76f6c2e1f1b6.profdata
diff --git a/chrome/common/extensions/api/scripting.idl b/chrome/common/extensions/api/scripting.idl index 4da3b22..d8fe32a 100644 --- a/chrome/common/extensions/api/scripting.idl +++ b/chrome/common/extensions/api/scripting.idl
@@ -8,7 +8,7 @@ callback InjectedFunction = void(); // The origin for a style change. - // See <href="https://developer.mozilla.org/en-US/docs/Glossary/Style_origin">style origins</href> + // See <a href="https://developer.mozilla.org/en-US/docs/Glossary/Style_origin">style origins</a> // for more info. enum StyleOrigin { AUTHOR, @@ -19,7 +19,7 @@ // The ID of the tab into which to inject. long tabId; - // The <a href="https://developer.chrome.com/extensions/webNavigation#frame_ids">IDs</href> + // The <a href="https://developer.chrome.com/extensions/webNavigation#frame_ids">IDs</a> // of specific frames to inject into. long[]? frameIds;
diff --git a/chrome/test/data/pdf/document_info.in b/chrome/test/data/pdf/document_info.in new file mode 100644 index 0000000..061890a8 --- /dev/null +++ b/chrome/test/data/pdf/document_info.in
@@ -0,0 +1,37 @@ +{{header}} +{{object 1 0}} << + /Type /Catalog + /Pages 2 0 R +>> +endobj +{{object 2 0}} << + /Type /Pages + /MediaBox [ 0 0 200 200 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +{{object 3 0}} << + /Type /Page + /Parent 2 0 R +>> +endobj +{{object 4 0}} << + /Author (Chromium Authors) + /CreationDate (D:20200205153912+00'00' ) + /Creator (Your Preferred Text Editor) + /Keywords (testing,chromium,pdfium,document,info) + /ModDate (D:20200206094234+00'00') + /Producer (fixup_pdf_template.py) + /Subject (Testing) + /Title ( Sample PDF Document Info ) +>> +endobj +{{xref}} +trailer << + /Info 4 0 R + /Root 1 0 R + {{trailersize}} +>> +{{startxref}} +%%EOF
diff --git a/chrome/test/data/pdf/document_info.pdf b/chrome/test/data/pdf/document_info.pdf new file mode 100644 index 0000000..48e0c98 --- /dev/null +++ b/chrome/test/data/pdf/document_info.pdf
@@ -0,0 +1,45 @@ +%PDF-1.7 +% ò¤ô +1 0 obj << + /Type /Catalog + /Pages 2 0 R +>> +endobj +2 0 obj << + /Type /Pages + /MediaBox [ 0 0 200 200 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +3 0 obj << + /Type /Page + /Parent 2 0 R +>> +endobj +4 0 obj << + /Author (Chromium Authors) + /CreationDate (D:20200205153912+00'00' ) + /Creator (Your Preferred Text Editor) + /Keywords (testing,chromium,pdfium,document,info) + /ModDate (D:20200206094234+00'00') + /Producer (fixup_pdf_template.py) + /Subject (Testing) + /Title ( Sample PDF Document Info ) +>> +endobj +xref +0 5 +0000000000 65535 f +0000000015 00000 n +0000000068 00000 n +0000000161 00000 n +0000000212 00000 n +trailer << + /Info 4 0 R + /Root 1 0 R + /Size 5 +>> +startxref +533 +%%EOF
diff --git a/chrome/test/data/pdf/viewer_properties_dialog_test.js b/chrome/test/data/pdf/viewer_properties_dialog_test.js index 7553839..4cd2adc 100644 --- a/chrome/test/data/pdf/viewer_properties_dialog_test.js +++ b/chrome/test/data/pdf/viewer_properties_dialog_test.js
@@ -33,10 +33,41 @@ viewer.shadowRoot.querySelector('#properties-dialog')); } +/** + * @param {string} field + * @param {string} expectedValue + */ +function assertField(field, expectedValue) { + const actualValue = getPropertiesDialog() + .shadowRoot.querySelector(`#${field}`) + .textContent.trim(); + chrome.test.assertEq(expectedValue, actualValue); +} + const tests = [ async function testPropertiesDialog() { await ensurePropertiesDialogOpen(); + + // TODO(crbug.com/93169): None of the following expected values should be + // '-' when support for every property is implemented. + [['file-name', '-'], + ['file-size', '-'], + ['title', 'Sample PDF Document Info'], + ['author', 'Chromium Authors'], + ['subject', 'Testing'], + ['keywords', '-'], + ['created', '-'], + ['modified', '-'], + ['application', 'Your Preferred Text Editor'], + ['pdf-producer', 'fixup_pdf_template.py'], + ['pdf-version', '-'], + ['page-count', '-'], + ['page-size', '-'], + ['fast-web-view', '-'], + ].forEach(([field, expectedValue]) => assertField(field, expectedValue)); + await ensurePropertiesDialogClose(); + chrome.test.succeed(); }, ];
diff --git a/chrome/test/data/web_apps/TestExpectations b/chrome/test/data/web_apps/TestExpectations new file mode 100644 index 0000000..27ef6c3d --- /dev/null +++ b/chrome/test/data/web_apps/TestExpectations
@@ -0,0 +1,8 @@ +# Format: +# crbug.com/bug_id [Platform] [Expectation] test_case +# +# Supported Platforms: ChromeOS, Linux, Mac, Win +# Supported Expectations: Skip + +# Add support for |uninstall_from_menu| on CrOS +crbug.com/1159651 [ ChromeOS ] [ Skip ] navigate_installable, install_omnibox_or_menu, launch_internal, uninstall_from_menu, navigate_browser_in_scope, assert_install_icon_shown,assert_launch_icon_not_shown,
diff --git a/chrome/test/data/web_apps/web_app_integration_browsertest_cases.csv b/chrome/test/data/web_apps/web_app_integration_browsertest_cases.csv index 22ec970..7893e73 100644 --- a/chrome/test/data/web_apps/web_app_integration_browsertest_cases.csv +++ b/chrome/test/data/web_apps/web_app_integration_browsertest_cases.csv
@@ -1,7 +1,7 @@ -all | navigate_installable,assert_install_icon_shown, assert_launch_icon_not_shown, -all | navigate_not_installable,assert_install_icon_not_shown, -all | navigate_installable,assert_installable,install_omnibox_or_menu, navigate_browser_in_scope,assert_launch_icon_shown, assert_install_icon_not_shown, -all | navigate_installable, install_create_shortcut_tabbed, set_open_in_window_internal, launch_internal, assert_window_created, -all | navigate_installable_site_a, assert_install_icon_shown, install_omnibox_or_menu, assert_window_created, launch_internal_site_a, close_pwa, assert_no_crash, -windows, macos, linux | navigate_installable,install_omnibox_or_menu,launch_internal, uninstall_from_menu,navigate_browser_in_scope, assert_install_icon_shown,assert_launch_icon_not_shown, -cros | navigate_installable,install_omnibox_or_menu,launch_internal, uninstall_internal,navigate_browser_in_scope, assert_install_icon_shown,assert_launch_icon_not_shown, +navigate_installable,assert_install_icon_shown, assert_launch_icon_not_shown, +navigate_not_installable,assert_install_icon_not_shown, +navigate_installable,assert_installable,install_omnibox_or_menu, navigate_browser_in_scope,assert_launch_icon_shown, assert_install_icon_not_shown, +navigate_installable, install_create_shortcut_tabbed, set_open_in_window_internal, launch_internal, assert_window_created, +navigate_installable_site_a, assert_install_icon_shown, install_omnibox_or_menu, assert_window_created, launch_internal_site_a, close_pwa, assert_no_crash, +navigate_installable,install_omnibox_or_menu,launch_internal, uninstall_from_menu,navigate_browser_in_scope, assert_install_icon_shown,assert_launch_icon_not_shown, +ChromeOS | navigate_installable,install_omnibox_or_menu,launch_internal, uninstall_internal,navigate_browser_in_scope, assert_install_icon_shown,assert_launch_icon_not_shown,
diff --git a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/esim_flow_ui_test.js b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/esim_flow_ui_test.js index e8b367d..fd815a6 100644 --- a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/esim_flow_ui_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/esim_flow_ui_test.js
@@ -10,7 +10,7 @@ // #import {setESimManagerRemoteForTesting} from 'chrome://resources/cr_components/chromeos/cellular_setup/mojo_interface_provider.m.js'; // #import {ButtonState} from 'chrome://resources/cr_components/chromeos/cellular_setup/cellular_types.m.js'; // #import {ESimPageName} from 'chrome://resources/cr_components/chromeos/cellular_setup/esim_flow_ui.m.js'; -// #import {assertTrue} from '../../../chai_assert.js'; +// #import {assertEquals, assertTrue} from '../../../chai_assert.js'; // #import {FakeESimManagerRemote} from './fake_esim_manager_remote.m.js'; // #import {FakeCellularSetupDelegate} from './fake_cellular_setup_delegate.m.js'; // clang-format on @@ -18,6 +18,12 @@ suite('CrComponentsEsimFlowUiTest', function() { let eSimPage; let eSimManagerRemote; + let ironPages; + let profileLoadingPage; + let profileDiscoveryPage; + let activationCodePage; + let confirmationCodePage; + let finalPage; async function flushAsync() { Polymer.dom.flush(); @@ -34,11 +40,24 @@ eSimPage.initSubflow(); document.body.appendChild(eSimPage); Polymer.dom.flush(); + + ironPages = eSimPage.$$('iron-pages'); + profileLoadingPage = eSimPage.$$('#profileLoadingPage'); + profileDiscoveryPage = eSimPage.$$('#profileDiscoveryPage'); + activationCodePage = eSimPage.$$('#activationCodePage'); + confirmationCodePage = eSimPage.$$('#confirmationCodePage'); + finalPage = eSimPage.$$('#finalPage'); + + assertTrue(!!profileLoadingPage); + assertTrue(!!profileDiscoveryPage); + assertTrue(!!activationCodePage); + assertTrue(!!confirmationCodePage); + assertTrue(!!finalPage); }); function assertSelectedPage(pageName, page) { - assertTrue(eSimPage.selectedESimPageName_ === pageName); - assertTrue(eSimPage.selectedESimPageName_ === page.id); + assertEquals(ironPages.selected, pageName); + assertEquals(ironPages.selected, page.id); } test('No eSIM profile flow invalid activation code', async function() { @@ -48,14 +67,6 @@ chromeos.cellularSetup.mojom.ProfileInstallResult .kErrorInvalidActivationCode); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const activationCodePage = eSimPage.$$('#activationCodePage'); - const finalPage = eSimPage.$$('#finalPage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!activationCodePage); - assertTrue(!!finalPage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); @@ -87,14 +98,6 @@ test('No eSIM profile flow valid activation code', async function() { eSimManagerRemote.addEuiccForTest(0); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const activationCodePage = eSimPage.$$('#activationCodePage'); - const finalPage = eSimPage.$$('#finalPage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!activationCodePage); - assertTrue(!!finalPage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); @@ -120,15 +123,62 @@ assertSelectedPage(cellular_setup.ESimPageName.FINAL, finalPage); }); + test( + 'No eSIM profile flow valid activation code confirmation code required successful install', + async function() { + eSimManagerRemote.addEuiccForTest(0); + const availableEuiccs = await eSimManagerRemote.getAvailableEuiccs(); + availableEuiccs.euiccs[0].setProfileInstallResultForTest( + chromeos.cellularSetup.mojom.ProfileInstallResult + .kErrorNeedsConfirmationCode); + + // Loading page should be showing. + assertSelectedPage( + cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); + + await flushAsync(); + + // Should now be at the activation code page. + assertSelectedPage( + cellular_setup.ESimPageName.ACTIVATION_CODE, activationCodePage); + // Insert an activation code. + activationCodePage.$$('#activationCode').value = 'ACTIVATION_CODE'; + + // Next button should now be enabled. + assertTrue( + eSimPage.buttonState.next === + cellularSetup.ButtonState.SHOWN_AND_ENABLED); + + eSimPage.navigateForward(); + + await flushAsync(); + + // Confirmation code page should be showing. + assertSelectedPage( + cellular_setup.ESimPageName.CONFIRMATION_CODE, + confirmationCodePage); + + availableEuiccs.euiccs[0].setProfileInstallResultForTest( + chromeos.cellularSetup.mojom.ProfileInstallResult.kSuccess); + confirmationCodePage.$$('#confirmationCode').value = + 'CONFIRMATION_CODE'; + + // Next button should now be enabled. + assertTrue( + eSimPage.buttonState.next === + cellularSetup.ButtonState.SHOWN_AND_ENABLED); + + eSimPage.navigateForward(); + + await flushAsync(); + + // Should go to final page. + assertSelectedPage(cellular_setup.ESimPageName.FINAL, finalPage); + }); + test('Single eSIM profile flow successful install', async function() { eSimManagerRemote.addEuiccForTest(1); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const finalPage = eSimPage.$$('#finalPage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!finalPage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); @@ -147,12 +197,6 @@ profileList.profiles[0].setProfileInstallResultForTest( chromeos.cellularSetup.mojom.ProfileInstallResult.kFailure); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const finalPage = eSimPage.$$('#finalPage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!finalPage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); @@ -164,44 +208,48 @@ assertTrue(!!finalPage.$$('.error')); }); - test('Single eSIM profile flow confirmation code required', async function() { - eSimManagerRemote.addEuiccForTest(1); - const availableEuiccs = await eSimManagerRemote.getAvailableEuiccs(); - const profileList = await availableEuiccs.euiccs[0].getProfileList(); - profileList.profiles[0].setProfileInstallResultForTest( - chromeos.cellularSetup.mojom.ProfileInstallResult - .kErrorNeedsConfirmationCode); + test( + 'Single eSIM profile flow confirmation code required successful install', + async function() { + eSimManagerRemote.addEuiccForTest(1); + const availableEuiccs = await eSimManagerRemote.getAvailableEuiccs(); + const profileList = await availableEuiccs.euiccs[0].getProfileList(); + profileList.profiles[0].setProfileInstallResultForTest( + chromeos.cellularSetup.mojom.ProfileInstallResult + .kErrorNeedsConfirmationCode); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const confirmationCodePage = eSimPage.$$('#confirmationCodePage'); + // Loading page should be showing. + assertSelectedPage( + cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); - assertTrue(!!profileLoadingPage); - assertTrue(!!confirmationCodePage); + await flushAsync(); - // Loading page should be showing. - assertSelectedPage( - cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); + // Confirmation code page should be showing. + assertSelectedPage( + cellular_setup.ESimPageName.CONFIRMATION_CODE, + confirmationCodePage); - await flushAsync(); + profileList.profiles[0].setProfileInstallResultForTest( + chromeos.cellularSetup.mojom.ProfileInstallResult.kSuccess); + confirmationCodePage.$$('#confirmationCode').value = + 'CONFIRMATION_CODE'; - // Confirmation code page should be showing. - assertSelectedPage( - cellular_setup.ESimPageName.CONFIRMATION_CODE, confirmationCodePage); - }); + // Next button should now be enabled. + assertTrue( + eSimPage.buttonState.next === + cellularSetup.ButtonState.SHOWN_AND_ENABLED); + + eSimPage.navigateForward(); + + await flushAsync(); + + // Should go to final page. + assertSelectedPage(cellular_setup.ESimPageName.FINAL, finalPage); + }); test('Multiple eSIM profiles skip discovery flow', async function() { eSimManagerRemote.addEuiccForTest(2); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const profileDiscoveryPage = eSimPage.$$('#profileDiscoveryPage'); - const activationCodePage = eSimPage.$$('#activationCodePage'); - const finalPage = eSimPage.$$('#finalPage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!profileDiscoveryPage); - assertTrue(!!activationCodePage); - assertTrue(!!finalPage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); @@ -240,16 +288,6 @@ test('Multiple eSIM profiles select flow', async function() { eSimManagerRemote.addEuiccForTest(2); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const profileDiscoveryPage = eSimPage.$$('#profileDiscoveryPage'); - const activationCodePage = eSimPage.$$('#activationCodePage'); - const finalPage = eSimPage.$$('#finalPage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!profileDiscoveryPage); - assertTrue(!!activationCodePage); - assertTrue(!!finalPage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage); @@ -292,14 +330,6 @@ chromeos.cellularSetup.mojom.ProfileInstallResult .kErrorNeedsConfirmationCode); - const profileLoadingPage = eSimPage.$$('#profileLoadingPage'); - const profileDiscoveryPage = eSimPage.$$('#profileDiscoveryPage'); - const confirmationCodePage = eSimPage.$$('#confirmationCodePage'); - - assertTrue(!!profileLoadingPage); - assertTrue(!!profileDiscoveryPage); - assertTrue(!!confirmationCodePage); - // Loading page should be showing. assertSelectedPage( cellular_setup.ESimPageName.PROFILE_LOADING, profileLoadingPage);
diff --git a/chrome/test/data/webui/print_preview/BUILD.gn b/chrome/test/data/webui/print_preview/BUILD.gn index 4200eb3b..fcb4fc9d 100644 --- a/chrome/test/data/webui/print_preview/BUILD.gn +++ b/chrome/test/data/webui/print_preview/BUILD.gn
@@ -55,10 +55,9 @@ ":link_container_test", ":margins_settings_test", ":media_size_settings_test", - - #":model_settings_availability_test", - #":model_settings_policy_test", - #":model_test", + ":model_settings_availability_test", + ":model_settings_policy_test", + ":model_test", ":native_layer_stub", #":number_settings_section_interactive_test", @@ -526,6 +525,42 @@ externs_list = [ "$externs_path/mocha-2.5.js" ] } +js_library("model_settings_availability_test") { + deps = [ + ":print_preview_test_utils", + "..:chai_assert", + "//chrome/browser/resources/print_preview:print_preview", + "//ui/webui/resources/js:assert.m", + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:load_time_data.m", + ] + externs_list = [ "$externs_path/mocha-2.5.js" ] +} + +js_library("model_settings_policy_test") { + deps = [ + ":print_preview_test_utils", + "..:chai_assert", + "//chrome/browser/resources/print_preview:print_preview", + "//ui/webui/resources/js:assert.m", + "//ui/webui/resources/js:load_time_data.m", + ] + externs_list = [ "$externs_path/mocha-2.5.js" ] +} + +js_library("model_test") { + deps = [ + ":print_preview_test_utils", + "..:chai_assert", + "..:test_util.m", + "//chrome/browser/resources/print_preview:print_preview", + "//ui/webui/resources/js:assert.m", + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:load_time_data.m", + ] + externs_list = [ "$externs_path/mocha-2.5.js" ] +} + if (is_chromeos_ash) { js_library("print_server_store_test") { deps = [
diff --git a/chrome/test/data/webui/print_preview/model_settings_availability_test.js b/chrome/test/data/webui/print_preview/model_settings_availability_test.js index 5010a2c7..469982c 100644 --- a/chrome/test/data/webui/print_preview/model_settings_availability_test.js +++ b/chrome/test/data/webui/print_preview/model_settings_availability_test.js
@@ -5,15 +5,21 @@ import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, DuplexType, Margins, MarginsType, Size} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {isChromeOS, isMac, isWindows} from 'chrome://resources/js/cr.m.js'; -import {getCddTemplate, getGoogleDriveDestination, getSaveAsPdfDestination} from 'chrome://test/print_preview/print_preview_test_utils.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; + +import {assertEquals, assertFalse, assertTrue} from '../chai_assert.js'; + +import {getCddTemplate, getGoogleDriveDestination, getSaveAsPdfDestination} from './print_preview_test_utils.js'; suite('ModelSettingsAvailabilityTest', function() { - let model = null; + /** @type {!PrintPreviewModelElement} */ + let model; /** @override */ setup(function() { - PolymerTest.clearBody(); - model = document.createElement('print-preview-model'); + document.body.innerHTML = ''; + model = /** @type {!PrintPreviewModelElement} */ ( + document.createElement('print-preview-model')); document.body.appendChild(model); model.documentSettings = { @@ -180,7 +186,7 @@ assertFalse(model.settings.color.available); assertEquals( capabilityAndValue.expectedValue, - model.settings.color.unavailableValue); + /** @type {boolean} */ (model.settings.color.unavailableValue)); }); // Each of these settings should make the setting available, with the @@ -227,7 +233,7 @@ delete capabilities.printer.color; model.set('destination.capabilities', capabilities); assertFalse(model.settings.color.available); - assertTrue(model.settings.color.unavailableValue); + assertTrue(/** @type {boolean} */ (model.settings.color.unavailableValue)); assertFalse(model.settings.color.setFromUi); });
diff --git a/chrome/test/data/webui/print_preview/model_settings_policy_test.js b/chrome/test/data/webui/print_preview/model_settings_policy_test.js index b3c0961..e20ac0b 100644 --- a/chrome/test/data/webui/print_preview/model_settings_policy_test.js +++ b/chrome/test/data/webui/print_preview/model_settings_policy_test.js
@@ -4,15 +4,21 @@ import {ColorModeRestriction, Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, DuplexModeRestriction, Margins, MarginsType, PinModeRestriction, Size} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; -import {getCddTemplate} from 'chrome://test/print_preview/print_preview_test_utils.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; + +import {assertEquals} from '../chai_assert.js'; + +import {getCddTemplate} from './print_preview_test_utils.js'; suite('ModelSettingsPolicyTest', function() { - let model = null; + /** @type {!PrintPreviewModelElement} */ + let model; /** @override */ setup(function() { - PolymerTest.clearBody(); - model = document.createElement('print-preview-model'); + document.body.innerHTML = ''; + model = /** @type {!PrintPreviewModelElement} */ ( + document.createElement('print-preview-model')); document.body.appendChild(model); model.documentSettings = { @@ -22,6 +28,8 @@ isScalingDisabled: false, fitToPageScaling: 100, pageCount: 3, + isPdf: false, + isFromArc: false, title: 'title', };
diff --git a/chrome/test/data/webui/print_preview/model_test.js b/chrome/test/data/webui/print_preview/model_test.js index af81b39..367f0e9 100644 --- a/chrome/test/data/webui/print_preview/model_test.js +++ b/chrome/test/data/webui/print_preview/model_test.js
@@ -2,14 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, DuplexMode, MarginsType, PrinterType, ScalingType, Size} from 'chrome://print/print_preview.js'; +import {Cdd, Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, DuplexMode, MarginsType, PrinterType, ScalingType, Size} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {isChromeOS} from 'chrome://resources/js/cr.m.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {getCddTemplateWithAdvancedSettings} from 'chrome://test/print_preview/print_preview_test_utils.js'; -import {eventToPromise} from 'chrome://test/test_util.m.js'; + +import {assertDeepEquals, assertEquals, assertFalse, assertNotEquals, assertTrue} from '../chai_assert.js'; +import {eventToPromise} from '../test_util.m.js'; + +import {getCddTemplateWithAdvancedSettings} from './print_preview_test_utils.js'; window.model_test = {}; +const model_test = window.model_test; + model_test.suiteName = 'ModelTest'; /** @enum {string} */ model_test.TestNames = { @@ -22,12 +28,14 @@ }; suite(model_test.suiteName, function() { - let model = null; + /** @type {!PrintPreviewModelElement} */ + let model; /** @override */ setup(function() { - PolymerTest.clearBody(); - model = document.createElement('print-preview-model'); + document.body.innerHTML = ''; + model = /** @type {!PrintPreviewModelElement} */ ( + document.createElement('print-preview-model')); document.body.appendChild(model); }); @@ -158,7 +166,7 @@ */ test(assert(model_test.TestNames.SetPolicySettings), function() { model.setSetting('headerFooter', false); - assertFalse(model.settings.headerFooter.value); + assertFalse(/** @type {boolean} */ (model.settings.headerFooter.value)); // Sets to true, but doesn't mark as controlled by a policy. model.setPolicySettings({headerFooter: {defaultMode: true}}); @@ -167,18 +175,18 @@ headerFooter: false, })); model.applyStickySettings(); - assertTrue(model.settings.headerFooter.value); + assertTrue(/** @type {boolean} */ (model.settings.headerFooter.value)); model.setSetting('headerFooter', false); - assertFalse(model.settings.headerFooter.value); + assertFalse(/** @type {boolean} */ (model.settings.headerFooter.value)); model.setPolicySettings({headerFooter: {allowedMode: true}}); model.applyStickySettings(); - assertTrue(model.settings.headerFooter.value); + assertTrue(/** @type {boolean} */ (model.settings.headerFooter.value)); model.setSetting('headerFooter', false); // The value didn't change after setSetting(), because the policy takes // priority. - assertTrue(model.settings.headerFooter.value); + assertTrue(/** @type {boolean} */ (model.settings.headerFooter.value)); }); /** @param {!Destination} testDestination */ @@ -236,6 +244,7 @@ isScalingDisabled: false, fitToPageScaling: 100, pageCount: 3, + isFromArc: false, title: 'title', }; model.pageSize = new Size(612, 792); @@ -263,7 +272,7 @@ 'FooDevice', DestinationType.LOCAL, origin, 'FooName', DestinationConnectionStatus.ONLINE); testDestination.capabilities = - getCddTemplateWithAdvancedSettings(2).capabilities; + getCddTemplateWithAdvancedSettings(2, 'FooDevice').capabilities; if (isChromeOS) { // Make device managed. It's used for testing pin setting behavior. @@ -307,7 +316,7 @@ paperType: 0, }; } - expectEquals(JSON.stringify(expectedDefaultTicketObject), defaultTicket); + assertEquals(JSON.stringify(expectedDefaultTicketObject), defaultTicket); // Toggle all the values and create a new print ticket. toggleSettings(testDestination); @@ -353,7 +362,7 @@ }; } - expectEquals(JSON.stringify(expectedNewTicketObject), newTicket); + assertEquals(JSON.stringify(expectedNewTicketObject), newTicket); }); /** @@ -368,7 +377,7 @@ 'FooCloudDevice', DestinationType.GOOGLE, DestinationOrigin.COOKIES, 'FooCloudName', DestinationConnectionStatus.ONLINE); testDestination.capabilities = - getCddTemplateWithAdvancedSettings(2).capabilities; + getCddTemplateWithAdvancedSettings(2, 'FooDevice').capabilities; model.destination = testDestination; const defaultTicket = model.createCloudJobTicket(testDestination); @@ -396,7 +405,7 @@ ], }, }); - expectEquals(expectedDefaultTicket, defaultTicket); + assertEquals(expectedDefaultTicket, defaultTicket); // Toggle all the values and create a new cloud job ticket. toggleSettings(testDestination); @@ -425,7 +434,7 @@ ], }, }); - expectEquals(expectedNewTicket, newTicket); + assertEquals(expectedNewTicket, newTicket); }); test(assert(model_test.TestNames.ChangeDestination), function() { @@ -433,7 +442,7 @@ 'FooDevice', DestinationType.LOCAL, DestinationOrigin.LOCAL, 'FooName', DestinationConnectionStatus.ONLINE); testDestination.capabilities = - getCddTemplateWithAdvancedSettings(2).capabilities; + getCddTemplateWithAdvancedSettings(2, 'FooDevice').capabilities; // Make black and white printing the default. testDestination.capabilities.printer.color = { option: [ @@ -446,7 +455,7 @@ 'BarDevice', DestinationType.LOCAL, DestinationOrigin.LOCAL, 'BarName', DestinationConnectionStatus.ONLINE); testDestination2.capabilities = - Object.assign({}, testDestination.capabilities); + /** @type {!Cdd} */ (Object.assign({}, testDestination.capabilities)); // Initialize initializeModel(); @@ -486,7 +495,7 @@ 'Device1', DestinationType.LOCAL, DestinationOrigin.LOCAL, 'One', DestinationConnectionStatus.ONLINE); testDestination3.capabilities = - Object.assign({}, testDestination.capabilities); + /** @type {!Cdd} */ (Object.assign({}, testDestination.capabilities)); testDestination3.capabilities.printer.media_size = { option: [ {
diff --git a/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js b/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js index fb1fa04..07f53e10 100644 --- a/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js +++ b/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js
@@ -101,7 +101,7 @@ */ function getSublabelForSelectUpdates(keys) { cr.webUIListenerCallback('switch-access-assignments-changed', { - select: keys.map(key => ({key, devices: ['internal']})), + select: keys.map(key => ({key, device: 'usb'})), next: [], previous: [] }); @@ -120,10 +120,10 @@ // Simulate a pref change for the select action. cr.webUIListenerCallback( 'switch-access-assignments-changed', - {select: [{key: 'a', devices: ['internal']}], next: [], previous: []}); + {select: [{key: 'a', device: 'usb'}], next: [], previous: []}); assertEquals(1, page.selectAssignments_.length); - assertEquals('a', page.selectAssignments_[0]); + assertDeepEquals({key: 'a', device: 'usb'}, page.selectAssignments_[0]); assertEquals(0, page.nextAssignments_.length); assertEquals(0, page.previousAssignments_.length); }); @@ -132,24 +132,29 @@ initPage(); assertEquals('0 switches assigned', getSublabelForSelectUpdates([])); - assertEquals('Backspace', getSublabelForSelectUpdates(['Backspace'])); + assertEquals('Backspace (USB)', getSublabelForSelectUpdates(['Backspace'])); assertEquals( - 'Backspace, Tab', getSublabelForSelectUpdates(['Backspace', 'Tab'])); + 'Backspace (USB), Tab (USB)', + getSublabelForSelectUpdates(['Backspace', 'Tab'])); assertEquals( - 'Backspace, Tab, Enter', + 'Backspace (USB), Tab (USB), Enter (USB)', getSublabelForSelectUpdates(['Backspace', 'Tab', 'Enter'])); assertEquals( - 'Backspace, Tab, Enter, and 1 more switch', + 'Backspace (USB), Tab (USB), Enter (USB), ' + + 'and 1 more switch', getSublabelForSelectUpdates(['Backspace', 'Tab', 'Enter', 'a'])); assertEquals( - 'Backspace, Tab, Enter, and 2 more switches', + 'Backspace (USB), Tab (USB), Enter (USB), ' + + 'and 2 more switches', getSublabelForSelectUpdates(['Backspace', 'Tab', 'Enter', 'a', 'b'])); assertEquals( - 'Backspace, Tab, Enter, and 3 more switches', + 'Backspace (USB), Tab (USB), Enter (USB), ' + + 'and 3 more switches', getSublabelForSelectUpdates( ['Backspace', 'Tab', 'Enter', 'a', 'b', 'c'])); assertEquals( - 'Backspace, Tab, Enter, and 4 more switches', + 'Backspace (USB), Tab (USB), Enter (USB), ' + + 'and 4 more switches', getSublabelForSelectUpdates( ['Backspace', 'Tab', 'Enter', 'a', 'b', 'c', 'd'])); }); @@ -171,9 +176,11 @@ // Simulate pressing 'a' twice. cr.webUIListenerCallback( - 'switch-access-got-key-press-for-assignment', {key: 'a', keyCode: 65}); + 'switch-access-got-key-press-for-assignment', + {key: 'a', keyCode: 65, device: 'usb'}); cr.webUIListenerCallback( - 'switch-access-got-key-press-for-assignment', {key: 'a', keyCode: 65}); + 'switch-access-got-key-press-for-assignment', + {key: 'a', keyCode: 65, device: 'usb'}); // This should cause the dialog to close. await browserProxy.methodCalled( @@ -191,9 +198,11 @@ // Simulate pressing 'a', and then 'b'. cr.webUIListenerCallback( - 'switch-access-got-key-press-for-assignment', {key: 'a', keyCode: 65}); + 'switch-access-got-key-press-for-assignment', + {key: 'a', keyCode: 65, device: 'usb'}); cr.webUIListenerCallback( - 'switch-access-got-key-press-for-assignment', {key: 'b', keyCode: 66}); + 'switch-access-got-key-press-for-assignment', + {key: 'b', keyCode: 66, device: 'usb'}); const element = page.$$('#switchAccessActionAssignmentDialog'); await test_util.waitAfterNextRender(element);
diff --git a/chromeos/components/diagnostics_ui/resources/battery_status_card.html b/chromeos/components/diagnostics_ui/resources/battery_status_card.html index 13578ab..a07b6a3f 100644 --- a/chromeos/components/diagnostics_ui/resources/battery_status_card.html +++ b/chromeos/components/diagnostics_ui/resources/battery_status_card.html
@@ -14,7 +14,8 @@ <data-point slot="body" id="batteryHealth" header="[[i18n('batteryHealthLabel')]]" value="[[getBatteryHealth_(batteryHealth_.batteryWearPercentage)]]" - tooltip-text="[[i18n('batteryHealthTooltipText')]]"> + tooltip-text="[[i18n('batteryHealthTooltipText')]]" + class="data-point-margin-start"> </data-point> <div slot="body" class="divider"></div> <data-point slot="body" id="cycleCount" header="[[i18n('cycleCount')]]" @@ -24,7 +25,8 @@ <div slot="body" class="divider"></div> <data-point slot="body" id="currentNow" header="[[i18n('currentNowLabel')]]" value="[[getCurrentNow_(batteryChargeStatus_.currentNowMilliamps)]]" - tooltip-text="[[i18n('currentNowTooltipText')]]"> + tooltip-text="[[i18n('currentNowTooltipText')]]" + class="data-point-margin-end"> </data-point> <routine-section slot="routines" routines="[[routines_]]"
diff --git a/chromeos/components/diagnostics_ui/resources/cpu_card.html b/chromeos/components/diagnostics_ui/resources/cpu_card.html index 6cf916bf..7ef34b24 100644 --- a/chromeos/components/diagnostics_ui/resources/cpu_card.html +++ b/chromeos/components/diagnostics_ui/resources/cpu_card.html
@@ -14,14 +14,16 @@ header="[[i18n('cpuUsageLabel')]]" value="[[getCurrentlyUsing_(cpuUsage_.percentUsageSystem, cpuUsage_.percentUsageUser)]]" - tooltip-text="[[getCpuUsageTooltipText_()]]"> + tooltip-text="[[getCpuUsageTooltipText_()]]" + class="data-point-margin-start"> </data-point> <div slot="body" class="divider"></div> <data-point slot="body" id="cpuTemp" header="[[i18n('cpuTempLabel')]]" value="[[getCpuTemp_(cpuUsage_.averageCpuTempCelsius)]]"> </data-point> <div slot="body" class="divider"></div> - <data-point slot="body" id="cpuSpeed" header="[[i18n('cpuSpeedLabel')]]" + <data-point slot="body" id="cpuSpeed" class="data-point-margin-end" + header="[[i18n('cpuSpeedLabel')]]" value="[[getCpuSpeed_(cpuUsage_.scalingCurrentFrequencyKhz)]]"> </data-point> <routine-section slot="routines" routines="[[routines_]]"
diff --git a/chromeos/components/diagnostics_ui/resources/data_point.html b/chromeos/components/diagnostics_ui/resources/data_point.html index 7df986b..e415ee97 100644 --- a/chromeos/components/diagnostics_ui/resources/data_point.html +++ b/chromeos/components/diagnostics_ui/resources/data_point.html
@@ -2,24 +2,27 @@ .data-point { display: flex; flex-direction: column; - height: 45px; + height: 40px; justify-content: space-between; + margin: 12px 0; } .header { @apply --diagnostics-data-point-title-font; - color: var(--diagnostics-overview-text-color); + color: var(--diagnostics-data-point-title-color); } #infoIcon { - fill: var(--google-grey-600); - height: 18px; + bottom: 1px; + fill: var(--google-grey-700); + height: 20px; left: 4px; - width: 18px; + width: 20px; } .value { @apply --diagnostics-data-point-subtitle-font; + color: var(--diagnostics-data-point-subtitle-color); } </style> <div class="data-point">
diff --git a/chromeos/components/diagnostics_ui/resources/diagnostics_card.html b/chromeos/components/diagnostics_ui/resources/diagnostics_card.html index 95e310f4..22939d5 100644 --- a/chromeos/components/diagnostics_ui/resources/diagnostics_card.html +++ b/chromeos/components/diagnostics_ui/resources/diagnostics_card.html
@@ -40,8 +40,8 @@ .data-points { border-bottom: 1px solid var(--diagnostics-border-color); display: grid; - grid-template-columns: 1.5fr 0fr 1fr 0fr 1.5fr; - padding-bottom: 8px; + grid-template-columns: 1fr 0fr 1fr 0fr 1fr; + padding-inline: var(--data-point-container-padding); } .icon {
diff --git a/chromeos/components/diagnostics_ui/resources/diagnostics_fonts_css.html b/chromeos/components/diagnostics_ui/resources/diagnostics_fonts_css.html index f1be742..739a375 100644 --- a/chromeos/components/diagnostics_ui/resources/diagnostics_fonts_css.html +++ b/chromeos/components/diagnostics_ui/resources/diagnostics_fonts_css.html
@@ -3,11 +3,12 @@ :host { --diagnostics-default-font-family: "Google Sans", Roboto, sans-serif; --diagnostics-header-font-family: Roboto, sans-serif; + --diagnostics-data-point-font-family: Roboto, sans-serif; --diagnostics-default-font-size: 14px; --diagnostics-header-font-size: 22px; - --diagnostics-data-point-title-font-size: 12px; - --diagnostics-data-point-subtitle-font-size: 15px; + --diagnostics-data-point-title-font-size: 13px; + --diagnostics-data-point-subtitle-font-size: 13px; --diagnostics-overview-font-size: 13px; --diagnostics-chart-label-font-size: 15px; --diagnostics-chart-tick-font-size: 12px; @@ -15,13 +16,16 @@ --diagnostics-default-font-weight: 500; --diagnostics-header-font-weight: 600; - --diagnostics-data-point-title-font-weight: 500; - --diagnostics-data-point-subtitle-font-weight: 550; + --diagnostics-data-point-title-font-weight: 400; + --diagnostics-data-point-subtitle-font-weight: 450; --diagnostics-overview-font-weight: 500; --diagnostics-default-text-color: var(--google-grey-900); --diagnostics-header-text-color: var(--google-grey-900); --diagnostics-overview-text-color: var(--google-grey-600); + --diagnostics-data-point-title-color: var(--google-grey-900); + --diagnostics-data-point-subtitle-color: var(--google-grey-700); + --diagnostics-default-font: { font-family: var(--diagnostics-default-font-family); font-size: var(--diagnostics-default-font-size); @@ -34,12 +38,12 @@ font-weight: var(--diagnostics-header-font-weight); } --diagnostics-data-point-title-font: { - font-family: var(--diagnostics-default-font-family); + font-family: --diagnostics-data-point-font-family font-size: var(--diagnostics-data-point-title-font-size); font-weight: var(--diagnostics-data-point-title-font-weight); }; --diagnostics-data-point-subtitle-font: { - font-family: var(--diagnostics-default-font-family); + font-family: --diagnostics-data-point-font-family font-size: var(--diagnostics-data-point-subtitle-font-size); font-weight: var(--diagnostics-data-point-subtitle-font-weight); };
diff --git a/chromeos/components/diagnostics_ui/resources/diagnostics_shared_css.html b/chromeos/components/diagnostics_ui/resources/diagnostics_shared_css.html index 5ec1273..7db368eb 100644 --- a/chromeos/components/diagnostics_ui/resources/diagnostics_shared_css.html +++ b/chromeos/components/diagnostics_ui/resources/diagnostics_shared_css.html
@@ -13,12 +13,20 @@ background-color: var(--cros-bg-color); } + .data-point-margin-end { + margin-right: 20px; + } + + .data-point-margin-start { + margin-left: 20px; + } + .divider { - border-left: 1px solid var(--diagnostics-border-color); - height: 36px; - padding-inline-start: 20px; + border-left: 1px solid var(--google-grey-200); + height: 32px; + padding-inline: 16px; position: relative; - top: 12%; + top: 24%; } @media (min-width:600px) { @@ -26,6 +34,7 @@ --container-padding: 24px; --content-container-width: 552px; --chart-width: 452px; + --data-point-container-padding: 44px; } } @@ -34,6 +43,7 @@ --container-padding: 64px; --content-container-width: 640px; --chart-width: 540px; + --data-point-container-padding: 64px; } } @@ -42,6 +52,7 @@ --container-padding: 160px; --content-container-width: 640px; --chart-width: 540px; + --data-point-container-padding: 64px; } } @@ -50,6 +61,7 @@ --container-padding: 160px; --content-container-width: 680px; --chart-width: 580px; + --data-point-container-padding: 64px; } } @@ -58,6 +70,7 @@ --container-padding: 360px; --content-container-width: 720px; --chart-width: 620px; + --data-point-container-padding: 64px; } } </style>
diff --git a/chromeos/components/multidevice/secure_message_delegate_impl.cc b/chromeos/components/multidevice/secure_message_delegate_impl.cc index 338502a..fa52391 100644 --- a/chromeos/components/multidevice/secure_message_delegate_impl.cc +++ b/chromeos/components/multidevice/secure_message_delegate_impl.cc
@@ -49,29 +49,6 @@ return std::string(); } -// Parses the serialized HeaderAndBody string returned by the DBus client, and -// calls the corresponding SecureMessageDelegate unwrap callback. -void HandleUnwrapResult( - SecureMessageDelegate::UnwrapSecureMessageCallback callback, - const std::string& unwrap_result) { - securemessage::HeaderAndBody header_and_body; - if (!header_and_body.ParseFromString(unwrap_result)) { - std::move(callback).Run(false, std::string(), securemessage::Header()); - } else { - std::move(callback).Run(true, header_and_body.body(), - header_and_body.header()); - } -} - -// The SecureMessageDelegate expects the keys in the reverse order returned by -// the DBus client. -void HandleKeyPairResult( - SecureMessageDelegate::GenerateKeyPairCallback callback, - const std::string& private_key, - const std::string& public_key) { - std::move(callback).Run(public_key, private_key); -} - } // namespace // static @@ -103,14 +80,17 @@ void SecureMessageDelegateImpl::GenerateKeyPair( GenerateKeyPairCallback callback) { dbus_client_->GenerateEcP256KeyPair( - base::BindOnce(HandleKeyPairResult, std::move(callback))); + base::BindOnce(&SecureMessageDelegateImpl::OnGenerateKeyPairResult, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } void SecureMessageDelegateImpl::DeriveKey(const std::string& private_key, const std::string& public_key, DeriveKeyCallback callback) { - dbus_client_->PerformECDHKeyAgreement(private_key, public_key, - std::move(callback)); + dbus_client_->PerformECDHKeyAgreement( + private_key, public_key, + base::BindOnce(&SecureMessageDelegateImpl::OnDeriveKeyResult, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } void SecureMessageDelegateImpl::CreateSecureMessage( @@ -143,7 +123,10 @@ options.encryption_type = EncSchemeToString(create_options.encryption_scheme); options.signature_type = SigSchemeToString(create_options.signature_scheme); - dbus_client_->CreateSecureMessage(payload, options, std::move(callback)); + dbus_client_->CreateSecureMessage( + payload, options, + base::BindOnce(&SecureMessageDelegateImpl::OnCreateSecureMessageResult, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } void SecureMessageDelegateImpl::UnwrapSecureMessage( @@ -169,7 +152,41 @@ dbus_client_->UnwrapSecureMessage( serialized_message, options, - base::BindOnce(&HandleUnwrapResult, std::move(callback))); + base::BindOnce(&SecureMessageDelegateImpl::OnUnwrapSecureMessageResult, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} + +void SecureMessageDelegateImpl::OnGenerateKeyPairResult( + GenerateKeyPairCallback callback, + const std::string& private_key, + const std::string& public_key) { + // The SecureMessageDelegate expects the keys in the reverse order returned by + // the DBus client. + std::move(callback).Run(public_key, private_key); +} + +void SecureMessageDelegateImpl::OnDeriveKeyResult( + DeriveKeyCallback callback, + const std::string& derived_key) { + std::move(callback).Run(derived_key); +} + +void SecureMessageDelegateImpl::OnCreateSecureMessageResult( + CreateSecureMessageCallback callback, + const std::string& secure_message) { + std::move(callback).Run(secure_message); +} + +void SecureMessageDelegateImpl::OnUnwrapSecureMessageResult( + UnwrapSecureMessageCallback callback, + const std::string& unwrap_result) { + securemessage::HeaderAndBody header_and_body; + if (!header_and_body.ParseFromString(unwrap_result)) { + std::move(callback).Run(false, std::string(), securemessage::Header()); + } else { + std::move(callback).Run(true, header_and_body.body(), + header_and_body.header()); + } } } // namespace multidevice
diff --git a/chromeos/components/multidevice/secure_message_delegate_impl.h b/chromeos/components/multidevice/secure_message_delegate_impl.h index 73de08a..f2fff819 100644 --- a/chromeos/components/multidevice/secure_message_delegate_impl.h +++ b/chromeos/components/multidevice/secure_message_delegate_impl.h
@@ -6,6 +6,7 @@ #define CHROMEOS_COMPONENTS_MULTIDEVICE_SECURE_MESSAGE_DELEGATE_IMPL_H_ #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "chromeos/components/multidevice/secure_message_delegate.h" namespace chromeos { @@ -15,6 +16,8 @@ namespace multidevice { // Concrete SecureMessageDelegate implementation. +// Note: Callbacks are guaranteed to *not* be invoked after +// SecureMessageDelegateImpl is destroyed. class SecureMessageDelegateImpl : public SecureMessageDelegate { public: class Factory { @@ -49,9 +52,26 @@ private: SecureMessageDelegateImpl(); + // Processes results returned from the dbus client, if necessary, and invokes + // the SecureMessageDelegate callbacks with the processed results. Note: When + // invoking dbus client methods, we bind these functions to a weak pointer to + // ensure that these functions are not called after the + // SecureMessageDelegateImpl object is destroyed. + void OnGenerateKeyPairResult(GenerateKeyPairCallback callback, + const std::string& private_key, + const std::string& public_key); + void OnDeriveKeyResult(DeriveKeyCallback callback, + const std::string& derived_key); + void OnCreateSecureMessageResult(CreateSecureMessageCallback callback, + const std::string& secure_message); + void OnUnwrapSecureMessageResult(UnwrapSecureMessageCallback callback, + const std::string& unwrap_result); + // Not owned by this instance. chromeos::EasyUnlockClient* dbus_client_; + base::WeakPtrFactory<SecureMessageDelegateImpl> weak_ptr_factory_{this}; + DISALLOW_COPY_AND_ASSIGN(SecureMessageDelegateImpl); };
diff --git a/chromeos/components/quick_answers/understanding/intent_generator.cc b/chromeos/components/quick_answers/understanding/intent_generator.cc index 1ab8d255..8dbd72f9 100644 --- a/chromeos/components/quick_answers/understanding/intent_generator.cc +++ b/chromeos/components/quick_answers/understanding/intent_generator.cc
@@ -15,6 +15,7 @@ #include "chromeos/constants/chromeos_features.h" #include "chromeos/services/machine_learning/public/cpp/service_connection.h" #include "chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom.h" +#include "ui/base/l10n/l10n_util.h" namespace chromeos { namespace quick_answers { @@ -109,12 +110,17 @@ return false; } -bool IsPreferredLanguage(const std::string& detected_locale, +bool IsPreferredLanguage(const std::string& detected_language, const std::string& preferred_languages_string) { auto preferred_languages = base::SplitString(preferred_languages_string, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - return base::Contains(preferred_languages, detected_locale); + + for (const std::string& locale : preferred_languages) { + if (l10n_util::GetLanguage(locale) == detected_language) + return true; + } + return false; } } // namespace @@ -191,17 +197,17 @@ void IntentGenerator::LanguageDetectorCallback( const QuickAnswersRequest& request, - base::Optional<std::string> detected_locale) { + base::Optional<std::string> detected_language) { language_detector_.reset(); // Generate translation intent if the detected language is different to the // system language and is not one of the preferred languages. - if (detected_locale.has_value() && - detected_locale.value() != request.context.device_properties.language && + if (detected_language.has_value() && + detected_language.value() != request.context.device_properties.language && !IsPreferredLanguage( - detected_locale.value(), + detected_language.value(), request.context.device_properties.preferred_languages)) { - MaybeGenerateTranslationIntent(request, detected_locale.value()); + MaybeGenerateTranslationIntent(request, detected_language.value()); return; } @@ -224,7 +230,7 @@ void IntentGenerator::MaybeGenerateTranslationIntent( const QuickAnswersRequest& request, - const std::string& detected_locale) { + const std::string& detected_language) { DCHECK(complete_callback_); if (!features::IsQuickAnswersTranslationEnabled()) { @@ -245,7 +251,7 @@ std::move(complete_callback_) .Run(IntentInfo(request.selected_text, IntentType::kTranslation, - detected_locale, + detected_language, request.context.device_properties.language)); }
diff --git a/chromeos/components/quick_answers/understanding/intent_generator_unittest.cc b/chromeos/components/quick_answers/understanding/intent_generator_unittest.cc index 7ff0dd0..a7a27481 100644 --- a/chromeos/components/quick_answers/understanding/intent_generator_unittest.cc +++ b/chromeos/components/quick_answers/understanding/intent_generator_unittest.cc
@@ -121,7 +121,7 @@ EXPECT_EQ("quick answers", intent_info_.intent_text); } -TEST_F(IntentGeneratorTest, TranslationIntentPreferredLanguage) { +TEST_F(IntentGeneratorTest, TranslationIntentPreferredLocale) { std::vector<TextLanguagePtr> languages; languages.push_back(DefaultLanguage()); UseFakeServiceConnection({}, languages); @@ -140,6 +140,25 @@ EXPECT_EQ("quick answers", intent_info_.intent_text); } +TEST_F(IntentGeneratorTest, TranslationIntentPreferredLanguage) { + std::vector<TextLanguagePtr> languages; + languages.push_back(DefaultLanguage()); + UseFakeServiceConnection({}, languages); + + QuickAnswersRequest request; + request.selected_text = "quick answers"; + request.context.device_properties.language = "es"; + request.context.device_properties.preferred_languages = "es-MX,en-US,zh-CN"; + intent_generator_->GenerateIntent(request); + + task_environment_.RunUntilIdle(); + + // Should not generate translation intent since the detected language is in + // the preferred languages list. + EXPECT_EQ(IntentType::kUnknown, intent_info_.intent_type); + EXPECT_EQ("quick answers", intent_info_.intent_text); +} + TEST_F(IntentGeneratorTest, TranslationIntentTextLengthAboveThreshold) { std::vector<TextLanguagePtr> languages; languages.push_back(DefaultLanguage());
diff --git a/chromeos/components/quick_answers/utils/language_detector.cc b/chromeos/components/quick_answers/utils/language_detector.cc index f3998de..f0b2467 100644 --- a/chromeos/components/quick_answers/utils/language_detector.cc +++ b/chromeos/components/quick_answers/utils/language_detector.cc
@@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/metrics/field_trial_params.h" #include "chromeos/constants/chromeos_features.h" +#include "ui/base/l10n/l10n_util.h" namespace chromeos { namespace quick_answers { @@ -27,7 +28,7 @@ // highest to the lowest (according to the mojom method documentation). if (!languages.empty() && languages.front()->confidence > confidence_threshold) { - return languages.front()->locale; + return l10n_util::GetLanguage(languages.front()->locale); } return base::nullopt; }
diff --git a/chromeos/services/assistant/BUILD.gn b/chromeos/services/assistant/BUILD.gn index fb2d342e..9d0afbaa56 100644 --- a/chromeos/services/assistant/BUILD.gn +++ b/chromeos/services/assistant/BUILD.gn
@@ -26,6 +26,8 @@ "fake_assistant_manager_service_impl.h", "fake_assistant_settings_impl.cc", "fake_assistant_settings_impl.h", + "platform/audio_devices.cc", + "platform/audio_devices.h", "service.cc", "service.h", "service_context.h", @@ -174,6 +176,7 @@ ] sources = [ + "platform/audio_devices_unittest.cc", "service_unittest.cc", "test_support/fully_initialized_assistant_state.cc", "test_support/fully_initialized_assistant_state.h",
diff --git a/chromeos/services/assistant/assistant_manager_service_impl.cc b/chromeos/services/assistant/assistant_manager_service_impl.cc index 413dd9d..f231204 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.cc +++ b/chromeos/services/assistant/assistant_manager_service_impl.cc
@@ -148,9 +148,6 @@ return kEntryPointProactiveSuggestions; case AssistantEntryPoint::kLauncherChip: return kEntryPointLauncherChip; - case AssistantEntryPoint::kBloom: - return kEntryPointUnspecified; // TODO(jeroendh): Use Bloom specific - // entrypoint } }
diff --git a/chromeos/services/assistant/platform/audio_devices.cc b/chromeos/services/assistant/platform/audio_devices.cc new file mode 100644 index 0000000..485df778 --- /dev/null +++ b/chromeos/services/assistant/platform/audio_devices.cc
@@ -0,0 +1,303 @@ +// Copyright 2020 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 "chromeos/services/assistant/platform/audio_devices.h" + +#include "base/metrics/histogram_functions.h" +#include "base/optional.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" +#include "base/system/sys_info.h" +#include "chromeos/audio/audio_device.h" +#include "chromeos/audio/cras_audio_handler.h" +#include "chromeos/services/assistant/public/cpp/features.h" + +namespace chromeos { +namespace assistant { + +namespace { + +constexpr const char kDefaultLocale[] = "en_us"; + +// Hotword model is expected to have <language>_<region> format with lower +// case, while the locale in pref is stored as <language>-<region> with region +// code in capital letters. So we need to convert the pref locale to the +// correct format. +// Examples: +// "fr" -> "fr_fr" +// "nl-BE" -> "nl_be" +base::Optional<std::string> ToHotwordModel(std::string pref_locale) { + std::vector<std::string> code_strings = base::SplitString( + pref_locale, "-", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + + if (code_strings.size() == 0) { + // Note: I am not sure this happens during real operations, but it + // definitely happens during the ChromeOS performance tests. + return base::nullopt; + } + + DCHECK_LT(code_strings.size(), 3u); + + // For locales with language code "en", use "en_all" hotword model. + if (code_strings[0] == "en") + return "en_all"; + + // If the language code and country code happen to be the same, e.g. + // France (FR) and French (fr), the locale will be stored as "fr" instead + // of "fr-FR" in the profile on Chrome OS. + if (code_strings.size() == 1) + return code_strings[0] + "_" + code_strings[0]; + + return code_strings[0] + "_" + base::ToLowerASCII(code_strings[1]); +} + +const chromeos::AudioDevice* GetHighestPriorityDevice( + const chromeos::AudioDevice* left, + const chromeos::AudioDevice* right) { + if (!left) + return right; + if (!right) + return left; + return left->priority < right->priority ? right : left; +} + +base::Optional<uint64_t> IdToOptional(const AudioDevice* device) { + if (!device) + return base::nullopt; + return device->id; +} + +base::Optional<uint64_t> GetHotwordDeviceId( + const chromeos::AudioDeviceList& devices) { + const chromeos::AudioDevice* result = nullptr; + + for (const chromeos::AudioDevice& device : devices) { + if (!device.is_input) + continue; + + switch (device.type) { + case chromeos::AUDIO_TYPE_HOTWORD: + result = GetHighestPriorityDevice(result, &device); + break; + default: + // ignore other devices + break; + } + } + + return IdToOptional(result); +} + +base::Optional<uint64_t> GetPreferredDeviceId( + const chromeos::AudioDeviceList& devices) { + const chromeos::AudioDevice* result = nullptr; + + for (const chromeos::AudioDevice& device : devices) { + if (!device.is_input) + continue; + + switch (device.type) { + case chromeos::AUDIO_TYPE_USB: + case chromeos::AUDIO_TYPE_HEADPHONE: + case chromeos::AUDIO_TYPE_INTERNAL_MIC: + case chromeos::AUDIO_TYPE_FRONT_MIC: + result = GetHighestPriorityDevice(result, &device); + break; + default: + // ignore other devices + break; + } + } + + return IdToOptional(result); +} + +base::Optional<std::string> ToString(base::Optional<uint64_t> int_value) { + if (!int_value) + return base::nullopt; + return base::NumberToString(int_value.value()); +} + +} // namespace + +// Observer that will report all changes to the audio devices. +// It will unsubscribe from |CrasAudioHandler| in its destructor. +class AudioDevices::ScopedCrasAudioHandlerObserver + : private CrasAudioHandler::AudioObserver { + public: + ScopedCrasAudioHandlerObserver(CrasAudioHandler* cras_audio_handler, + AudioDevices* parent) + : parent_(parent), cras_audio_handler_(cras_audio_handler) {} + ScopedCrasAudioHandlerObserver(const ScopedCrasAudioHandlerObserver&) = + delete; + ScopedCrasAudioHandlerObserver& operator=( + const ScopedCrasAudioHandlerObserver&) = delete; + ~ScopedCrasAudioHandlerObserver() override = default; + + // Start the observer, which means it will + // - Subscribe for changes + // - Fetch the current state. + void StartObserving() { + scoped_observer_.Observe(cras_audio_handler_); + FetchAudioNodes(); + } + + private: + // CrasAudioHandler::AudioObserver implementation: + void OnAudioNodesChanged() override { FetchAudioNodes(); } + + void FetchAudioNodes() { + if (!base::SysInfo::IsRunningOnChromeOS()) + return; + + chromeos::AudioDeviceList audio_devices; + cras_audio_handler_->GetAudioDevices(&audio_devices); + parent_->SetAudioDevices(audio_devices); + } + + AudioDevices* const parent_; + // Owned by |AssistantManagerServiceImpl|. + CrasAudioHandler* const cras_audio_handler_; + base::ScopedObservation<CrasAudioHandler, + CrasAudioHandler::AudioObserver, + &CrasAudioHandler::AddAudioObserver, + &CrasAudioHandler::RemoveAudioObserver> + scoped_observer_{this}; +}; + +// Sends the new hotword model to |cras_audio_handler|. If that fails this class +// will attempt to set the hotword model to |kDefaultLocale|. +class AudioDevices::HotwordModelUpdater { + public: + HotwordModelUpdater(CrasAudioHandler* cras_audio_handler, + uint64_t hotword_device, + const std::string& locale) + : cras_audio_handler_(cras_audio_handler), + hotword_device_(hotword_device), + locale_(locale) { + SendUpdate(); + } + + HotwordModelUpdater(const HotwordModelUpdater&) = delete; + HotwordModelUpdater& operator=(const HotwordModelUpdater&) = delete; + ~HotwordModelUpdater() = default; + + private: + void SendUpdate() { + std::string hotword_model = + ToHotwordModel(locale_).value_or(kDefaultLocale); + + VLOG(2) << "Changing audio hotword model of device " << hotword_device_ + << " to '" << hotword_model << "'"; + + cras_audio_handler_->SetHotwordModel( + hotword_device_, hotword_model, + base::BindOnce(&HotwordModelUpdater::SetDspHotwordLocaleCallback, + weak_factory_.GetWeakPtr(), hotword_model)); + } + + void SetDspHotwordLocaleCallback(std::string pref_locale, bool success) { + base::UmaHistogramBoolean("Assistant.SetDspHotwordLocale", success); + if (success) { + VLOG(2) << "Successfully changed audio hotword model"; + return; + } + + LOG(ERROR) << "Set " << pref_locale + << " hotword model failed, fallback to default locale."; + // Reset the locale to the default value if we failed to sync it to the + // locale stored in user's pref. + cras_audio_handler_->SetHotwordModel( + hotword_device_, /* hotword_model */ kDefaultLocale, + base::BindOnce([](bool success) { + if (!success) + LOG(ERROR) << "Reset to default hotword model failed."; + })); + } + + CrasAudioHandler* const cras_audio_handler_; + uint64_t hotword_device_; + std::string locale_; + + base::WeakPtrFactory<HotwordModelUpdater> weak_factory_{this}; +}; + +AudioDevices::AudioDevices(CrasAudioHandler* cras_audio_handler, + const std::string& locale) + : cras_audio_handler_(cras_audio_handler), + locale_(locale), + scoped_cras_audio_handler_observer_( + std::make_unique<ScopedCrasAudioHandlerObserver>(cras_audio_handler, + this)) { + // Note we can only start the observer here, at the end of the constructor, + // to ensure this class is properly initialized when we receive the current + // list of audio devices. + scoped_cras_audio_handler_observer_->StartObserving(); +} + +AudioDevices::~AudioDevices() = default; + +void AudioDevices::AddAndFireObserver(Observer* observer) { + DCHECK(observer); + observers_.AddObserver(observer); + + observer->SetHotwordDeviceId(ToString(hotword_device_id_)); + observer->SetDeviceId(ToString(device_id_)); +} + +void AudioDevices::RemoveObserver(Observer* observer) { + observers_.RemoveObserver(observer); +} + +void AudioDevices::SetLocale(const std::string& locale) { + locale_ = locale; + UpdateHotwordModel(); +} + +void AudioDevices::SetAudioDevicesForTest( + const chromeos::AudioDeviceList& audio_devices) { + SetAudioDevices(audio_devices); +} + +void AudioDevices::SetAudioDevices(const chromeos::AudioDeviceList& devices) { + UpdateHotwordDeviceId(devices); + UpdateDeviceId(devices); + UpdateHotwordModel(); +} + +void AudioDevices::UpdateHotwordDeviceId( + const chromeos::AudioDeviceList& devices) { + hotword_device_id_ = GetHotwordDeviceId(devices); + + VLOG(2) << "Changed audio hotword input device to " + << ToString(hotword_device_id_).value_or("<none>"); + + for (auto& observer : observers_) + observer.SetHotwordDeviceId(ToString(hotword_device_id_)); +} + +void AudioDevices::UpdateDeviceId(const chromeos::AudioDeviceList& devices) { + device_id_ = GetPreferredDeviceId(devices); + + VLOG(2) << "Changed audio input device to " + << ToString(device_id_).value_or("<none>"); + + for (auto& observer : observers_) + observer.SetDeviceId(ToString(device_id_)); +} + +void AudioDevices::UpdateHotwordModel() { + if (!hotword_device_id_) + return; + + if (!features::IsDspHotwordEnabled()) + return; + + hotword_model_updater_ = std::make_unique<HotwordModelUpdater>( + cras_audio_handler_, hotword_device_id_.value(), locale_); +} + +} // namespace assistant +} // namespace chromeos
diff --git a/chromeos/services/assistant/platform/audio_devices.h b/chromeos/services/assistant/platform/audio_devices.h new file mode 100644 index 0000000..3f00cf0 --- /dev/null +++ b/chromeos/services/assistant/platform/audio_devices.h
@@ -0,0 +1,93 @@ +// Copyright 2020 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 CHROMEOS_SERVICES_ASSISTANT_PLATFORM_AUDIO_DEVICES_H_ +#define CHROMEOS_SERVICES_ASSISTANT_PLATFORM_AUDIO_DEVICES_H_ + +#include <cstdint> +#include "base/component_export.h" +#include "base/observer_list.h" +#include "base/optional.h" +#include "base/scoped_observation.h" +#include "chromeos/audio/audio_device.h" + +namespace chromeos { +class CrasAudioHandler; +} // namespace chromeos + +namespace chromeos { +namespace assistant { + +// This class will monitor the available audio devices (through +// |CrasAudioHandler|), and select the devices to use for audio input (both +// regular input and hotword detection). +// When the selected devices change, this class will: +// - Inform the observers. +// - Find the hotword model to use, and send it to +// CrasAudioHandler::SetHotwordModel(). +class COMPONENT_EXPORT(ASSISTANT_SERVICE) AudioDevices { + public: + class Observer : public base::CheckedObserver { + public: + ~Observer() override = default; + + // Set the input device to use for audio capture. + virtual void SetDeviceId(const base::Optional<std::string>& device_id) = 0; + // Set the input device to use for hardware based hotword detection. + virtual void SetHotwordDeviceId( + const base::Optional<std::string>& device_id) = 0; + }; + + AudioDevices(CrasAudioHandler* cras_audio_handler, const std::string& locale); + AudioDevices(const AudioDevices&) = delete; + AudioDevices& operator=(const AudioDevices&) = delete; + ~AudioDevices(); + + void AddAndFireObserver(Observer*); + void RemoveObserver(Observer*); + + void SetLocale(const std::string& locale); + + // Used during unittests to simulate an update to the list of available audio + // devices. + void SetAudioDevicesForTest(const chromeos::AudioDeviceList& audio_devices); + + using ScopedObservation = + base::ScopedObservation<AudioDevices, + Observer, + &AudioDevices::AddAndFireObserver, + &AudioDevices::RemoveObserver>; + + private: + class ScopedCrasAudioHandlerObserver; + class HotwordModelUpdater; + + void SetAudioDevices(const chromeos::AudioDeviceList& audio_devices); + void UpdateHotwordDeviceId(const chromeos::AudioDeviceList& devices); + void UpdateDeviceId(const chromeos::AudioDeviceList& devices); + void UpdateHotwordModel(); + + // Handles the asynchronous nature of sending a new hotword model to + // |cras_audio_handler_|. + std::unique_ptr<HotwordModelUpdater> hotword_model_updater_; + + base::ObserverList<Observer> observers_; + + // Owned by |AssistantManagerServiceImpl|. + CrasAudioHandler* const cras_audio_handler_; + + std::string locale_; + base::Optional<uint64_t> hotword_device_id_; + base::Optional<uint64_t> device_id_; + + // Observes changes to the available audio devices, and sends the list of + // devices to SetAudioDevices(). + std::unique_ptr<ScopedCrasAudioHandlerObserver> + scoped_cras_audio_handler_observer_; +}; + +} // namespace assistant +} // namespace chromeos + +#endif // CHROMEOS_SERVICES_ASSISTANT_PLATFORM_AUDIO_DEVICES_H_
diff --git a/chromeos/services/assistant/platform/audio_devices_unittest.cc b/chromeos/services/assistant/platform/audio_devices_unittest.cc new file mode 100644 index 0000000..dd1cb9f9 --- /dev/null +++ b/chromeos/services/assistant/platform/audio_devices_unittest.cc
@@ -0,0 +1,373 @@ +// Copyright 2020 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 "chromeos/services/assistant/platform/audio_devices.h" + +#include "base/run_loop.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/task_environment.h" +#include "chromeos/audio/audio_device.h" +#include "chromeos/audio/cras_audio_handler.h" +#include "chromeos/dbus/audio/fake_cras_audio_client.h" +#include "chromeos/services/assistant/public/cpp/features.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace chromeos { +namespace assistant { + +namespace { + +using ::testing::_; + +constexpr const char kDefaultLocale[] = "en_us"; + +class FakeAudioDevicesObserver : public AudioDevices::Observer { + public: + FakeAudioDevicesObserver() = default; + FakeAudioDevicesObserver(const FakeAudioDevicesObserver&) = delete; + FakeAudioDevicesObserver& operator=(const FakeAudioDevicesObserver&) = delete; + ~FakeAudioDevicesObserver() override = default; + + // AudioDevices::Observer implementation + void SetDeviceId(const base::Optional<std::string>& device_id) override { + preferred_device_id_ = device_id; + } + void SetHotwordDeviceId( + const base::Optional<std::string>& device_id) override { + hotword_device_id_ = device_id; + } + + std::string preferred_device_id() { + return preferred_device_id_.value_or("<none>"); + } + + std::string hotword_device_id() { + return hotword_device_id_.value_or("<none>"); + } + + private: + base::Optional<std::string> preferred_device_id_; + base::Optional<std::string> hotword_device_id_; +}; + +class DeviceBuilder { + public: + explicit DeviceBuilder(AudioDeviceType type) { + result_.type = type; + result_.is_input = true; + } + DeviceBuilder(const DeviceBuilder&) = delete; + DeviceBuilder& operator=(const DeviceBuilder&) = delete; + ~DeviceBuilder() = default; + + DeviceBuilder& WithId(int id) { + result_.id = id; + return *this; + } + + DeviceBuilder& WithPriority(int priority) { + result_.priority = priority; + return *this; + } + + DeviceBuilder& WithIsInput(bool is_input) { + result_.is_input = is_input; + return *this; + } + + AudioDevice Build() const { return result_; } + + private: + AudioDevice result_; +}; + +// Mock for |CrosAudioClient|. This inherits from |FakeCrasAudioClient| so we +// only have to mock the methods we're interested in. +// It will automatically be installed as the global singleton in its +// constructor, and removed in the destructor. +class ScopedCrasAudioClientMock : public FakeCrasAudioClient { + public: + ScopedCrasAudioClientMock() = default; + ScopedCrasAudioClientMock(ScopedCrasAudioClientMock&) = delete; + ScopedCrasAudioClientMock& operator=(ScopedCrasAudioClientMock&) = delete; + ~ScopedCrasAudioClientMock() override = default; + + MOCK_METHOD(void, + SetHotwordModel, + (uint64_t node_id, + const std::string& hotword_model, + VoidDBusMethodCallback callback)); +}; + +class ScopedCrasAudioHandler { + public: + ScopedCrasAudioHandler() { CrasAudioHandler::InitializeForTesting(); } + ScopedCrasAudioHandler(const ScopedCrasAudioHandler&) = delete; + ScopedCrasAudioHandler& operator=(const ScopedCrasAudioHandler&) = delete; + ~ScopedCrasAudioHandler() { CrasAudioHandler::Shutdown(); } + + CrasAudioHandler* Get() { return CrasAudioHandler::Get(); } +}; + +} // namespace + +class AssistantAudioDevicesTest : public testing::Test { + public: + AssistantAudioDevicesTest() + : audio_devices_(cras_audio_handler_.Get(), "pref-locale") { + // Enable DSP feature flag. + scoped_feature_list_.InitAndEnableFeature(features::kEnableDspHotword); + } + + AssistantAudioDevicesTest(const AssistantAudioDevicesTest&) = delete; + AssistantAudioDevicesTest& operator=(const AssistantAudioDevicesTest&) = + delete; + ~AssistantAudioDevicesTest() override = default; + + AudioDevices& audio_devices() { return audio_devices_; } + + ScopedCrasAudioClientMock& cras_audio_client_mock() { + return cras_audio_client_mock_; + } + + void UpdateDeviceList(const AudioDeviceList& devices) { + audio_devices().SetAudioDevicesForTest(devices); + } + + private: + base::test::TaskEnvironment task_environment_; + base::test::ScopedFeatureList scoped_feature_list_; + testing::NiceMock<ScopedCrasAudioClientMock> cras_audio_client_mock_; + ScopedCrasAudioHandler cras_audio_handler_; + AudioDevices audio_devices_; +}; + +TEST_F(AssistantAudioDevicesTest, ShouldSendHotwordDeviceToObserver) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(111).Build()}); + + EXPECT_EQ("111", observer.hotword_device_id()); + EXPECT_EQ("<none>", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldSendUsbDeviceToObserver) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_USB).WithId(222).Build()}); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("222", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldSendHeadphonesDeviceToObserver) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HEADPHONE).WithId(333).Build()}); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("333", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldSendInternalMicDeviceToObserver) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList( + {DeviceBuilder(AUDIO_TYPE_INTERNAL_MIC).WithId(444).Build()}); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("444", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldSendFrontMicDeviceToObserver) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_FRONT_MIC).WithId(555).Build()}); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("555", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldUseHighestPriorityHotwordDevice) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(111).WithPriority(1).Build(), + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(555).WithPriority(5).Build(), + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(222).WithPriority(2).Build(), + }); + + EXPECT_EQ("555", observer.hotword_device_id()); + EXPECT_EQ("<none>", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldIgnoreNonInputHotwordDevices) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(111).WithIsInput(false).Build(), + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(222).WithIsInput(true).Build(), + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(333).WithIsInput(false).Build(), + }); + + EXPECT_EQ("222", observer.hotword_device_id()); + EXPECT_EQ("<none>", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldUseHighestPriorityDevice) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_USB).WithId(111).WithPriority(1).Build(), + DeviceBuilder(AUDIO_TYPE_USB).WithId(555).WithPriority(5).Build(), + DeviceBuilder(AUDIO_TYPE_USB).WithId(222).WithPriority(2).Build(), + }); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("555", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldIgnoreNonInputDevices) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_USB).WithId(111).WithIsInput(false).Build(), + DeviceBuilder(AUDIO_TYPE_USB).WithId(222).WithIsInput(true).Build(), + DeviceBuilder(AUDIO_TYPE_USB).WithId(333).WithIsInput(false).Build(), + }); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("222", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldIgnoreUnsupportedDeviceTypes) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_BLUETOOTH).WithId(2).Build(), + DeviceBuilder(AUDIO_TYPE_BLUETOOTH_NB_MIC).WithId(3).Build(), + DeviceBuilder(AUDIO_TYPE_HDMI).WithId(4).Build(), + DeviceBuilder(AUDIO_TYPE_INTERNAL_SPEAKER).WithId(5).Build(), + DeviceBuilder(AUDIO_TYPE_REAR_MIC).WithId(6).Build(), + DeviceBuilder(AUDIO_TYPE_KEYBOARD_MIC).WithId(7).Build(), + DeviceBuilder(AUDIO_TYPE_LINEOUT).WithId(8).Build(), + DeviceBuilder(AUDIO_TYPE_POST_MIX_LOOPBACK).WithId(9).Build(), + DeviceBuilder(AUDIO_TYPE_POST_DSP_LOOPBACK).WithId(10).Build(), + DeviceBuilder(AUDIO_TYPE_ALSA_LOOPBACK).WithId(11).Build(), + DeviceBuilder(AUDIO_TYPE_OTHER).WithId(12).Build(), + }); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("<none>", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldFireObserverWhenAdded) { + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(111).Build(), + DeviceBuilder(AUDIO_TYPE_USB).WithId(222).Build(), + }); + + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + + EXPECT_EQ("111", observer.hotword_device_id()); + EXPECT_EQ("222", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, ShouldNotFireObserverAfterItsRemoved) { + FakeAudioDevicesObserver observer; + audio_devices().AddAndFireObserver(&observer); + audio_devices().RemoveObserver(&observer); + + UpdateDeviceList({ + DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(111).Build(), + DeviceBuilder(AUDIO_TYPE_USB).WithId(222).Build(), + }); + + EXPECT_EQ("<none>", observer.hotword_device_id()); + EXPECT_EQ("<none>", observer.preferred_device_id()); +} + +TEST_F(AssistantAudioDevicesTest, + ShouldUpdateHotwordModelWhenHotwordDeviceIsAdded) { + EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel); + + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HOTWORD).Build()}); +} + +TEST_F(AssistantAudioDevicesTest, ShouldFormatLocaleToHotwordModel) { + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(111).Build()}); + + // Normal case + EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(111, "nl_be", _)); + audio_devices().SetLocale("nl-BE"); + base::RunLoop().RunUntilIdle(); + + // Handle the case where country code and language code are the same + EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(111, "fr_fr", _)); + audio_devices().SetLocale("fr"); + base::RunLoop().RunUntilIdle(); + + // use "en_all" for all english locales + EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(111, "en_all", _)); + audio_devices().SetLocale("en-US"); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(AssistantAudioDevicesTest, ShouldUseDefaultLocaleIfUserPrefIsRejected) { + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HOTWORD).WithId(222).Build()}); + + EXPECT_CALL(cras_audio_client_mock(), + SetHotwordModel(_, "rejected_locale", _)) + .WillOnce([](uint64_t node_id, const std::string&, + VoidDBusMethodCallback callback) { + // Report failure to change the locale + std::move(callback).Run(/*success=*/false); + }); + + EXPECT_CALL(cras_audio_client_mock(), + SetHotwordModel(222, kDefaultLocale, _)); + + audio_devices().SetLocale("rejected-LOCALE"); +} + +TEST_F(AssistantAudioDevicesTest, ShouldUseDefaultLocaleIfUserPrefIsEmpty) { + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HOTWORD).Build()}); + + EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(_, kDefaultLocale, _)); + + audio_devices().SetLocale(""); +} + +TEST_F(AssistantAudioDevicesTest, ShouldDoNothingIfUserPrefIsAccepted) { + UpdateDeviceList({DeviceBuilder(AUDIO_TYPE_HOTWORD).Build()}); + + EXPECT_CALL(cras_audio_client_mock(), + SetHotwordModel(_, "accepted_locale", _)) + .WillOnce([](uint64_t node_id, const std::string&, + VoidDBusMethodCallback callback) { + // Accept the change to the locale. + std::move(callback).Run(/*success=*/true); + }); + + // Do not expect a second call if change of locale is accepted + EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(_, kDefaultLocale, _)) + .Times(0); + + audio_devices().SetLocale("accepted-LOCALE"); +} + +} // namespace assistant +} // namespace chromeos
diff --git a/chromeos/services/assistant/platform/audio_input_host.cc b/chromeos/services/assistant/platform/audio_input_host.cc index cb67acd..6ace7006 100644 --- a/chromeos/services/assistant/platform/audio_input_host.cc +++ b/chromeos/services/assistant/platform/audio_input_host.cc
@@ -5,11 +5,8 @@ #include "chromeos/services/assistant/platform/audio_input_host.h" #include "base/check.h" -#include "base/metrics/histogram_functions.h" #include "base/optional.h" -#include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" -#include "chromeos/audio/cras_audio_handler.h" +#include "chromeos/services/assistant/platform/audio_devices.h" #include "chromeos/services/assistant/platform/audio_input_impl.h" #include "chromeos/services/assistant/public/cpp/features.h" @@ -18,8 +15,6 @@ namespace { -constexpr const char kDefaultLocale[] = "en_us"; - AudioInputImpl::LidState ConvertLidState( chromeos::PowerManagerClient::LidState state) { switch (state) { @@ -33,52 +28,21 @@ } } -// Hotword model is expected to have <language>_<region> format with lower -// case, while the locale in pref is stored as <language>-<region> with region -// code in capital letters. So we need to convert the pref locale to the -// correct format. -// Examples: -// "fr" -> "fr_fr" -// "nl-BE" -> "nl_be" -base::Optional<std::string> ToHotwordModel(std::string pref_locale) { - std::vector<std::string> code_strings = base::SplitString( - pref_locale, "-", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - - if (code_strings.size() == 0) { - // Note: I am not sure this happens during real operations, but it - // definitely happens during the ChromeOS performance tests. - return base::nullopt; - } - - DCHECK_LT(code_strings.size(), 3u); - - // For locales with language code "en", use "en_all" hotword model. - if (code_strings[0] == "en") - return "en_all"; - - // If the language code and country code happen to be the same, e.g. - // France (FR) and French (fr), the locale will be stored as "fr" instead - // of "fr-FR" in the profile on Chrome OS. - if (code_strings.size() == 1) - return code_strings[0] + "_" + code_strings[0]; - - return code_strings[0] + "_" + base::ToLowerASCII(code_strings[1]); -} - } // namespace chromeos::assistant::AudioInputHost::AudioInputHost( AudioInputImpl* audio_input, CrasAudioHandler* cras_audio_handler, - chromeos::PowerManagerClient* power_manager_client) + chromeos::PowerManagerClient* power_manager_client, + const std::string& locale) : audio_input_(audio_input), - cras_audio_handler_(cras_audio_handler), power_manager_client_(power_manager_client), - power_manager_client_observer_(this) { + power_manager_client_observer_(this), + audio_devices_(cras_audio_handler, locale) { DCHECK(audio_input_); - DCHECK(cras_audio_handler_); DCHECK(power_manager_client_); + audio_devices_observation_.Observe(&audio_devices_); power_manager_client_observer_.Observe(power_manager_client); power_manager_client->GetSwitchStates(base::BindOnce( &AudioInputHost::OnInitialLidStateReceived, weak_factory_.GetWeakPtr())); @@ -90,8 +54,8 @@ audio_input_->SetMicState(mic_open); } -void AudioInputHost::SetDeviceId(const std::string& device_id) { - audio_input_->SetDeviceId(device_id); +void AudioInputHost::SetDeviceId(const base::Optional<std::string>& device_id) { + audio_input_->SetDeviceId(device_id.value_or("")); } void AudioInputHost::OnConversationTurnStarted() { @@ -111,48 +75,9 @@ audio_input_->OnHotwordEnabled(enable); } -void AudioInputHost::SetHotwordDeviceId(const std::string& device_id) { - hotword_device_id_ = device_id; - audio_input_->SetHotwordDeviceId(device_id); -} - -void AudioInputHost::SetDspHotwordLocale(std::string pref_locale) { - if (!features::IsDspHotwordEnabled()) - return; - - std::string hotword_model = - ToHotwordModel(pref_locale).value_or(kDefaultLocale); - - cras_audio_handler_->SetHotwordModel( - GetDspNodeId(), hotword_model, - base::BindOnce(&AudioInputHost::SetDspHotwordLocaleCallback, - weak_factory_.GetWeakPtr(), hotword_model)); -} - -void AudioInputHost::SetDspHotwordLocaleCallback(std::string pref_locale, - bool success) { - base::UmaHistogramBoolean("Assistant.SetDspHotwordLocale", success); - if (success) - return; - - LOG(ERROR) << "Set " << pref_locale - << " hotword model failed, fallback to default locale."; - // Reset the locale to the default value if we failed to sync it to the locale - // stored in user's pref. - cras_audio_handler_->SetHotwordModel( - GetDspNodeId(), /* hotword_model */ kDefaultLocale, - base::BindOnce([](bool success) { - if (!success) - LOG(ERROR) << "Reset to default hotword model failed."; - })); -} - -uint64_t AudioInputHost::GetDspNodeId() const { - DCHECK(!hotword_device_id_.empty()); - uint64_t result; - bool success = base::StringToUint64(hotword_device_id_, &result); - DCHECK(success) << "Invalid hotword device id '" << hotword_device_id_ << "'"; - return result; +void AudioInputHost::SetHotwordDeviceId( + const base::Optional<std::string>& device_id) { + audio_input_->SetHotwordDeviceId(device_id.value_or("")); } void AudioInputHost::LidEventReceived(
diff --git a/chromeos/services/assistant/platform/audio_input_host.h b/chromeos/services/assistant/platform/audio_input_host.h index 2c0c710..528af7a9 100644 --- a/chromeos/services/assistant/platform/audio_input_host.h +++ b/chromeos/services/assistant/platform/audio_input_host.h
@@ -11,10 +11,7 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "chromeos/dbus/power/power_manager_client.h" - -namespace chromeos { -class CrasAudioHandler; -} // namespace chromeos +#include "chromeos/services/assistant/platform/audio_devices.h" namespace chromeos { namespace assistant { @@ -27,11 +24,15 @@ // This will allow us to move it to the Libassistant mojom service (at which // point this class will talk to the Libassistant mojom service). class COMPONENT_EXPORT(ASSISTANT_SERVICE) AudioInputHost - : public chromeos::PowerManagerClient::Observer { + : private chromeos::PowerManagerClient::Observer, + private AudioDevices::Observer + +{ public: AudioInputHost(AudioInputImpl* audio_input, CrasAudioHandler* cras_audio_handler, - chromeos::PowerManagerClient* power_manager_client); + chromeos::PowerManagerClient* power_manager_client, + const std::string& locale); AudioInputHost(AudioInputHost&) = delete; AudioInputHost& operator=(AudioInputHost&) = delete; ~AudioInputHost() override; @@ -39,26 +40,18 @@ // Called when the mic state associated with the interaction is changed. void SetMicState(bool mic_open); - // Setting the input device to use for audio capture. - void SetDeviceId(const std::string& device_id); - // Called when hotword enabled status changed. void OnHotwordEnabled(bool enable); - // Setting the hotword input device with hardware based hotword detection. - void SetHotwordDeviceId(const std::string& device_id); - - // Setting the hotword locale for the input device with DSP support. - void SetDspHotwordLocale(std::string pref_locale); - void OnConversationTurnStarted(); void OnConversationTurnFinished(); + // AudioDevices::Observer implementation: + void SetDeviceId(const base::Optional<std::string>& device_id) override; + void SetHotwordDeviceId( + const base::Optional<std::string>& device_id) override; + private: - void SetDspHotwordLocaleCallback(std::string pref_locale, bool success); - - uint64_t GetDspNodeId() const; - // chromeos::PowerManagerClient::Observer overrides: void LidEventReceived(chromeos::PowerManagerClient::LidState state, base::TimeTicks timestamp) override; @@ -68,14 +61,15 @@ // Owned by |PlatformApiImpl| which also owns |this|. AudioInputImpl* const audio_input_; - CrasAudioHandler* const cras_audio_handler_; chromeos::PowerManagerClient* const power_manager_client_; base::ScopedObservation<chromeos::PowerManagerClient, chromeos::PowerManagerClient::Observer> power_manager_client_observer_; - // Hotword input device used for hardware based hotword detection. - std::string hotword_device_id_; + // Observes available audio devices and will set device-id/hotword-device-id + // accordingly. + AudioDevices audio_devices_; + AudioDevices::ScopedObservation audio_devices_observation_{this}; base::WeakPtrFactory<AudioInputHost> weak_factory_{this}; };
diff --git a/chromeos/services/assistant/platform/audio_input_impl.cc b/chromeos/services/assistant/platform/audio_input_impl.cc index 66b944b..1e14738b 100644 --- a/chromeos/services/assistant/platform/audio_input_impl.cc +++ b/chromeos/services/assistant/platform/audio_input_impl.cc
@@ -283,6 +283,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(observer_sequence_checker_); if (open_audio_stream_) VLOG(1) << open_audio_stream_->device_id() << " remove observer"; + bool have_no_observer = false; { base::AutoLock lock(lock_);
diff --git a/chromeos/services/assistant/platform/audio_input_impl_unittest.cc b/chromeos/services/assistant/platform/audio_input_impl_unittest.cc index 5d264cb..21811c7 100644 --- a/chromeos/services/assistant/platform/audio_input_impl_unittest.cc +++ b/chromeos/services/assistant/platform/audio_input_impl_unittest.cc
@@ -11,7 +11,6 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/audio/cras_audio_handler.h" -#include "chromeos/dbus/audio/fake_cras_audio_client.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/services/assistant/platform/audio_input_host.h" #include "chromeos/services/assistant/platform/audio_stream_factory_delegate.h" @@ -48,22 +47,14 @@ DISALLOW_COPY_AND_ASSIGN(ScopedFakeAssistantClient); }; -// Mock for |CrosAudioClient|. This inherits from |FakeCrasAudioClient| so we -// only have to mock the methods we're interested in. -// It will automatically be installed as the global singleton in its -// constructor, and removed in the destructor. -class ScopedCrasAudioClientMock : public FakeCrasAudioClient { +class ScopedCrasAudioHandler { public: - ScopedCrasAudioClientMock() = default; - ScopedCrasAudioClientMock(ScopedCrasAudioClientMock&) = delete; - ScopedCrasAudioClientMock& operator=(ScopedCrasAudioClientMock&) = delete; - ~ScopedCrasAudioClientMock() override = default; + ScopedCrasAudioHandler() { CrasAudioHandler::InitializeForTesting(); } + ScopedCrasAudioHandler(const ScopedCrasAudioHandler&) = delete; + ScopedCrasAudioHandler& operator=(const ScopedCrasAudioHandler&) = delete; + ~ScopedCrasAudioHandler() { CrasAudioHandler::Shutdown(); } - MOCK_METHOD(void, - SetHotwordModel, - (uint64_t node_id, - const std::string& hotword_model, - VoidDBusMethodCallback callback)); + CrasAudioHandler* Get() { return CrasAudioHandler::Get(); } }; } // namespace @@ -76,7 +67,6 @@ scoped_feature_list_.InitAndEnableFeature(features::kEnableDspHotword); PowerManagerClient::InitializeFake(); - CrasAudioHandler::InitializeForTesting(); CreateNewAudioInputImpl(); } @@ -87,7 +77,6 @@ // |audio_input_host_| uses the fake power manager client, so must be // destroyed before the power manager client. audio_input_host_.reset(); - CrasAudioHandler::Shutdown(); chromeos::PowerManagerClient::Shutdown(); } @@ -113,8 +102,9 @@ &audio_stream_factory_delegate_, "fake-device-id"); audio_input_host_ = std::make_unique<AudioInputHost>( - audio_input_impl_.get(), CrasAudioHandler::Get(), - FakePowerManagerClient::Get()); + audio_input_impl_.get(), cras_audio_handler_.Get(), + FakePowerManagerClient::Get(), "initial-locale"); + audio_input_host_->SetDeviceId("initial-device-id"); audio_input_impl_->AddObserver(this); @@ -132,10 +122,6 @@ AudioInputHost& audio_input_host() { return *audio_input_host_; } - ScopedCrasAudioClientMock& cras_audio_client_mock() { - return cras_audio_client_mock_; - } - // assistant_client::AudioInput::Observer overrides: void OnAudioBufferAvailable(const assistant_client::AudioBuffer& buffer, int64_t timestamp) override {} @@ -164,7 +150,7 @@ base::test::ScopedFeatureList scoped_feature_list_; ScopedFakeAssistantClient fake_assistant_client_; DefaultAudioStreamFactoryDelegate audio_stream_factory_delegate_; - ::testing::NiceMock<ScopedCrasAudioClientMock> cras_audio_client_mock_; + ScopedCrasAudioHandler cras_audio_handler_; std::unique_ptr<AudioInputImpl> audio_input_impl_; std::unique_ptr<AudioInputHost> audio_input_host_; @@ -290,81 +276,5 @@ EXPECT_FALSE(IsUsingDeadStreamDetection()); } -TEST_F(AudioInputImplTest, ShouldSendHotwordLocaleToCrasAudioClient) { - StopAudioRecording(); - - audio_input_host().SetHotwordDeviceId("111"); - - EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel); - audio_input_host().SetDspHotwordLocale("bla"); -} - -TEST_F(AudioInputImplTest, - ShouldFormatHotwordLocaleAndSendItToCrasAudioClient) { - StopAudioRecording(); - audio_input_host().SetHotwordDeviceId("111"); - - // Normal case - EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(111, "nl_be", _)); - audio_input_host().SetDspHotwordLocale("nl-BE"); - - // Handle the case where country code and language code are the same - EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(111, "fr_fr", _)); - audio_input_host().SetDspHotwordLocale("fr"); - - // use "en_all" for all english locales - EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(111, "en_all", _)); - audio_input_host().SetDspHotwordLocale("en-US"); -} - -TEST_F(AudioInputImplTest, ShouldUseDefaultLocaleIfUserPrefIsRejected) { - const std::string default_locale = "en_us"; - StopAudioRecording(); - audio_input_host().SetHotwordDeviceId("222"); - - EXPECT_CALL(cras_audio_client_mock(), - SetHotwordModel(222, "rejected_locale", _)) - .WillOnce([](uint64_t node_id, const std::string&, - VoidDBusMethodCallback callback) { - // Report failure to change the locale - std::move(callback).Run(/*success=*/false); - }); - - EXPECT_CALL(cras_audio_client_mock(), - SetHotwordModel(222, default_locale, _)); - - audio_input_host().SetDspHotwordLocale("rejected-LOCALE"); -} - -TEST_F(AudioInputImplTest, ShouldUseDefaultLocaleIfUserPrefIsEmpty) { - const std::string default_locale = "en_us"; - StopAudioRecording(); - audio_input_host().SetHotwordDeviceId("222"); - - EXPECT_CALL(cras_audio_client_mock(), - SetHotwordModel(222, default_locale, _)); - - audio_input_host().SetDspHotwordLocale(""); -} - -TEST_F(AudioInputImplTest, ShouldDoNothingIfUserPrefIsAccepted) { - const std::string default_locale = "en_us"; - StopAudioRecording(); - audio_input_host().SetHotwordDeviceId("222"); - - EXPECT_CALL(cras_audio_client_mock(), - SetHotwordModel(222, "accepted_locale", _)) - .WillOnce([](uint64_t node_id, const std::string&, - VoidDBusMethodCallback callback) { - // Accept the change to the locale. - std::move(callback).Run(/*success=*/true); - }); - - // Do not expect a second call if change of locale is accepted - EXPECT_CALL(cras_audio_client_mock(), SetHotwordModel(222, default_locale, _)) - .Times(0); - - audio_input_host().SetDspHotwordLocale("accepted-LOCALE"); -} } // namespace assistant } // namespace chromeos
diff --git a/chromeos/services/assistant/platform_api_impl.cc b/chromeos/services/assistant/platform_api_impl.cc index 63c38759..84d44577 100644 --- a/chromeos/services/assistant/platform_api_impl.cc +++ b/chromeos/services/assistant/platform_api_impl.cc
@@ -8,9 +8,8 @@ #include <utility> #include <vector> -#include "base/system/sys_info.h" -#include "chromeos/audio/cras_audio_handler.h" #include "chromeos/services/assistant/media_session/assistant_media_session.h" +#include "chromeos/services/assistant/platform/audio_devices.h" #include "chromeos/services/assistant/platform/power_manager_provider_impl.h" #include "chromeos/services/assistant/public/cpp/features.h" #include "chromeos/services/assistant/utils.h" @@ -83,16 +82,15 @@ mojo::PendingRemote<device::mojom::BatteryMonitor> battery_monitor, scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner, scoped_refptr<base::SingleThreadTaskRunner> background_task_runner, - std::string pref_locale) + const std::string& pref_locale) : audio_input_provider_(), audio_output_provider_(media_session, background_task_runner, media::AudioDeviceDescription::kDefaultDeviceId), audio_input_host_(&audio_input_provider_.GetAudioInput(), cras_audio_handler, - power_manager_client), - pref_locale_(pref_locale), - cras_audio_handler_(cras_audio_handler) { + power_manager_client, + pref_locale) { // Only enable native power features if they are supported by the UI. std::unique_ptr<PowerManagerProviderImpl> provider; if (features::IsPowerManagerEnabled()) { @@ -101,14 +99,9 @@ } system_provider_ = std::make_unique<SystemProviderImpl>( std::move(provider), std::move(battery_monitor)); - - cras_audio_handler_->AddAudioObserver(this); - OnAudioNodesChanged(); } -PlatformApiImpl::~PlatformApiImpl() { - cras_audio_handler_->RemoveAudioObserver(this); -} +PlatformApiImpl::~PlatformApiImpl() = default; AudioInputProviderImpl& PlatformApiImpl::GetAudioInputProvider() { return audio_input_provider_; @@ -134,50 +127,6 @@ return *system_provider_; } -void PlatformApiImpl::OnAudioNodesChanged() { - if (!base::SysInfo::IsRunningOnChromeOS()) - return; - - chromeos::AudioDeviceList devices; - cras_audio_handler_->GetAudioDevices(&devices); - - const chromeos::AudioDevice* input_device = nullptr; - const chromeos::AudioDevice* hotword_device = nullptr; - - for (const chromeos::AudioDevice& device : devices) { - if (!device.is_input) - continue; - - switch (device.type) { - case chromeos::AUDIO_TYPE_USB: - case chromeos::AUDIO_TYPE_HEADPHONE: - case chromeos::AUDIO_TYPE_INTERNAL_MIC: - case chromeos::AUDIO_TYPE_FRONT_MIC: - if (!input_device || input_device->priority < device.priority) - input_device = &device; - break; - case chromeos::AUDIO_TYPE_HOTWORD: - if (!hotword_device || hotword_device->priority < device.priority) - hotword_device = &device; - break; - default: - // ignore other devices - break; - } - } - - audio_input_host_.SetDeviceId( - input_device ? base::NumberToString(input_device->id) : std::string()); - - if (hotword_device) { - audio_input_host_.SetHotwordDeviceId( - base::NumberToString(hotword_device->id)); - audio_input_host_.SetDspHotwordLocale(pref_locale_); - } else { - audio_input_host_.SetHotwordDeviceId(std::string()); - } -} - void PlatformApiImpl::SetMicState(bool mic_open) { audio_input_host_.SetMicState(mic_open); }
diff --git a/chromeos/services/assistant/platform_api_impl.h b/chromeos/services/assistant/platform_api_impl.h index ffcaeb1f..2ba1b1f 100644 --- a/chromeos/services/assistant/platform_api_impl.h +++ b/chromeos/services/assistant/platform_api_impl.h
@@ -10,7 +10,6 @@ #include <utility> #include <vector> -#include "chromeos/audio/cras_audio_handler.h" #include "chromeos/services/assistant/platform/audio_input_host.h" #include "chromeos/services/assistant/platform/audio_input_provider_impl.h" #include "chromeos/services/assistant/platform/audio_output_provider_impl.h" @@ -24,6 +23,7 @@ #include "services/device/public/mojom/battery_monitor.mojom.h" namespace chromeos { +class CrasAudioHandler; class PowerManagerClient; namespace assistant { @@ -31,8 +31,7 @@ class AssistantMediaSession; // Platform API required by the voice assistant. -class PlatformApiImpl : public CrosPlatformApi, - CrasAudioHandler::AudioObserver { +class PlatformApiImpl : public CrosPlatformApi { public: PlatformApiImpl( AssistantMediaSession* media_session, @@ -41,7 +40,7 @@ mojo::PendingRemote<device::mojom::BatteryMonitor> battery_monitor, scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner, scoped_refptr<base::SingleThreadTaskRunner> background_task_runner, - std::string pref_locale); + const std::string& pref_locale); ~PlatformApiImpl() override; // assistant_client::PlatformApi overrides @@ -52,9 +51,6 @@ assistant_client::NetworkProvider& GetNetworkProvider() override; assistant_client::SystemProvider& GetSystemProvider() override; - // chromeos::CrasAudioHandler::AudioObserver overrides - void OnAudioNodesChanged() override; - // Called when the mic state associated with the interaction is changed. void SetMicState(bool mic_open) override; @@ -104,9 +100,6 @@ NetworkProviderImpl network_provider_; AudioInputHost audio_input_host_; std::unique_ptr<SystemProviderImpl> system_provider_; - std::string pref_locale_; - - CrasAudioHandler* const cras_audio_handler_; DISALLOW_COPY_AND_ASSIGN(PlatformApiImpl); };
diff --git a/chromeos/services/assistant/public/cpp/assistant_enums.h b/chromeos/services/assistant/public/cpp/assistant_enums.h index 01a3621..d33ba67 100644 --- a/chromeos/services/assistant/public/cpp/assistant_enums.h +++ b/chromeos/services/assistant/public/cpp/assistant_enums.h
@@ -62,8 +62,9 @@ kQuickAnswers = 11, kLauncherChip = 12, kBetterOnboarding = 13, - kBloom = 14, - kMaxValue = kBloom, + // Deprecated, please do not use. + // kBloom = 14, + kMaxValue = kBetterOnboarding, }; // Enumeration of possible Assistant interaction types. @@ -127,8 +128,9 @@ kLauncherSearchBoxIcon = 9, kProactiveSuggestions = 10, kLauncherChip = 11, - kBloom = 12, - kMaxValue = kBloom, + // Deprecated, please do not reuse + // kBloom = 12, + kMaxValue = kLauncherChip, }; // Enumeration of Assistant exit points. These values are persisted to logs.
diff --git a/chromeos/services/assistant/public/shared/constants.cc b/chromeos/services/assistant/public/shared/constants.cc index e0ae021..f8507af 100644 --- a/chromeos/services/assistant/public/shared/constants.cc +++ b/chromeos/services/assistant/public/shared/constants.cc
@@ -14,12 +14,5 @@ const char kSampleServiceIdRequest[] = ""; const char kServiceIdRequestPayload[] = ""; -const char kBloomScope[] = "https://fake/bloom/scope"; -const char kBloomServiceUrl[] = "https://fake.bloom.service.url"; -const char kBloomCreateImagePath[] = "/fake/create/image/path"; -const char kBloomOcrImagePath[] = "/fake/ocr/image/path&image_id="; -const char kBloomSearchProblemPath[] = - "/fake/search/problem/path&metadata_blob="; - } // namespace assistant } // namespace chromeos
diff --git a/chromeos/services/assistant/public/shared/constants.h b/chromeos/services/assistant/public/shared/constants.h index dd6fa126..f5a1072 100644 --- a/chromeos/services/assistant/public/shared/constants.h +++ b/chromeos/services/assistant/public/shared/constants.h
@@ -26,24 +26,6 @@ COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) extern const char kServiceIdRequestPayload[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomScope[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomServiceUrl[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomCreateImagePath[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomOcrImagePath[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomSearchProblemPath[]; - -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomCreateImagePath[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomOcrImagePath[]; -COMPONENT_EXPORT(ASSISTANT_SERVICE_SHARED) -extern const char kBloomSearchProblemPath[]; - } // namespace assistant } // namespace chromeos
diff --git a/chromeos/services/nearby/public/mojom/nearby_connections_types.mojom b/chromeos/services/nearby/public/mojom/nearby_connections_types.mojom index c41326ed..575e544 100644 --- a/chromeos/services/nearby/public/mojom/nearby_connections_types.mojom +++ b/chromeos/services/nearby/public/mojom/nearby_connections_types.mojom
@@ -7,51 +7,53 @@ import "device/bluetooth/public/mojom/uuid.mojom"; import "mojo/public/mojom/base/file.mojom"; -// Generic result status of NearbyConnections API calls. +// Generic result status of NearbyConnections API calls. These values are +// persisted to logs. Entries should not be renumbered and numeric values should +// never be reused. enum Status { // The operation was successful. - kSuccess, + kSuccess = 0, // The operation failed, without any more information. - kError, + kError = 1, // The app called an API method out of order (i.e. another method is expected // to be called first). - kOutOfOrderApiCall, + kOutOfOrderApiCall = 2, // The app already has active operations (advertising, discovering, or // connected to other devices) with another Strategy. Stop these operations on // the current Strategy before trying to advertise or discover with a new // Strategy. - kAlreadyHaveActiveStrategy, + kAlreadyHaveActiveStrategy = 3, // The app is already advertising; call StopAdvertising() before trying to // advertise again. - kAlreadyAdvertising, + kAlreadyAdvertising = 4, // The app is already discovering; call StopDiscovery() before trying to // discover again. - kAlreadyDiscovering, + kAlreadyDiscovering = 5, // An attempt to read from/write to a connected remote endpoint failed. If // this occurs repeatedly, consider invoking DisconnectFromEndpoint(). - kEndpointIOError, + kEndpointIOError = 6, // An attempt to interact with a remote endpoint failed because it's unknown // to us -- it's either an endpoint that was never discovered, or an endpoint // that never connected to us (both of which are indicative of bad input from // the client app). - kEndpointUnknown, + kEndpointUnknown = 7, // The remote endpoint rejected the connection request. - kConnectionRejected, + kConnectionRejected = 8, // The app is already connected to the specified endpoint. Multiple // connections to a remote endpoint cannot be maintained simultaneously. - kAlreadyConnectedToEndpoint, + kAlreadyConnectedToEndpoint = 9, // The remote endpoint is not connected; messages cannot be sent to it. - kNotConnectedToEndpoint, + kNotConnectedToEndpoint = 10, // There was an error trying to use the device's Bluetooth capabilities. - kBluetoothError, + kBluetoothError = 11, // There was an error trying to use the device's Bluetooth Low Energy // capabilities. - kBleError, + kBleError = 12, // There was an error trying to use the device's WiFi capabilities. - kWifiLanError, + kWifiLanError = 13, // An attempt to interact with an in-flight Payload failed because it's // unknown to us. - kPayloadUnknown, + kPayloadUnknown = 14, }; // Information about a connection that is being initiated.
diff --git a/components/autofill_assistant/browser/controller_unittest.cc b/components/autofill_assistant/browser/controller_unittest.cc index 96405022..9269398 100644 --- a/components/autofill_assistant/browser/controller_unittest.cc +++ b/components/autofill_assistant/browser/controller_unittest.cc
@@ -143,7 +143,10 @@ controller_->AddObserver(&mock_observer_); } - void TearDown() override { controller_->RemoveObserver(&mock_observer_); } + void TearDown() override { + controller_->RemoveObserver(&mock_observer_); + RenderViewHostTestHarness::TearDown(); + } protected: static SupportedScriptProto* AddRunnableScript(
diff --git a/components/autofill_assistant/browser/trigger_scripts/trigger_script_coordinator_unittest.cc b/components/autofill_assistant/browser/trigger_scripts/trigger_script_coordinator_unittest.cc index 2dca122..a0c7384 100644 --- a/components/autofill_assistant/browser/trigger_scripts/trigger_script_coordinator_unittest.cc +++ b/components/autofill_assistant/browser/trigger_scripts/trigger_script_coordinator_unittest.cc
@@ -87,7 +87,10 @@ SimulateNavigateToUrl(GURL(kFakeDeepLink)); } - void TearDown() override { coordinator_->RemoveObserver(&mock_observer_); } + void TearDown() override { + coordinator_->RemoveObserver(&mock_observer_); + RenderViewHostTestHarness::TearDown(); + } void SimulateWebContentsVisibilityChanged(content::Visibility visibility) { coordinator_->OnVisibilityChanged(visibility);
diff --git a/components/autofill_assistant/browser/website_login_manager_impl_unittest.cc b/components/autofill_assistant/browser/website_login_manager_impl_unittest.cc index 3e73e11..363674e7 100644 --- a/components/autofill_assistant/browser/website_login_manager_impl_unittest.cc +++ b/components/autofill_assistant/browser/website_login_manager_impl_unittest.cc
@@ -103,6 +103,7 @@ protected: void SetUp() override { + RenderViewHostTestHarness::SetUp(); profile_store_ = new password_manager::MockPasswordStore; ON_CALL(*profile_store_, IsAccountStore()).WillByDefault(Return(false)); ASSERT_TRUE(profile_store_->Init(/*prefs=*/nullptr)); @@ -129,6 +130,7 @@ account_store_->ShutdownOnUIThread(); } profile_store_->ShutdownOnUIThread(); + RenderViewHostTestHarness::TearDown(); } WebsiteLoginManagerImpl* manager() { return manager_.get(); }
diff --git a/components/embedder_support/android/metrics/android_metrics_service_client.cc b/components/embedder_support/android/metrics/android_metrics_service_client.cc index ce00e9f..1cbba062 100644 --- a/components/embedder_support/android/metrics/android_metrics_service_client.cc +++ b/components/embedder_support/android/metrics/android_metrics_service_client.cc
@@ -147,8 +147,8 @@ PrefService* pref_service, bool metrics_reporting_enabled) { // Create an object to monitor files of metrics and include them in reports. - std::unique_ptr<metrics::FileMetricsProvider> file_metrics_provider( - new metrics::FileMetricsProvider(pref_service)); + std::unique_ptr<metrics::FileMetricsProvider> file_metrics_provider = + std::make_unique<metrics::FileMetricsProvider>(pref_service); base::FilePath user_data_dir; base::PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir); @@ -264,34 +264,46 @@ // TODO:(crbug.com/1148351) Make the initialization consistent with Chrome. void AndroidMetricsServiceClient::MaybeStartMetrics() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (!IsConsentDetermined()) + return; + +#if DCHECK_IS_ON() + // This function should be called only once after consent has been determined. + DCHECK(!did_start_metrics_with_consent_); + did_start_metrics_with_consent_ = true; +#endif + // Treat the debugging flag the same as user consent because the user set it, // but keep app_consent_ separate so we never persist data from an opted-out // app. bool user_consent_or_flag = user_consent_ || IsMetricsReportingForceEnabled(); - if (IsConsentDetermined()) { - if (app_consent_ && user_consent_or_flag) { - did_start_metrics_ = true; - // Make GetSampleBucketValue() work properly. - metrics_state_manager_->ForceClientIdCreation(); - is_client_id_forced_ = true; - RegisterMetricsProvidersAndInitState(); - // Register for notifications so we can detect when the user or app are - // interacting with the embedder. We use these as signals to wake up the - // MetricsService. - RegisterForNotifications(); - OnMetricsStart(); + if (app_consent_ && user_consent_or_flag) { + did_start_metrics_ = true; + // Make GetSampleBucketValue() work properly. + metrics_state_manager_->ForceClientIdCreation(); + is_client_id_forced_ = true; + RegisterMetricsProvidersAndInitState(); + // Register for notifications so we can detect when the user or app are + // interacting with the embedder. We use these as signals to wake up the + // MetricsService. + RegisterForNotifications(); + OnMetricsStart(); - if (IsReportingEnabled()) { - // We assume the embedder has no shutdown sequence, so there's no need - // for a matching Stop() call. - metrics_service_->Start(); - } - - CreateUkmService(); - } else { - OnMetricsNotStarted(); - pref_service_->ClearPref(prefs::kMetricsClientID); + if (IsReportingEnabled()) { + // We assume the embedder has no shutdown sequence, so there's no need + // for a matching Stop() call. + metrics_service_->Start(); } + + CreateUkmService(); + } else { + // Even though reporting is not enabled, CreateFileMetricsProvider() is + // called. This ensures on disk state is removed. + metrics_service_->RegisterMetricsProvider(CreateFileMetricsProvider( + pref_service_, /* metrics_reporting_enabled */ false)); + OnMetricsNotStarted(); + pref_service_->ClearPref(prefs::kMetricsClientID); } }
diff --git a/components/embedder_support/android/metrics/android_metrics_service_client.h b/components/embedder_support/android/metrics/android_metrics_service_client.h index c4e2a8a..4a193b3 100644 --- a/components/embedder_support/android/metrics/android_metrics_service_client.h +++ b/components/embedder_support/android/metrics/android_metrics_service_client.h
@@ -263,6 +263,10 @@ base::OnceClosure collect_final_metrics_for_log_closure_; base::RepeatingClosure on_final_metrics_collected_listener_; +#if DCHECK_IS_ON() + bool did_start_metrics_with_consent_ = false; +#endif + // MetricsServiceClient may be created before the UI thread is promoted to // BrowserThread::UI. Use |sequence_checker_| to enforce that the // MetricsServiceClient is used on a single thread.
diff --git a/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc b/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc index 40f1a81..85ee302 100644 --- a/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc +++ b/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc
@@ -403,6 +403,30 @@ } TEST_F(AndroidMetricsServiceClientTest, + TestBrowserMetricsDirClearedIfNoConsent) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeatureWithParameters( + base::kPersistentHistogramsFeature, {{"storage", "MappedFile"}}); + + base::FilePath metrics_dir; + ASSERT_TRUE(base::PathService::Get(base::DIR_ANDROID_APP_DATA, &metrics_dir)); + InstantiatePersistentHistograms(metrics_dir); + base::FilePath upload_dir = metrics_dir.AppendASCII(kBrowserMetricsName); + ASSERT_TRUE(base::PathExists(upload_dir)); + + auto prefs = CreateTestPrefs(); + auto client = std::make_unique<TestClient>(); + + // Setup the client isn't in sample. + client->SetHaveMetricsConsent(/* user_consent= */ false, + /* app_consent= */ false); + client->Initialize(prefs.get()); + task_environment()->RunUntilIdle(); + + EXPECT_FALSE(base::PathExists(upload_dir)); +} + +TEST_F(AndroidMetricsServiceClientTest, TestBrowserMetricsDirExistsIfReportingEnabled) { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeatureWithParameters(
diff --git a/components/full_restore/full_restore_read_handler.cc b/components/full_restore/full_restore_read_handler.cc index 267b3b7..07b49fd70 100644 --- a/components/full_restore/full_restore_read_handler.cc +++ b/components/full_restore/full_restore_read_handler.cc
@@ -37,15 +37,6 @@ std::move(callback))); } -void FullRestoreReadHandler::RemoveApp(const base::FilePath& profile_path, - const std::string& app_id) { - auto it = profile_path_to_restore_data_.find(profile_path); - if (it == profile_path_to_restore_data_.end()) - return; - - it->second->RemoveApp(app_id); -} - void FullRestoreReadHandler::OnGetRestoreData( const base::FilePath& profile_path, Callback callback,
diff --git a/components/full_restore/full_restore_read_handler.h b/components/full_restore/full_restore_read_handler.h index f531d39..6104189b 100644 --- a/components/full_restore/full_restore_read_handler.h +++ b/components/full_restore/full_restore_read_handler.h
@@ -43,10 +43,6 @@ // calls |callback| when the reading operation is done. void ReadFromFile(const base::FilePath& profile_path, Callback callback); - // Removes app launching and app windows for an app with the given |app_id| - // from |profile_path_to_restore_data_| for |profile_path| . - void RemoveApp(const base::FilePath& profile_path, const std::string& app_id); - private: // Invoked when reading the restore data from |profile_path| is finished, and // calls |callback| to notify that the reading operation is done.
diff --git a/components/full_restore/full_restore_save_handler.cc b/components/full_restore/full_restore_save_handler.cc index 0c45667..f6b2ebcc 100644 --- a/components/full_restore/full_restore_save_handler.cc +++ b/components/full_restore/full_restore_save_handler.cc
@@ -142,19 +142,6 @@ weak_factory_.GetWeakPtr(), profile_path)); } -void FullRestoreSaveHandler::RemoveApp(const base::FilePath& profile_path, - const std::string& app_id) { - auto it = profile_path_to_restore_data_.find(profile_path); - if (it == profile_path_to_restore_data_.end()) - return; - - it->second.RemoveApp(app_id); - - pending_save_profile_paths_.insert(profile_path); - - MaybeStartSaveTimer(); -} - void FullRestoreSaveHandler::MaybeStartSaveTimer() { if (!save_timer_.IsRunning() && save_running_.empty()) { save_timer_.Start(FROM_HERE, kSaveDelay,
diff --git a/components/full_restore/full_restore_save_handler.h b/components/full_restore/full_restore_save_handler.h index d1a81bd..4e6cc9ff 100644 --- a/components/full_restore/full_restore_save_handler.h +++ b/components/full_restore/full_restore_save_handler.h
@@ -65,10 +65,6 @@ // data. void Flush(const base::FilePath& profile_path); - // Removes app launching and app windows for an app with the given |app_id| - // from |file_path_to_restore_data_| for |profile_path| . - void RemoveApp(const base::FilePath& profile_path, const std::string& app_id); - base::OneShotTimer* GetTimerForTesting() { return &save_timer_; } private:
diff --git a/components/history/metrics/domain_diversity_reporter.cc b/components/history/metrics/domain_diversity_reporter.cc index ef6c85f..244c69d3 100644 --- a/components/history/metrics/domain_diversity_reporter.cc +++ b/components/history/metrics/domain_diversity_reporter.cc
@@ -31,6 +31,8 @@ clock_(clock), history_service_observer_(this) { DCHECK_NE(prefs_, nullptr); + DCHECK_NE(history_service_, nullptr); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::SequencedTaskRunnerHandle::Get()->PostTask(
diff --git a/components/mirroring/README.md b/components/mirroring/README.md new file mode 100644 index 0000000..d8c0060 --- /dev/null +++ b/components/mirroring/README.md
@@ -0,0 +1,26 @@ +# //components/mirroring + +Service implementation and browser integration for Cast Mirroring. + +The Mirroring Service is run in its own sandboxed process. It uses mojo +message pipes between its process and the privileged browser process to: + + * acquire inputs, such as screen capture video or tab audio capture. + * communicate with remote Cast devices using Cast Channel messaging. See `../cast_channel/`. + * open UDP network sockets for Cast Streaming packets. + * switch between screen mirroring and content remoting modes. + +The Service contains all session-management logic, and also interfaces with +`../../media/cast/` to encode and packetize media in realtime. + +Specification: *TODO(jophba): Link to Cast Spec markdown.* + +# Directory Breakdown + +* browser/ - Browser-side implementation. Also, more can be found in + `../../chrome/browser/media/cast_mirroring_service_host.h` and + `../../chrome/browser/media/router/providers/cast/`. + +* mojom/ - Mojo interfaces. + +* service/ - Mirroring Service implementation, as described above.
diff --git a/components/safe_browsing/core/realtime/url_lookup_service_base.cc b/components/safe_browsing/core/realtime/url_lookup_service_base.cc index e6ce006c..bf849653 100644 --- a/components/safe_browsing/core/realtime/url_lookup_service_base.cc +++ b/components/safe_browsing/core/realtime/url_lookup_service_base.cc
@@ -73,6 +73,13 @@ base::UmaHistogramCounts100(metric + suffix, value); } +void RecordCount1MWithAndWithoutSuffix(const std::string& metric, + const std::string& suffix, + int value) { + base::UmaHistogramCounts1M(metric, value); + base::UmaHistogramCounts1M(metric + suffix, value); +} + void RecordRequestPopulationWithAndWithoutSuffix( const std::string& metric, const std::string& suffix, @@ -357,6 +364,8 @@ network::SimpleURLLoader::Create(std::move(resource_request), GetTrafficAnnotationTag()); network::SimpleURLLoader* loader = owned_loader.get(); + RecordCount1MWithAndWithoutSuffix("SafeBrowsing.RT.Request.Size", + GetMetricSuffix(), req_data.size()); owned_loader->AttachStringForUpload(req_data, "application/octet-stream"); owned_loader->SetTimeoutDuration( base::TimeDelta::FromSeconds(kURLLookupTimeoutDurationInSeconds));
diff --git a/components/services/storage/dom_storage/local_storage_impl.cc b/components/services/storage/dom_storage/local_storage_impl.cc index eb2a106..e3ce9cb 100644 --- a/components/services/storage/dom_storage/local_storage_impl.cc +++ b/components/services/storage/dom_storage/local_storage_impl.cc
@@ -1102,10 +1102,10 @@ void LocalStorageImpl::OnShutdownComplete() { DCHECK(shutdown_complete_callback_); // Flush any final tasks on the DB task runner before invoking the callback. - leveldb_task_runner_->PostTaskAndReply( - FROM_HERE, base::DoNothing(), std::move(shutdown_complete_callback_)); PurgeAllStorageAreas(); database_.reset(); + leveldb_task_runner_->PostTaskAndReply( + FROM_HERE, base::DoNothing(), std::move(shutdown_complete_callback_)); } void LocalStorageImpl::GetStatistics(size_t* total_cache_size,
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc index 1703a41..feea9670 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc
@@ -240,16 +240,19 @@ } void EnablePCScanForMallocPartitionsIfNeeded() { -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && ALLOW_PCSCAN CHECK(base::FeatureList::GetInstance()); - base::allocator::EnablePCScanIfNeeded(); + if (base::FeatureList::IsEnabled(base::features::kPartitionAllocPCScan)) { + base::allocator::EnablePCScan(); + } #endif } void EnablePCScanForMallocPartitionsInBrowserProcessIfNeeded() { -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && ALLOW_PCSCAN CHECK(base::FeatureList::GetInstance()); - if (base::features::IsPartitionAllocPCScanBrowserOnlyEnabled()) { + if (base::FeatureList::IsEnabled( + base::features::kPartitionAllocPCScanBrowserOnly)) { base::allocator::EnablePCScan(); } #endif
diff --git a/content/browser/conversions/conversions_browsertest.cc b/content/browser/conversions/conversions_browsertest.cc index 6df8d3c..bb519b7e 100644 --- a/content/browser/conversions/conversions_browsertest.cc +++ b/content/browser/conversions/conversions_browsertest.cc
@@ -161,6 +161,40 @@ } IN_PROC_BROWSER_TEST_F(ConversionsBrowserTest, + WindowOpenImpressionConversion_ReportSent) { + // Expected reports must be registered before the server starts. + ExpectedReportWaiter expected_report( + GURL( + "https://a.test/.well-known/" + "register-conversion?impression-data=1&conversion-data=7&credit=100"), + https_server()); + ASSERT_TRUE(https_server()->Start()); + + GURL impression_url = https_server()->GetURL( + "a.test", "/conversions/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), impression_url)); + + // Create an anchor tag with impression attributes and click the link. By + // default the target is set to "_top". + GURL conversion_url = https_server()->GetURL( + "b.test", "/conversions/page_with_conversion_redirect.html"); + TestNavigationObserver observer(web_contents()); + EXPECT_TRUE( + ExecJs(web_contents(), + JsReplace(R"(window.open($1, '_top', '', + {impressionData: '1', conversionDestination: $2});)", + conversion_url, url::Origin::Create(conversion_url)))); + observer.Wait(); + + // Register a conversion with the original page as the reporting origin. + EXPECT_TRUE( + ExecJs(web_contents(), JsReplace("registerConversionForOrigin(7, $1)", + url::Origin::Create(impression_url)))); + + EXPECT_EQ(expected_report.expected_url, expected_report.WaitForRequestUrl()); +} + +IN_PROC_BROWSER_TEST_F(ConversionsBrowserTest, ImpressionFromCrossOriginSubframe_ReportSent) { ExpectedReportWaiter expected_report( GURL(
diff --git a/content/browser/conversions/impression_declaration_browsertest.cc b/content/browser/conversions/impression_declaration_browsertest.cc index 512f757..ca25e8f 100644 --- a/content/browser/conversions/impression_declaration_browsertest.cc +++ b/content/browser/conversions/impression_declaration_browsertest.cc
@@ -560,4 +560,47 @@ EXPECT_EQ(1UL, second_impression_observer.Wait().impression_data); } +IN_PROC_BROWSER_TEST_F(ImpressionDeclarationBrowserTest, + WindowOpenImpression_ImpressionReceived) { + ImpressionObserver impression_observer(web_contents()); + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), page_url)); + + // Navigate the page using window.open and set an impression. + EXPECT_TRUE(ExecJs(web_contents(), R"( + window.open("https://a.com", "_top", "", + {impressionData: "1", conversionDestination: "https://a.com", + reportingOrigin: "https://report.com", impressionExpiry: 1000});)")); + + // Wait for the impression to be seen by the observer. + Impression last_impression = impression_observer.Wait(); + + // Verify the attributes of the impression are set as expected. + EXPECT_EQ(1UL, last_impression.impression_data); + EXPECT_EQ(url::Origin::Create(GURL("https://a.com")), + last_impression.conversion_destination); + EXPECT_EQ(url::Origin::Create(GURL("https://report.com")), + last_impression.reporting_origin); + EXPECT_EQ(base::TimeDelta::FromMilliseconds(1000), *last_impression.expiry); +} + +IN_PROC_BROWSER_TEST_F(ImpressionDeclarationBrowserTest, + WindowOpenNoUserGesture_NoImpression) { + ImpressionObserver impression_observer(web_contents()); + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), page_url)); + + // Navigate the page using window.open and set an impression, but do not give + // a user gesture. + EXPECT_TRUE(ExecJs(web_contents(), R"( + window.open("https://a.com", "_top", "", + {impressionData: "1", conversionDestination: "https://a.com", + reportingOrigin: "https://report.com", impressionExpiry: 1000});)", + EXECUTE_SCRIPT_NO_USER_GESTURE)); + + EXPECT_TRUE(impression_observer.WaitForNavigationWithNoImpression()); +} + } // namespace content
diff --git a/content/browser/renderer_host/cookie_utils.cc b/content/browser/renderer_host/cookie_utils.cc index 3c1eecc..702444e 100644 --- a/content/browser/renderer_host/cookie_utils.cc +++ b/content/browser/renderer_host/cookie_utils.cc
@@ -67,7 +67,7 @@ } } -void EmitSameSiteCookiesDeprecationWarning( +void EmitCookieWarningsAndMetrics( RenderFrameHostImpl* rfh, const network::mojom::CookieAccessDetailsPtr& cookie_details) { RenderFrameHostImpl* root_frame_host = rfh->GetMainFrame(); @@ -79,40 +79,61 @@ bool samesite_none_insecure_cookies = false; bool breaking_context_downgrade = false; - for (const net::CookieWithAccessResult& excluded_cookie : + bool same_party = false; + bool same_party_exclusion_overruled_samesite = false; + bool same_party_inclusion_overruled_samesite = false; + + for (const net::CookieWithAccessResult& cookie : cookie_details->cookie_list) { - if (excluded_cookie.access_result.status.ShouldWarn()) { + if (cookie.access_result.status.ShouldWarn()) { + const net::CookieInclusionStatus& status = cookie.access_result.status; samesite_treated_as_lax_cookies = samesite_treated_as_lax_cookies || - excluded_cookie.access_result.status.HasWarningReason( + status.HasWarningReason( net::CookieInclusionStatus:: WARN_SAMESITE_UNSPECIFIED_CROSS_SITE_CONTEXT) || - excluded_cookie.access_result.status.HasWarningReason( + status.HasWarningReason( net::CookieInclusionStatus:: WARN_SAMESITE_UNSPECIFIED_LAX_ALLOW_UNSAFE); samesite_none_insecure_cookies = samesite_none_insecure_cookies || - excluded_cookie.access_result.status.HasWarningReason( + status.HasWarningReason( net::CookieInclusionStatus::WARN_SAMESITE_NONE_INSECURE); devtools_instrumentation::ReportSameSiteCookieIssue( - root_frame_host, excluded_cookie, cookie_details->url, + root_frame_host, cookie, cookie_details->url, cookie_details->site_for_cookies, cookie_details->type == CookieAccessDetails::Type::kRead ? blink::mojom::SameSiteCookieOperation::kReadCookie : blink::mojom::SameSiteCookieOperation::kSetCookie, cookie_details->devtools_request_id); + + same_party = same_party || + status.HasWarningReason( + net::CookieInclusionStatus::WARN_TREATED_AS_SAMEPARTY); + + same_party_exclusion_overruled_samesite = + same_party_exclusion_overruled_samesite || + status.HasWarningReason( + net::CookieInclusionStatus:: + WARN_SAMEPARTY_EXCLUSION_OVERRULED_SAMESITE); + + same_party_inclusion_overruled_samesite = + same_party_inclusion_overruled_samesite || + status.HasWarningReason( + net::CookieInclusionStatus:: + WARN_SAMEPARTY_INCLUSION_OVERRULED_SAMESITE); } breaking_context_downgrade = breaking_context_downgrade || - excluded_cookie.access_result.status.HasDowngradeWarning(); + cookie.access_result.status.HasDowngradeWarning(); - if (excluded_cookie.access_result.status.HasDowngradeWarning()) { + if (cookie.access_result.status.HasDowngradeWarning()) { // Unlike with UMA, do not record cookies that have no downgrade warning. RecordContextDowngradeUKM(rfh, cookie_details->type, - excluded_cookie.access_result.status, + cookie.access_result.status, cookie_details->url); } } @@ -131,6 +152,23 @@ GetContentClient()->browser()->LogWebFeatureForCurrentPage( rfh, blink::mojom::WebFeature::kSchemefulSameSiteContextDowngrade); } + + if (same_party) { + GetContentClient()->browser()->LogWebFeatureForCurrentPage( + rfh, blink::mojom::WebFeature::kSamePartyCookieAttribute); + } + + if (same_party_exclusion_overruled_samesite) { + GetContentClient()->browser()->LogWebFeatureForCurrentPage( + rfh, + blink::mojom::WebFeature::kSamePartyCookieExclusionOverruledSameSite); + } + + if (same_party_inclusion_overruled_samesite) { + GetContentClient()->browser()->LogWebFeatureForCurrentPage( + rfh, + blink::mojom::WebFeature::kSamePartyCookieInclusionOverruledSameSite); + } } } // namespace content
diff --git a/content/browser/renderer_host/cookie_utils.h b/content/browser/renderer_host/cookie_utils.h index 560cce42..cf77ece 100644 --- a/content/browser/renderer_host/cookie_utils.h +++ b/content/browser/renderer_host/cookie_utils.h
@@ -22,10 +22,10 @@ CookieAccessDetails* allowed, CookieAccessDetails* blocked); -// Logs SameSite cookie warnings to DevTools Issues Panel and logs event to -// UseCounters and UKM. Does not log to the JS console. +// Logs cookie warnings to DevTools Issues Panel and logs events to UseCounters +// and UKM. Does not log to the JS console. // TODO(crbug.com/977040): Remove when no longer needed. -void EmitSameSiteCookiesDeprecationWarning( +void EmitCookieWarningsAndMetrics( RenderFrameHostImpl* rfh, const network::mojom::CookieAccessDetailsPtr& cookie_details);
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index 8b9c734..6c29eb1 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc
@@ -5230,8 +5230,8 @@ // TODO(721329): We should not send information to the current frame about // (potentially unrelated) ongoing navigation, but at the moment we don't // have another way to add messages to DevTools console. - EmitSameSiteCookiesDeprecationWarning(frame_tree_node()->current_frame_host(), - details); + EmitCookieWarningsAndMetrics(frame_tree_node()->current_frame_host(), + details); CookieAccessDetails allowed; CookieAccessDetails blocked;
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index ae8f1ea4..931162f 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -10307,7 +10307,7 @@ void RenderFrameHostImpl::OnCookiesAccessed( network::mojom::CookieAccessDetailsPtr details) { - EmitSameSiteCookiesDeprecationWarning(this, details); + EmitCookieWarningsAndMetrics(this, details); CookieAccessDetails allowed; CookieAccessDetails blocked;
diff --git a/content/public/test/content_mock_cert_verifier.cc b/content/public/test/content_mock_cert_verifier.cc index 1aaf9087..6ce3e3a 100644 --- a/content/public/test/content_mock_cert_verifier.cc +++ b/content/public/test/content_mock_cert_verifier.cc
@@ -5,6 +5,7 @@ #include "content/public/test/content_mock_cert_verifier.h" #include "base/command_line.h" +#include "base/feature_list.h" #include "content/public/browser/network_service_instance.h" #include "content/public/common/content_switches.h" #include "content/public/common/network_service_util.h" @@ -26,12 +27,18 @@ int default_result) { verifier_->set_default_result(default_result); - // Set the default result as a flag in case the FeatureList has not been - // initialized yet and we don't know if network service will run out of - // process. - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - switches::kMockCertVerifierDefaultResultForTesting, - base::NumberToString(default_result)); + // If set_default_result is called before the FeatureList is available, add + // the command line flag since the network service may be running out of + // process. We don't want to set the command line flag otherwise since it can + // cause TSan errors. + if (base::FeatureList::GetInstance() == nullptr) { + // Set the default result as a flag in case the FeatureList has not been + // initialized yet and we don't know if network service will run out of + // process. + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kMockCertVerifierDefaultResultForTesting, + base::NumberToString(default_result)); + } if (IsInProcessNetworkService()) return;
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc index 6a4624d..c960d924 100644 --- a/content/public/test/test_renderer_host.cc +++ b/content/public/test/test_renderer_host.cc
@@ -169,6 +169,7 @@ // RenderViewHostTestHarness -------------------------------------------------- RenderViewHostTestHarness::~RenderViewHostTestHarness() { + DCHECK(!task_environment_) << "TearDown() was not called."; } NavigationController& RenderViewHostTestHarness::controller() {
diff --git a/content/test/data/dynamic1.html b/content/test/data/dynamic1.html index 07ff3365..52b7b8f 100644 --- a/content/test/data/dynamic1.html +++ b/content/test/data/dynamic1.html
@@ -4,7 +4,7 @@ <script type="text/javascript"> function OpenPopup() { // Create a new popup window - var oWnd = window.open('','MyPopupName','width=350,height=300',false); + var oWnd = window.open('','MyPopupName','width=350,height=300'); // Dynamically generate the HTML content for popup window var sHtml =
diff --git a/content/test/data/dynamic2.html b/content/test/data/dynamic2.html index 297c534..a2d069c0f 100644 --- a/content/test/data/dynamic2.html +++ b/content/test/data/dynamic2.html
@@ -4,7 +4,7 @@ <script type="text/javascript"> function OpenPopup() { // Create a new popup window - var oWnd = window.open('','MyPopupName','width=350,height=300',false); + var oWnd = window.open('','MyPopupName','width=350,height=300'); // Dynamically generate the HTML content for popup window var sHtml =
diff --git a/docs/testing/regression-test-selection.md b/docs/testing/regression_test_selection.md similarity index 75% rename from docs/testing/regression-test-selection.md rename to docs/testing/regression_test_selection.md index 4f1417b..1ceb7e0 100644 --- a/docs/testing/regression-test-selection.md +++ b/docs/testing/regression_test_selection.md
@@ -25,11 +25,16 @@ [source_set](/build/config/BUILDCONFIG.gn) and [test](/testing/test.gni) GN targets. -## Known failure mode +## Known failure modes -Consider a test file A that contains unit tests, as well as some variables +There are not known to be many instances of these failure modes in the codebase. +Those that are known are never excluded by our model. + +- **Shared state in test files**: Consider a test file A that contains unit tests, as well as some variables used in another file B. When our RTS strategy excludes A, but not B, a compilation error will occur. +- **main() defined in test files**: A test file contains tests and the `main()` function for the entire suite. +When it is excluded, the whole suite fails to compile. ## Design Docs
diff --git a/extensions/browser/api/BUILD.gn b/extensions/browser/api/BUILD.gn index 9378a280..21b0b3ae 100644 --- a/extensions/browser/api/BUILD.gn +++ b/extensions/browser/api/BUILD.gn
@@ -136,7 +136,6 @@ # TODO(crbug/1158984): as above, remove these deps. public_deps += [ - "//extensions/browser/api/cec_private", "//extensions/browser/api/diagnostics", "//extensions/browser/api/vpn_provider", "//extensions/browser/api/webcam_private", @@ -209,6 +208,7 @@ if (is_chromeos_ash) { public_deps += [ + "//extensions/browser/api/cec_private", "//extensions/browser/api/clipboard", "//extensions/browser/api/virtual_keyboard", ]
diff --git a/extensions/browser/api/cec_private/BUILD.gn b/extensions/browser/api/cec_private/BUILD.gn index 7b549fb..ff36c3e 100644 --- a/extensions/browser/api/cec_private/BUILD.gn +++ b/extensions/browser/api/cec_private/BUILD.gn
@@ -13,7 +13,11 @@ "cec_private_api.h", ] - deps = [ "//extensions/common/api" ] + deps = [ + "//chromeos/dbus", + "//extensions/common", + "//extensions/common/api", + ] public_deps = [ "//extensions/browser:browser_sources" ] }
diff --git a/extensions/browser/extension_service_workers.md b/extensions/browser/extension_service_workers.md new file mode 100644 index 0000000..f919a19 --- /dev/null +++ b/extensions/browser/extension_service_workers.md
@@ -0,0 +1,111 @@ +# Extension layer/service worker interactions +An extension background is the context that an extension runs on. It allows +extensions to react to events or messages with specified instructions. Up until +Manifest V2, there were two types of extension background pages, persistent +background pages and non-persistent background pages. As part of Manifest V3, we +are migrating extensions from the persistent/non-persistent background pages to +service workers. Service worker is a web platform feature that forms the basis +of app-like capabilities such as offline support, push notifications, and +background sync. A service worker is an event-driven JavaScript program that +runs in a worker thread. For a more detailed +explanation, see the [Service Workers documentation](https://chromium.googlesource.com/chromium/src/+/HEAD/content/browser/service_worker/README.md). + +This document describes the assumptions the //extensions layer makes when +relying on the service worker layer for registering/unregistering/startinga +service worker or ensuring the service worker’s liveness. + +## Registration +When adding/loading an extension, `ExtensionRegistrar::ActivateExtension` is +called which results in calling `ServiceWorkerTaskQueue::ActivateExtension` +which calls `ServiceWorkerContext::RegisterServiceWorker`. During registration, +[`script_url`](https://source.chromium.org/chromium/chromium/src/+/77dcc35a2a0b98d3913148149496b8dd0d3464cc:content/public/browser/service_worker_context.h;l=125) is set to the URL corresponding to the relative path from +manifest.json's "background.service_worker" and scope is set to the extension +root, i.e., chrome-extension://<extension_id>/. + +When registering the service worker, the //extensions layer relies on the +content layer’s guarantee that the registration is completed. +`OnRegistrationStored` is the first observer function that can guarantee +`StartWorkerForScope` can find the registration. After +`ServiceWorkerContextObserver::OnRegistrationStored`, +`ServiceWorkerContext::StartWorkerForScope` should be able to find the +registration. + +## Unregistration +When an extension is removed/disabled/terminated, +`ExtensionRegistrar::DeactivateExtension` is called which will call +`ServiceWorkerTaskQueue::DeactivateExtension`. This will result in unregistering +the service worker, by calling `ServiceWorkerContext::UnregisterServiceWorker`. + +## Registration/Unregistration failure +`DidRegisterServiceWorker` might fail, due to a few reasons: bad disk state, +invalid service worker script. The recovery steps would depend on the use case. + +`DidUnregisterServiceWorker` failure is rare because it does not involve any +user-provided JS code. + +When `DidRegisterServiceWorker/DidUnregisterServiceWorker` fails due to a disk +error, the SW layer will try to wipe the whole SW database as the current +implementation considers it a critical error. + +## Starting the service worker +A service worker is started when a pending task (e.g. an event dispatch) is run. +A pending task is run only when all of the following conditions are met: +- Service worker registration has completed. +- Call to `ServiceWorkerContext::StartWorkerForScope` has returned. +- Worker thread (in the renderer) has seen +`DidStartServiceWorkerContextOnWorkerThread`. + +ServiceWorkerTaskQueue starts a service worker via `StartWorkerForScope`. +We note that, in the current code, `StartWorkerForScope` should be called every +time before asking the worker to do something instead of relying on +`ServiceWorkerContextObserver::OnVersionStoppedRunning`. +The reason is that `OnVersionStoppedRunning` is called after the worker thread +is actually terminated. As a result, we can not rely on `OnVersionStoppedRunning` +to determine worker liveness. There are more fine-grained running status in the +content layer: RUNNING, STOPPING and STOPPED. The listener is called when the +worker’s state becomes STOPPED. When an event is dispatched to the worker, it +should not be done when the worker is in STOPPPING state. + +The flow of dispatching an event to a service worker is + +1- Calling `StartWorkerForScope` regardless of its running status, + +2- Dispatching an event to a service worker inside of the callback triggered +from `StartWorkerForScope` synchronously. + +In this way, we do not have to track whether the worker is running or not. + +There are several possible reasons for `StartWorkerForScope` failure, such as +process allocation failure, timeout of the script evaluation, and disk +corruption. + + +## Notifications +When starting a service worker, the //extensions layer wait for readiness +notification from both the browser process and the renderer process. In the +current code, after receiving both notifications and before +`OnVersionStoppedRunning`, the //extensions layer assume that the SW is alive +and can dispatch events to an extension service worker. As explained above, we +should call `StartWorkerForScope` every time before asking the worker to do +something instead of relying on `OnVersionStoppedRunning`. We plan to fix this +in our code. Bug [1162193](https://bugs.chromium.org/p/chromium/issues/detail?id=1162193) tracks this fix. + +## Service worker’s liveness +The //extensions layer rely on the service worker layer to ensure the service +worker’s liveness. We use EventAck IPC to ensure +that the service worker is alive while an event is dispatched. This is performed +in two steps: + +1- An event is dispatched from the browser process to the renderer. + +2- Renderer responds with EventAck to the browser process. + +We ensure that between step 1 and step 2, we do not consider the service worker +as "inactive". We achieve this with workers, i.e., we call +`ServiceWorkerContext::StartingExternalRequest` on step 1, and then we call +`ServiceWorkerContext::FinishedExternalRequest` after step 2. + +It is guaranteed that the worker will not be stopped between step 1 and step 2, +as long as we use `ServiceWorkerContext::StartingExternalRequest` and +`ServiceWorkerContext::FinishedExternalRequest`. The external request is a +mechanism to keep the worker alive.
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json index 37c61d0..94d05ec 100644 --- a/gpu/config/gpu_driver_bug_list.json +++ b/gpu/config/gpu_driver_bug_list.json
@@ -3675,6 +3675,18 @@ "features": [ "disable_accelerated_vp9_decode" ] + }, + { + "id": 364, + "cr_bugs": [1161215, 1160217], + "description": "Software overlays fail to work reliably on AMD devices", + "os": { + "type": "win" + }, + "vendor_id": "0x1002", + "features": [ + "disable_direct_composition_sw_video_overlays" + ] } ] }
diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt index a88885a..551650c2 100644 --- a/gpu/config/gpu_workaround_list.txt +++ b/gpu/config/gpu_workaround_list.txt
@@ -27,6 +27,7 @@ disable_delayed_copy_nv12 disable_depth_texture disable_direct_composition +disable_direct_composition_sw_video_overlays disable_direct_composition_video_overlays disable_discard_framebuffer disable_dual_source_blending_support
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc index 78580cd..7db47ff 100644 --- a/gpu/ipc/service/gpu_init.cc +++ b/gpu/ipc/service/gpu_init.cc
@@ -608,6 +608,10 @@ #if defined(OS_WIN) if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_DECODE_SWAP_CHAIN)) gl::DirectCompositionSurfaceWin::DisableDecodeSwapChain(); + if (gpu_feature_info_.IsWorkaroundEnabled( + DISABLE_DIRECT_COMPOSITION_SW_VIDEO_OVERLAYS)) { + gl::DirectCompositionSurfaceWin::DisableSoftwareOverlays(); + } #endif return true;
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg index fba85473..fd8f7c2 100644 --- a/infra/config/generated/commit-queue.cfg +++ b/infra/config/generated/commit-queue.cfg
@@ -887,6 +887,10 @@ includable_only: true } builders { + name: "chromium/try/ios-angle-try-intel" + includable_only: true + } + builders { name: "chromium/try/ios-device" includable_only: true }
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index 5fe4dd11..1218a18 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -42,6 +42,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -93,6 +97,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -144,6 +152,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -195,6 +207,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -246,6 +262,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -297,6 +317,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -348,6 +372,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -399,6 +427,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -450,6 +482,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -501,6 +537,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -552,6 +592,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -603,6 +647,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -654,6 +702,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -705,6 +757,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -756,6 +812,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -807,6 +867,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -858,6 +922,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -909,6 +977,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -960,6 +1032,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1011,6 +1087,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1062,6 +1142,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1113,6 +1197,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1164,6 +1252,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1215,6 +1307,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1266,6 +1362,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1317,6 +1417,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1368,6 +1472,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1419,6 +1527,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1470,6 +1582,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1521,6 +1637,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1572,6 +1692,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1623,6 +1747,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1674,6 +1802,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1725,6 +1857,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1776,6 +1912,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1827,6 +1967,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1878,6 +2022,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1929,6 +2077,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -1980,6 +2132,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2031,6 +2187,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2082,6 +2242,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2133,6 +2297,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2184,6 +2352,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2235,6 +2407,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2286,6 +2462,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2337,6 +2517,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2388,6 +2572,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2439,6 +2627,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2490,6 +2682,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2541,6 +2737,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2590,6 +2790,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2639,6 +2843,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2690,6 +2898,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2741,6 +2953,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2792,6 +3008,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2843,6 +3063,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2894,6 +3118,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2945,6 +3173,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -2996,6 +3228,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3047,6 +3283,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3098,6 +3338,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3149,6 +3393,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3200,6 +3448,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3251,6 +3503,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3302,6 +3558,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3353,6 +3613,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3404,6 +3668,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3455,6 +3723,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3506,6 +3778,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3557,6 +3833,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3608,6 +3888,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3659,6 +3943,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3710,6 +3998,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3761,6 +4053,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3812,6 +4108,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3863,6 +4163,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3914,6 +4218,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -3965,6 +4273,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4016,6 +4328,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4067,6 +4383,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4116,6 +4436,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4165,6 +4489,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4214,6 +4542,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4265,6 +4597,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4316,6 +4652,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4367,6 +4707,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4418,6 +4762,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4469,6 +4817,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4520,6 +4872,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4571,6 +4927,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4622,6 +4982,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4673,6 +5037,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4724,6 +5092,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4775,6 +5147,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4826,6 +5202,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4875,6 +5255,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4924,6 +5308,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -4975,6 +5363,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5026,6 +5418,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5077,6 +5473,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5128,6 +5528,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5179,6 +5583,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5230,6 +5638,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5281,6 +5693,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5331,6 +5747,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5382,6 +5802,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5433,6 +5857,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5484,6 +5912,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5535,6 +5967,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5586,6 +6022,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5637,6 +6077,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5687,6 +6131,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5737,6 +6185,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5788,6 +6240,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5839,6 +6295,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5890,6 +6350,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5941,6 +6405,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -5992,6 +6460,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6043,6 +6515,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6094,6 +6570,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6145,6 +6625,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6196,6 +6680,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6247,6 +6735,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6298,6 +6790,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6349,6 +6845,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6400,6 +6900,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6451,6 +6955,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6502,6 +7010,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6553,6 +7065,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6604,6 +7120,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6655,6 +7175,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6706,6 +7230,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6757,6 +7285,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6808,6 +7340,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6859,6 +7395,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6910,6 +7450,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -6961,6 +7505,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7012,6 +7560,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7063,6 +7615,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7114,6 +7670,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7165,6 +7725,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7216,6 +7780,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7267,6 +7835,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7318,6 +7890,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7369,6 +7945,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7420,6 +8000,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7471,6 +8055,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7522,6 +8110,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7573,6 +8165,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7624,6 +8220,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7675,6 +8275,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7726,6 +8330,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7777,6 +8385,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7828,6 +8440,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -7880,7 +8496,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -7935,7 +8551,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -7990,7 +8606,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -8044,6 +8660,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8095,6 +8715,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8146,6 +8770,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8197,6 +8825,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8247,6 +8879,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8297,6 +8933,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8346,6 +8986,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8396,6 +9040,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8445,6 +9093,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8494,6 +9146,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8543,7 +9199,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -8597,6 +9253,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8648,6 +9308,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8699,6 +9363,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8750,6 +9418,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8801,6 +9473,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8850,6 +9526,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8901,6 +9581,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -8952,6 +9636,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9003,6 +9691,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9054,6 +9746,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9105,6 +9801,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9156,6 +9856,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9205,6 +9909,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9256,6 +9964,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9307,6 +10019,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9358,6 +10074,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9409,6 +10129,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9460,6 +10184,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9511,6 +10239,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9561,7 +10293,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -9614,7 +10346,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -9668,6 +10400,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9719,6 +10455,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9770,6 +10510,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9821,6 +10565,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9872,6 +10620,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9923,6 +10675,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -9974,6 +10730,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10025,6 +10785,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10076,6 +10840,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10127,6 +10895,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10178,6 +10950,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10229,6 +11005,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10279,6 +11059,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10330,6 +11114,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10381,6 +11169,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10432,6 +11224,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10484,7 +11280,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -10538,6 +11334,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10589,6 +11389,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10640,6 +11444,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10691,6 +11499,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10742,6 +11554,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10793,6 +11609,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10844,6 +11664,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10895,6 +11719,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10946,6 +11774,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -10997,6 +11829,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11048,6 +11884,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11099,6 +11939,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11149,6 +11993,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11200,6 +12048,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11251,6 +12103,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11302,6 +12158,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11353,6 +12213,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11404,6 +12268,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11455,6 +12323,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11506,6 +12378,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11557,6 +12433,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11608,6 +12488,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11659,6 +12543,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11710,6 +12598,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11761,6 +12653,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11812,6 +12708,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11863,6 +12763,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11914,6 +12818,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -11965,6 +12873,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12016,6 +12928,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12070,6 +12986,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12124,6 +13044,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12175,6 +13099,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12226,6 +13154,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12277,6 +13209,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12329,7 +13265,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -12383,6 +13319,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12434,6 +13374,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12485,6 +13429,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12535,6 +13483,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12586,7 +13538,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -12639,6 +13591,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12689,6 +13645,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12739,6 +13699,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12789,6 +13753,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12839,6 +13807,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12889,6 +13861,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12940,6 +13916,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -12991,6 +13971,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13042,6 +14026,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13093,6 +14081,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13144,6 +14136,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13195,6 +14191,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13246,6 +14246,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13297,6 +14301,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13348,6 +14356,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13399,6 +14411,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13450,6 +14466,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13501,6 +14521,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13552,6 +14576,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13603,6 +14631,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13654,6 +14686,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13704,6 +14740,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13754,6 +14794,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13805,7 +14849,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -13859,7 +14903,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -13913,6 +14957,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -13964,6 +15012,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14014,6 +15066,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14065,6 +15121,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14116,6 +15176,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14167,6 +15231,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14218,6 +15286,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14269,6 +15341,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14320,6 +15396,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14370,6 +15450,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14420,6 +15504,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14470,6 +15558,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14521,6 +15613,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14572,6 +15668,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14623,6 +15723,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14674,6 +15778,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14725,6 +15833,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14776,6 +15888,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14827,6 +15943,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14878,6 +15998,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14929,6 +16053,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -14980,6 +16108,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15031,6 +16163,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15082,6 +16218,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15133,6 +16273,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15184,6 +16328,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15235,6 +16383,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15286,6 +16438,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15337,6 +16493,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15388,6 +16548,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15439,6 +16603,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15490,6 +16658,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15542,7 +16714,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -15597,7 +16769,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -15651,6 +16823,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15702,6 +16878,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15753,6 +16933,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15804,6 +16988,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15855,6 +17043,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15906,6 +17098,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -15957,6 +17153,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16008,6 +17208,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16056,6 +17260,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16107,6 +17315,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16158,6 +17370,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16209,6 +17425,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16260,6 +17480,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16311,6 +17535,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16362,6 +17590,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16413,6 +17645,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16464,6 +17700,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16515,6 +17755,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16565,6 +17809,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16617,7 +17865,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -16672,7 +17920,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -16727,7 +17975,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -16782,7 +18030,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -16836,6 +18084,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16887,6 +18139,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16938,6 +18194,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -16989,6 +18249,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17040,6 +18304,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17091,6 +18359,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17142,6 +18414,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17193,6 +18469,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17244,6 +18524,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17295,6 +18579,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17346,6 +18634,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17397,6 +18689,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17448,6 +18744,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17499,6 +18799,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17550,6 +18854,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17602,7 +18910,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -17656,6 +18964,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17707,6 +19019,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17758,6 +19074,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17809,6 +19129,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17860,6 +19184,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17911,6 +19239,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -17963,7 +19295,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18018,7 +19350,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18073,7 +19405,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18128,7 +19460,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18183,7 +19515,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18238,7 +19570,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18292,6 +19624,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18343,6 +19679,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18394,6 +19734,122 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.junit_tests" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" + } + } + } + } + } + builders { + name: "ios-angle-builder" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builder:ios-angle-builder" + dimensions: "cpu:x86-64" + dimensions: "os:Mac" + dimensions: "pool:luci.chromium.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/goma\":{\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\",\"use_luci_auth\":true},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"chromium.angle\",\"perf_dashboard_machine_group\":\"ChromiumANGLE\",\"recipe\":\"angle_chromium\",\"xcode_build_version\":\"12a7209\"}" + execution_timeout_secs: 10800 + caches { + name: "xcode_ios_12a7209" + path: "xcode_ios_12a7209.app" + } + build_numbers: YES + service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.resultdb.result_sink" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.junit_tests" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" + } + } + } + } + } + builders { + name: "ios-angle-intel" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:2" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-16.04" + dimensions: "pool:luci.chromium.gpu.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/goma\":{\"use_luci_auth\":true},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"chromium.angle\",\"perf_dashboard_machine_group\":\"ChromiumANGLE\",\"recipe\":\"angle_chromium\"}" + execution_timeout_secs: 10800 + build_numbers: YES + service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.resultdb.result_sink" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18448,7 +19904,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18504,6 +19960,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18557,6 +20017,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18612,7 +20076,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18669,7 +20133,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18725,6 +20189,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18779,7 +20247,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18835,6 +20303,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -18889,7 +20361,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -18946,7 +20418,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19003,7 +20475,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19060,7 +20532,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19117,7 +20589,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19174,7 +20646,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19228,6 +20700,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19279,6 +20755,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19330,6 +20810,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19381,6 +20865,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19432,6 +20920,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19483,6 +20975,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19535,7 +21031,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19589,6 +21085,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19640,6 +21140,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19692,7 +21196,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19746,6 +21250,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -19798,7 +21306,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19853,7 +21361,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19908,7 +21416,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -19963,7 +21471,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20017,6 +21525,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20069,7 +21581,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20123,6 +21635,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20175,7 +21691,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20230,7 +21746,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20285,7 +21801,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20340,7 +21856,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20395,7 +21911,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20449,6 +21965,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20501,7 +22021,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20555,6 +22075,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20607,7 +22131,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20661,6 +22185,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20711,6 +22239,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20762,6 +22294,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20813,6 +22349,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20864,6 +22404,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -20916,7 +22460,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -20971,7 +22515,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -21026,7 +22570,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -21080,6 +22624,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21131,6 +22679,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21182,6 +22734,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21233,6 +22789,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21284,6 +22844,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21335,6 +22899,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21386,6 +22954,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21437,6 +23009,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21488,6 +23064,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21540,7 +23120,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -21594,6 +23174,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21647,7 +23231,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -21703,7 +23287,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -21759,7 +23343,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -21813,6 +23397,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21862,6 +23450,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21913,6 +23505,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -21962,6 +23558,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22013,6 +23613,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22064,6 +23668,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22115,6 +23723,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22165,6 +23777,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22215,6 +23831,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22264,6 +23884,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22315,6 +23939,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22366,6 +23994,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22418,7 +24050,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -22472,7 +24104,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -22525,6 +24157,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22574,6 +24210,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22626,7 +24266,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -22680,7 +24320,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -22734,7 +24374,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -22786,6 +24426,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22835,6 +24479,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22884,6 +24532,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -22935,7 +24587,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -22989,6 +24641,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23040,6 +24696,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23091,6 +24751,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23142,6 +24806,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23193,6 +24861,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23244,6 +24916,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23295,6 +24971,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23346,6 +25026,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23397,7 +25081,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -23451,6 +25135,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23502,6 +25190,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23553,6 +25245,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23604,6 +25300,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23656,7 +25356,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -23709,6 +25409,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23759,6 +25463,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23810,6 +25518,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23860,6 +25572,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23910,6 +25626,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -23960,6 +25680,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24012,7 +25736,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24067,7 +25791,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24122,7 +25846,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24177,7 +25901,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24231,7 +25955,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24284,7 +26008,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24338,6 +26062,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24389,6 +26117,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24440,6 +26172,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24491,6 +26227,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24542,6 +26282,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24593,6 +26337,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24644,6 +26392,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24695,6 +26447,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24746,6 +26502,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24798,7 +26558,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -24852,6 +26612,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24903,6 +26667,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -24954,6 +26722,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25005,6 +26777,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25057,7 +26833,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -25111,6 +26887,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25162,6 +26942,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25212,6 +26996,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25262,6 +27050,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25313,7 +27105,7 @@ } experiments { key: "chromium.resultdb.result_sink.gtests_local" - value: 30 + value: 100 } experiments { key: "chromium.resultdb.result_sink.junit_tests" @@ -25366,6 +27158,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25417,6 +27213,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25468,6 +27268,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25519,6 +27323,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25570,6 +27378,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25621,6 +27433,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25672,6 +27488,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25723,6 +27543,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25774,6 +27598,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -25825,6 +27653,10 @@ value: 100 } experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { key: "chromium.resultdb.result_sink.junit_tests" value: 100 } @@ -36499,6 +38331,67 @@ } } builders { + name: "ios-angle-try-intel" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cpu:x86-64" + dimensions: "os:Mac" + dimensions: "pool:luci.chromium.gpu.mac.mini.intel.uhd630.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/goma\":{\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\",\"use_luci_auth\":true},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"tryserver.chromium.angle\",\"recipe\":\"angle_chromium_trybot\",\"xcode_build_version\":\"12a7209\"}" + execution_timeout_secs: 7200 + expiration_secs: 7200 + caches { + name: "win_toolchain" + path: "win_toolchain" + } + caches { + name: "xcode_ios_12a7209" + path: "xcode_ios_12a7209.app" + } + build_numbers: YES + service_account: "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + task_template_canary_percentage { + value: 5 + } + experiments { + key: "chromium.resultdb.result_sink" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.junit_tests" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "try_test_results" + test_results {} + } + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "gpu_try_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" + } + } + } + } + } + builders { name: "ios-device" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper"
diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg index 993cd27c..2764aaef 100644 --- a/infra/config/generated/luci-milo.cfg +++ b/infra/config/generated/luci-milo.cfg
@@ -3615,6 +3615,16 @@ short_name: "x64" } builders { + name: "buildbucket/luci.chromium.ci/ios-angle-builder" + category: "iOS|Builder|ANGLE" + short_name: "x64" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-angle-intel" + category: "iOS|Intel|ANGLE" + short_name: "x64" + } + builders { name: "buildbucket/luci.chromium.ci/win-angle-x64-builder" category: "Windows|Builder|ANGLE" short_name: "x64" @@ -12577,6 +12587,9 @@ name: "buildbucket/luci.chromium.try/gpu-try-win10-nvidia-rel" } builders { + name: "buildbucket/luci.chromium.try/ios-angle-try-intel" + } + builders { name: "buildbucket/luci.chromium.try/ios-device" } builders { @@ -13306,6 +13319,9 @@ name: "buildbucket/luci.chromium.try/fuchsia-angle-rel" } builders { + name: "buildbucket/luci.chromium.try/ios-angle-try-intel" + } + builders { name: "buildbucket/luci.chromium.try/linux-angle-rel" } builders {
diff --git a/infra/config/generated/luci-scheduler.cfg b/infra/config/generated/luci-scheduler.cfg index fa0d744..8365c1b 100644 --- a/infra/config/generated/luci-scheduler.cfg +++ b/infra/config/generated/luci-scheduler.cfg
@@ -5071,6 +5071,30 @@ } } job { + id: "ios-angle-builder" + realm: "ci" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "ios-angle-builder" + } +} +job { + id: "ios-angle-intel" + realm: "ci" + acls { + role: TRIGGERER + granted_to: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + } + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "ios-angle-intel" + } +} +job { id: "ios-asan" realm: "ci" acl_sets: "ci" @@ -7086,6 +7110,7 @@ triggers: "fuchsia-official" triggers: "fuchsia-x64-cast" triggers: "fuchsia-x64-dbg" + triggers: "ios-angle-builder" triggers: "ios-asan" triggers: "ios-device" triggers: "ios-simulator"
diff --git a/infra/config/lib/ci.star b/infra/config/lib/ci.star index f73965f..431a631 100644 --- a/infra/config/lib/ci.star +++ b/infra/config/lib/ci.star
@@ -96,6 +96,7 @@ experiments = experiments or {} experiments.setdefault("chromium.resultdb.result_sink", 100) experiments.setdefault("chromium.resultdb.result_sink.junit_tests", 100) + experiments.setdefault("chromium.resultdb.result_sink.gtests_local", 100) # Define the builder first so that any validation of luci.builder arguments # (e.g. bucket) occurs before we try to use it @@ -368,9 +369,6 @@ builder_group = "chromium.fyi", execution_timeout = execution_timeout, goma_backend = goma_backend, - experiments = { - "chromium.resultdb.result_sink.gtests_local": 30, - }, **kwargs )
diff --git a/infra/config/lib/try.star b/infra/config/lib/try.star index b08b142..046bc0f 100644 --- a/infra/config/lib/try.star +++ b/infra/config/lib/try.star
@@ -235,6 +235,33 @@ **kwargs ) +def chromium_angle_pinned_builder(*, name, **kwargs): + return try_builder( + name = name, + builder_group = "tryserver.chromium.angle", + builderless = True, + executable = "recipe:angle_chromium_trybot", + goma_backend = builders.goma.backend.RBE_PROD, + service_account = "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com", + **kwargs + ) + +def chromium_angle_mac_builder(*, name, **kwargs): + return chromium_angle_pinned_builder( + name = name, + cores = None, + ssd = None, + os = builders.os.MAC_ANY, + **kwargs + ) + +def chromium_angle_ios_builder(*, name, **kwargs): + return chromium_angle_mac_builder( + name = name, + xcode = builders.xcode.x12a7209, + **kwargs + ) + def chromium_chromiumos_builder(*, name, **kwargs): return try_builder( name = name, @@ -445,6 +472,8 @@ chromium_builder = chromium_builder, chromium_android_builder = chromium_android_builder, chromium_angle_builder = chromium_angle_builder, + chromium_angle_ios_builder = chromium_angle_ios_builder, + chromium_angle_mac_builder = chromium_angle_mac_builder, chromium_chromiumos_builder = chromium_chromiumos_builder, chromium_dawn_builder = chromium_dawn_builder, chromium_linux_builder = chromium_linux_builder,
diff --git a/infra/config/subprojects/chromium/angle.try.star b/infra/config/subprojects/chromium/angle.try.star new file mode 100644 index 0000000..1fced20 --- /dev/null +++ b/infra/config/subprojects/chromium/angle.try.star
@@ -0,0 +1,37 @@ +# Copyright 2020 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. + +load("//lib/builders.star", "cpu", "os") +load("//lib/try.star", "try_") + +try_.defaults.set( + bucket = "try", + build_numbers = True, + caches = [ + swarming.cache( + name = "win_toolchain", + path = "win_toolchain", + ), + ], + configure_kitchen = True, + cores = 8, + cpu = cpu.X86_64, + cq_group = "cq", + executable = "recipe:chromium_trybot", + execution_timeout = 2 * time.hour, + # Max. pending time for builds. CQ considers builds pending >2h as timed + # out: http://shortn/_8PaHsdYmlq. Keep this in sync. + expiration_timeout = 2 * time.hour, + os = os.LINUX_DEFAULT, + pool = "luci.chromium.try", + service_account = "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com", + subproject_list_view = "luci.chromium.try", + swarming_tags = ["vpython:native-python-wrapper"], + task_template_canary_percentage = 5, +) + +try_.chromium_angle_ios_builder( + name = "ios-angle-try-intel", + pool = "luci.chromium.gpu.mac.mini.intel.uhd630.try", +)
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index 5166586..ff34b32 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -134,7 +134,7 @@ consoles.console_view( name = "chromium.angle", ordering = { - None: ["Android", "AndroidVk", "Fuchsia", "Linux", "LinuxOzone", "Mac", "Windows", "Perf"], + None: ["Android", "AndroidVk", "Fuchsia", "Linux", "LinuxOzone", "Mac", "iOS", "Windows", "Perf"], "*builder*": ["Builder"], "Android": "*builder*", "AndroidVk": "*builder*", @@ -142,6 +142,7 @@ "Linux": "*builder*", "LinuxOzone": "*builder*", "Mac": "*builder*", + "iOS": "*builder*", "Windows": "*builder*", "Perf": "*builder*", }, @@ -1328,6 +1329,24 @@ triggered_by = ["mac-angle-chromium-builder"], ) +ci.angle_mac_builder( + name = "ios-angle-builder", + xcode = xcode.x12a7209, + console_view_entry = consoles.console_view_entry( + category = "iOS|Builder|ANGLE", + short_name = "x64", + ), +) + +ci.angle_thin_tester( + name = "ios-angle-intel", + console_view_entry = consoles.console_view_entry( + category = "iOS|Intel|ANGLE", + short_name = "x64", + ), + triggered_by = ["ios-angle-builder"], +) + ci.angle_windows_builder( name = "win-angle-chromium-x64-builder", console_view_entry = consoles.console_view_entry(
diff --git a/infra/config/subprojects/chromium/subproject.star b/infra/config/subprojects/chromium/subproject.star index b7eaf15..3c35dce 100644 --- a/infra/config/subprojects/chromium/subproject.star +++ b/infra/config/subprojects/chromium/subproject.star
@@ -7,6 +7,7 @@ exec("./ci.star") exec("./try.star") exec("./gpu.try.star") +exec("./angle.try.star") exec("./swangle.try.star") # TODO(gbeaty) external_console_view uses new fields/types that aren't present
diff --git a/ios/chrome/browser/history/domain_diversity_reporter_factory.mm b/ios/chrome/browser/history/domain_diversity_reporter_factory.mm index afaf397..1f983d2 100644 --- a/ios/chrome/browser/history/domain_diversity_reporter_factory.mm +++ b/ios/chrome/browser/history/domain_diversity_reporter_factory.mm
@@ -54,6 +54,10 @@ ios::HistoryServiceFactory::GetForBrowserState( chrome_browser_state, ServiceAccessType::EXPLICIT_ACCESS); + // Only build DomainDiversityReporter service with a valid |history_service|. + if (!history_service) + return nullptr; + return std::make_unique<DomainDiversityReporter>( history_service, chrome_browser_state->GetPrefs(), base::DefaultClock::GetInstance());
diff --git a/media/base/status_codes.h b/media/base/status_codes.h index e4781d5..7012484 100644 --- a/media/base/status_codes.h +++ b/media/base/status_codes.h
@@ -78,6 +78,8 @@ kCreateVideoProcessorEnumeratorFailed = 0x00000312, kCreateVideoProcessorFailed = 0x00000313, kQueryVideoContextFailed = 0x00000314, + kAcceleratorFlushFailed = 0x00000315, + kTryAgainNotSupported = 0x00000316, // MojoDecoder Errors: 0x04 kMojoDecoderNoWrappedDecoder = 0x00000401,
diff --git a/media/cast/README.md b/media/cast/README.md new file mode 100644 index 0000000..5d28612 --- /dev/null +++ b/media/cast/README.md
@@ -0,0 +1,28 @@ +# media/cast/ + +This directory contains a collection of components related to streaming using +the Cast Streaming Protocol (over UDP network sockets). They encode/decode raw +audio or video frames, and send/receive encoded data reliably over a local area +network. + +NOTE: This implementation is **deprecated**, and to be replaced soon by the one +found in `../../third_party/openscreen/src/cast/streaming/`. Contact +jophba@chromium.org for details. + +# Directory Breakdown + +* common/ - Collection of shared utility code and constants. + +* logging/ - Packet/Frame logging, for study/experimentation of the protocol at + runtime. + +* net/ - Wire-level packetization and pacing. + +* receiver/ - A minimal receiver implementation, used only for end-to-end + testing. + +* sender/ - Encoder front-ends and frame-level sender implementation for + audio/video. + +* test/ - A collection of end-to-end tests, experiments, benchmarks, and related + utility code.
diff --git a/media/gpu/windows/d3d11_video_decoder.cc b/media/gpu/windows/d3d11_video_decoder.cc index eea169c..ac043a7 100644 --- a/media/gpu/windows/d3d11_video_decoder.cc +++ b/media/gpu/windows/d3d11_video_decoder.cc
@@ -554,7 +554,7 @@ current_buffer_ = nullptr; if (!accelerated_video_decoder_->Flush()) { // This will also signal error |current_decode_cb_|. - NotifyError("Flush failed"); + NotifyError(StatusCode::kAcceleratorFlushFailed); return; } // Pictures out output synchronously during Flush. Signal the decode @@ -651,11 +651,12 @@ picture_buffers_.clear(); } else if (result == media::AcceleratedVideoDecoder::kTryAgain) { LOG(ERROR) << "Try again is not supported"; - NotifyError("Try again is not supported"); + NotifyError(StatusCode::kTryAgainNotSupported); return; } else { - LOG(ERROR) << "VDA Error " << result; - NotifyError("Accelerated decode failed"); + std::ostringstream message; + message << "VDA Error " << result; + NotifyError(Status(StatusCode::kDecoderFailedDecode, message.str())); return; } } @@ -898,13 +899,15 @@ TRACE_EVENT0("gpu", "D3D11VideoDecoder::NotifyError"); state_ = State::kError; - // TODO(tmathmeyer) - Remove this after plumbing Status through the - // decode_cb and input_buffer_queue cb's. - MEDIA_LOG(ERROR, media_log_) - << "D3D11VideoDecoder error: " << std::hex << reason.code(); - - if (init_cb_) + if (init_cb_) { std::move(init_cb_).Run(reason); + } else { + // TODO(tmathmeyer) - Remove this after plumbing Status through the + // decode_cb and input_buffer_queue cb's. + // Let the init handler set the error string if this is an init failure. + MEDIA_LOG(ERROR, media_log_) << "D3D11VideoDecoder error: 0x" << std::hex + << reason.code() << reason.message(); + } current_buffer_ = nullptr; if (current_decode_cb_)
diff --git a/net/android/network_library.cc b/net/android/network_library.cc index 2d9d6d9..c7d06c3f2 100644 --- a/net/android/network_library.cc +++ b/net/android/network_library.cc
@@ -130,16 +130,15 @@ return signal_strength; } -internal::ConfigParsePosixResult GetDnsServers( - std::vector<IPEndPoint>* dns_servers, - bool* dns_over_tls_active, - std::string* dns_over_tls_hostname) { +bool GetDnsServers(std::vector<IPEndPoint>* dns_servers, + bool* dns_over_tls_active, + std::string* dns_over_tls_hostname) { JNIEnv* env = AttachCurrentThread(); // Get the DNS status for the active network. ScopedJavaLocalRef<jobject> result = Java_AndroidNetworkLibrary_getDnsStatus(env, nullptr /* network */); if (result.is_null()) - return internal::CONFIG_PARSE_POSIX_NO_NAMESERVERS; + return false; // Parse the DNS servers. std::vector<std::vector<uint8_t>> dns_servers_data; @@ -155,8 +154,7 @@ *dns_over_tls_hostname = base::android::ConvertJavaStringToUTF8( Java_DnsStatus_getPrivateDnsServerName(env, result)); - return dns_servers->size() ? internal::CONFIG_PARSE_POSIX_OK - : internal::CONFIG_PARSE_POSIX_NO_NAMESERVERS; + return !dns_servers->empty(); } bool ReportBadDefaultNetwork() {
diff --git a/net/android/network_library.h b/net/android/network_library.h index e861700..d5410cc 100644 --- a/net/android/network_library.h +++ b/net/android/network_library.h
@@ -18,7 +18,6 @@ #include "net/base/ip_endpoint.h" #include "net/base/mime_util.h" #include "net/base/net_export.h" -#include "net/dns/dns_config_service_posix.h" #include "net/socket/socket_descriptor.h" namespace net { @@ -92,12 +91,10 @@ // settings. |dns_over_tls_hostname| will only be non-empty if // |dns_over_tls_active| is true. // Only callable on Marshmallow and newer releases. -// Returns CONFIG_PARSE_POSIX_OK upon success, -// CONFIG_PARSE_POSIX_NO_NAMESERVERS if no DNS servers found. -NET_EXPORT_PRIVATE internal::ConfigParsePosixResult GetDnsServers( - std::vector<IPEndPoint>* dns_servers, - bool* dns_over_tls_active, - std::string* dns_over_tls_hostname); +// Returns false when a valid server config could not be read. +NET_EXPORT_PRIVATE bool GetDnsServers(std::vector<IPEndPoint>* dns_servers, + bool* dns_over_tls_active, + std::string* dns_over_tls_hostname); // Reports to the framework that the current default network appears to have // connectivity issues. This may serve as a signal for the OS to consider
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc index 8c60173b..a08893c6 100644 --- a/net/cookies/canonical_cookie.cc +++ b/net/cookies/canonical_cookie.cc
@@ -776,6 +776,7 @@ CookieInclusionStatus::EXCLUDE_SAMEPARTY_CROSS_PARTY_CONTEXT); FALLTHROUGH; case CookieSamePartyStatus::kEnforceSamePartyInclude: { + status.AddWarningReason(CookieInclusionStatus::WARN_TREATED_AS_SAMEPARTY); // Remove any SameSite exclusion reasons, since SameParty overrides // SameSite. DCHECK(!status.HasExclusionReason( @@ -793,10 +794,23 @@ CookieInclusionStatus::EXCLUDE_SAMESITE_UNSPECIFIED_TREATED_AS_LAX, }); } + + // Update metrics. + if (status.HasOnlyExclusionReason( + CookieInclusionStatus::EXCLUDE_SAMEPARTY_CROSS_PARTY_CONTEXT) && + included_by_samesite) { + status.AddWarningReason( + CookieInclusionStatus::WARN_SAMEPARTY_EXCLUSION_OVERRULED_SAMESITE); + } if (status.IsInclude()) { UMA_HISTOGRAM_BOOLEAN( "Cookie.SamePartyReadIncluded.InclusionUnderSameSite", included_by_samesite); + if (!included_by_samesite) { + status.AddWarningReason( + CookieInclusionStatus:: + WARN_SAMEPARTY_INCLUSION_OVERRULED_SAMESITE); + } } break; } @@ -951,6 +965,8 @@ FALLTHROUGH; case CookieSamePartyStatus::kEnforceSamePartyInclude: { DCHECK(IsSameParty()); + access_result.status.AddWarningReason( + CookieInclusionStatus::WARN_TREATED_AS_SAMEPARTY); // Remove any SameSite exclusion reasons, since SameParty overrides // SameSite. DCHECK(!access_result.status.HasExclusionReason( @@ -969,10 +985,23 @@ CookieInclusionStatus::EXCLUDE_SAMESITE_UNSPECIFIED_TREATED_AS_LAX, }); } + + // Update metrics. + if (access_result.status.HasOnlyExclusionReason( + CookieInclusionStatus::EXCLUDE_SAMEPARTY_CROSS_PARTY_CONTEXT) && + included_by_samesite) { + access_result.status.AddWarningReason( + CookieInclusionStatus::WARN_SAMEPARTY_EXCLUSION_OVERRULED_SAMESITE); + } if (access_result.status.IsInclude()) { UMA_HISTOGRAM_BOOLEAN( "Cookie.SamePartySetIncluded.InclusionUnderSameSite", included_by_samesite); + if (!included_by_samesite) { + access_result.status.AddWarningReason( + CookieInclusionStatus:: + WARN_SAMEPARTY_INCLUSION_OVERRULED_SAMESITE); + } } break; }
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc index 226adc7..921eb226 100644 --- a/net/cookies/canonical_cookie_unittest.cc +++ b/net/cookies/canonical_cookie_unittest.cc
@@ -3572,7 +3572,8 @@ kCookieableSchemes), MatchesCookieAccessResult( CookieInclusionStatus::MakeFromReasonsForTesting( - {CookieInclusionStatus::EXCLUDE_SAMEPARTY_CROSS_PARTY_CONTEXT}), + {CookieInclusionStatus::EXCLUDE_SAMEPARTY_CROSS_PARTY_CONTEXT}, + {CookieInclusionStatus::WARN_TREATED_AS_SAMEPARTY}), _, _, true)); }
diff --git a/net/cookies/cookie_inclusion_status.cc b/net/cookies/cookie_inclusion_status.cc index 3eb96fc5..8eb4f75 100644 --- a/net/cookies/cookie_inclusion_status.cc +++ b/net/cookies/cookie_inclusion_status.cc
@@ -263,6 +263,10 @@ base::StrAppend(&out, {"WARN_LAX_CROSS_DOWNGRADE_LAX_SAMESITE, "}); if (HasWarningReason(WARN_SECURE_ACCESS_GRANTED_NON_CRYPTOGRAPHIC)) base::StrAppend(&out, {"WARN_SECURE_ACCESS_GRANTED_NON_CRYPTOGRAPHIC, "}); + if (HasWarningReason(WARN_SAMEPARTY_EXCLUSION_OVERRULED_SAMESITE)) + base::StrAppend(&out, {"WARN_SAMEPARTY_EXCLUSION_OVERRULED_SAMESITE, "}); + if (HasWarningReason(WARN_SAMEPARTY_INCLUSION_OVERRULED_SAMESITE)) + base::StrAppend(&out, {"WARN_SAMEPARTY_INCLUSION_OVERRULED_SAMESITE, "}); // Strip trailing comma and space. out.erase(out.end() - 2, out.end());
diff --git a/net/cookies/cookie_inclusion_status.h b/net/cookies/cookie_inclusion_status.h index 5836029..d46d01f 100644 --- a/net/cookies/cookie_inclusion_status.h +++ b/net/cookies/cookie_inclusion_status.h
@@ -151,6 +151,24 @@ // TODO(chlily): Add metrics for how often and where this occurs. WARN_SECURE_ACCESS_GRANTED_NON_CRYPTOGRAPHIC = 8, + // The cookie was treated as SameParty. This is different from looking at + // whether the cookie has the SameParty attribute, since we may choose to + // ignore that attribute for one reason or another. E.g., we ignore the + // SameParty attribute if the site is not a member of a nontrivial + // First-Party Set. + WARN_TREATED_AS_SAMEPARTY = 9, + + // The cookie was excluded solely for SameParty reasons (i.e. it was in + // cross-party context), but would have been included by SameSite. (This can + // only occur in cross-party, cross-site contexts, for cookies that are + // 'SameParty; SameSite=None'.) + WARN_SAMEPARTY_EXCLUSION_OVERRULED_SAMESITE = 10, + + // The cookie was included due to SameParty, even though it would have been + // excluded by SameSite. (This can only occur in same-party, cross-site + // contexts, for cookies that are 'SameParty; SameSite=Lax'.) + WARN_SAMEPARTY_INCLUSION_OVERRULED_SAMESITE = 11, + // This should be kept last. NUM_WARNING_REASONS };
diff --git a/net/dns/dns_config_service.cc b/net/dns/dns_config_service.cc index a0f1fccb..d475626 100644 --- a/net/dns/dns_config_service.cc +++ b/net/dns/dns_config_service.cc
@@ -7,7 +7,6 @@ #include <string> #include "base/check_op.h" -#include "base/metrics/histogram_macros.h" #include "base/notreached.h" namespace net { @@ -53,12 +52,6 @@ void DnsConfigService::InvalidateConfig() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - base::TimeTicks now = base::TimeTicks::Now(); - if (!last_invalidate_config_time_.is_null()) { - UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.ConfigNotifyInterval", - now - last_invalidate_config_time_); - } - last_invalidate_config_time_ = now; if (!have_config_) return; have_config_ = false; @@ -67,12 +60,6 @@ void DnsConfigService::InvalidateHosts() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - base::TimeTicks now = base::TimeTicks::Now(); - if (!last_invalidate_hosts_time_.is_null()) { - UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.HostsNotifyInterval", - now - last_invalidate_hosts_time_); - } - last_invalidate_hosts_time_ = now; if (!have_hosts_) return; have_hosts_ = false; @@ -83,17 +70,10 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(config.IsValid()); - bool changed = false; if (!config.EqualsIgnoreHosts(dns_config_)) { dns_config_.CopyIgnoreHosts(config); need_update_ = true; - changed = true; } - if (!changed && !last_sent_empty_time_.is_null()) { - UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.UnchangedConfigInterval", - base::TimeTicks::Now() - last_sent_empty_time_); - } - UMA_HISTOGRAM_BOOLEAN("AsyncDNS.ConfigChange", changed); have_config_ = true; if (have_hosts_ || watch_failed_) @@ -103,17 +83,10 @@ void DnsConfigService::OnHostsRead(const DnsHosts& hosts) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - bool changed = false; if (hosts != dns_config_.hosts) { dns_config_.hosts = hosts; need_update_ = true; - changed = true; } - if (!changed && !last_sent_empty_time_.is_null()) { - UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.UnchangedHostsInterval", - base::TimeTicks::Now() - last_sent_empty_time_); - } - UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostsChange", changed); have_hosts_ = true; if (have_config_ || watch_failed_) @@ -145,7 +118,6 @@ need_update_ = true; // Empty config is considered invalid. last_sent_empty_ = true; - last_sent_empty_time_ = base::TimeTicks::Now(); callback_.Run(DnsConfig()); }
diff --git a/net/dns/dns_config_service.h b/net/dns/dns_config_service.h index 67ae529..c0af67e4 100644 --- a/net/dns/dns_config_service.h +++ b/net/dns/dns_config_service.h
@@ -57,15 +57,6 @@ virtual void RefreshConfig(); protected: - enum WatchStatus { - DNS_CONFIG_WATCH_STARTED = 0, - DNS_CONFIG_WATCH_FAILED_TO_START_CONFIG, - DNS_CONFIG_WATCH_FAILED_TO_START_HOSTS, - DNS_CONFIG_WATCH_FAILED_CONFIG, - DNS_CONFIG_WATCH_FAILED_HOSTS, - DNS_CONFIG_WATCH_MAX, - }; - // Immediately attempts to read the current configuration. virtual void ReadNow() = 0; // Registers system watchers. Returns true iff succeeds. @@ -108,12 +99,6 @@ // Set when |timer_| expires. bool last_sent_empty_; - // Initialized and updated on Invalidate* call. - base::TimeTicks last_invalidate_config_time_; - base::TimeTicks last_invalidate_hosts_time_; - // Initialized and updated when |timer_| expires. - base::TimeTicks last_sent_empty_time_; - // Started in Invalidate*, cleared in On*Read. base::OneShotTimer timer_;
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc index bd838cb..19c038fe 100644 --- a/net/dns/dns_config_service_posix.cc +++ b/net/dns/dns_config_service_posix.cc
@@ -15,8 +15,6 @@ #include "base/lazy_instance.h" #include "base/location.h" #include "base/logging.h" -#include "base/macros.h" -#include "base/metrics/histogram_macros.h" #include "base/single_thread_task_runner.h" #include "base/threading/scoped_blocking_call.h" #include "base/threading/sequenced_task_runner_handle.h" @@ -145,31 +143,25 @@ } #endif // defined(OS_ANDROID) -ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) { +bool ReadDnsConfig(DnsConfig* dns_config) { base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::MAY_BLOCK); dns_config->unhandled_options = false; #if !defined(OS_ANDROID) - ConfigParsePosixResult result; + bool success = false; // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia. #if defined(OS_OPENBSD) || defined(OS_FUCHSIA) // Note: res_ninit in glibc always returns 0 and sets RES_INIT. // res_init behaves the same way. memset(&_res, 0, sizeof(_res)); - if (res_init() == 0) { - result = ConvertResStateToDnsConfig(_res, dns_config); - } else { - result = CONFIG_PARSE_POSIX_RES_INIT_FAILED; - } + if (res_init() == 0) + success = ConvertResStateToDnsConfig(_res, dns_config); #else // all other OS_POSIX struct __res_state res; memset(&res, 0, sizeof(res)); - if (res_ninit(&res) == 0) { - result = ConvertResStateToDnsConfig(res, dns_config); - } else { - result = CONFIG_PARSE_POSIX_RES_INIT_FAILED; - } - // Prefer res_ndestroy where available. + if (res_ninit(&res) == 0) + success = ConvertResStateToDnsConfig(res, dns_config); + // Prefer res_ndestroy where available. #if defined(OS_APPLE) || defined(OS_FREEBSD) res_ndestroy(&res); #else @@ -178,21 +170,12 @@ #endif // defined(OS_OPENBSD) #if defined(OS_MAC) - ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig(); - switch (error) { - case CONFIG_PARSE_POSIX_OK: - break; - case CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS: - LOG(WARNING) << "dns_config has unhandled options!"; - dns_config->unhandled_options = true; - FALLTHROUGH; - default: - return error; - } + if (!DnsConfigWatcher::CheckDnsConfig(&dns_config->unhandled_options)) + return false; #endif // defined(OS_MAC) // Override |fallback_period| value to match default setting on Windows. dns_config->fallback_period = kDnsDefaultFallbackPeriod; - return result; + return success; #else // defined(OS_ANDROID) dns_config->nameservers.clear(); @@ -205,7 +188,7 @@ if (IsVpnPresent()) { dns_config->unhandled_options = true; - return CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS; + return true; } // NOTE(pauljensen): __system_property_get and the net.dns1/2 properties are @@ -217,14 +200,14 @@ __system_property_get("net.dns2", property_value); std::string dns2_string = property_value; if (dns1_string.empty() && dns2_string.empty()) - return CONFIG_PARSE_POSIX_NO_NAMESERVERS; + return false; IPAddress dns1_address; IPAddress dns2_address; bool parsed1 = dns1_address.AssignFromIPLiteral(dns1_string); bool parsed2 = dns2_address.AssignFromIPLiteral(dns2_string); if (!parsed1 && !parsed2) - return CONFIG_PARSE_POSIX_BAD_ADDRESS; + return false; if (parsed1) { IPEndPoint dns1(dns1_address, dns_protocol::kDefaultPort); @@ -235,7 +218,7 @@ dns_config->nameservers.push_back(dns2); } - return CONFIG_PARSE_POSIX_OK; + return true; #endif // !defined(OS_ANDROID) } @@ -252,9 +235,6 @@ base::Unretained(this)))) { LOG(ERROR) << "DNS config watch failed to start."; success = false; - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_TO_START_CONFIG, - DNS_CONFIG_WATCH_MAX); } // Hosts file should never change on Android or iOS (and watching it on Android // is problematic; see http://crbug.com/600442), so don't watch it there. @@ -265,9 +245,6 @@ base::Unretained(this)))) { LOG(ERROR) << "DNS hosts watch failed to start."; success = false; - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_TO_START_HOSTS, - DNS_CONFIG_WATCH_MAX); } #endif // !defined(OS_ANDROID) && !defined(OS_IOS) return success; @@ -315,26 +292,7 @@ DETACH_FROM_SEQUENCE(sequence_checker_); } - void DoWork() override { - base::TimeTicks start_time = base::TimeTicks::Now(); - ConfigParsePosixResult result = ReadDnsConfig(&dns_config_); - switch (result) { - case CONFIG_PARSE_POSIX_MISSING_OPTIONS: - case CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS: - DCHECK(dns_config_.unhandled_options); - FALLTHROUGH; - case CONFIG_PARSE_POSIX_OK: - success_ = true; - break; - default: - success_ = false; - break; - } - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.ConfigParsePosix", - result, CONFIG_PARSE_POSIX_MAX); - UMA_HISTOGRAM_TIMES("AsyncDNS.ConfigParseDuration", - base::TimeTicks::Now() - start_time); - } + void DoWork() override { success_ = ReadDnsConfig(&dns_config_); } void OnWorkFinished() override { DCHECK(!IsCancelled()); @@ -375,13 +333,9 @@ ~HostsReader() override {} void DoWork() override { - base::TimeTicks start_time = base::TimeTicks::Now(); base::ScopedBlockingCall scoped_blocking_call( FROM_HERE, base::BlockingType::MAY_BLOCK); success_ = ParseHostsFile(file_path_hosts_, &hosts_); - UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostParseResult", success_); - UMA_HISTOGRAM_TIMES("AsyncDNS.HostsParseDuration", - base::TimeTicks::Now() - start_time); } void OnWorkFinished() override { @@ -431,8 +385,6 @@ CreateReaders(); // TODO(szym): re-start watcher if that makes sense. http://crbug.com/116139 watcher_.reset(new Watcher(this)); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", DNS_CONFIG_WATCH_STARTED, - DNS_CONFIG_WATCH_MAX); return watcher_->Watch(); } @@ -443,9 +395,6 @@ } else { LOG(ERROR) << "DNS config watch failed."; set_watch_failed(true); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_CONFIG, - DNS_CONFIG_WATCH_MAX); } } @@ -456,9 +405,6 @@ } else { LOG(ERROR) << "DNS hosts watch failed."; set_watch_failed(true); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_HOSTS, - DNS_CONFIG_WATCH_MAX); } } @@ -471,12 +417,12 @@ } #if !defined(OS_ANDROID) -ConfigParsePosixResult ConvertResStateToDnsConfig(const struct __res_state& res, - DnsConfig* dns_config) { +bool ConvertResStateToDnsConfig(const struct __res_state& res, + DnsConfig* dns_config) { DCHECK(dns_config); if (!(res.options & RES_INIT)) - return CONFIG_PARSE_POSIX_RES_INIT_UNSET; + return false; dns_config->nameservers.clear(); @@ -490,7 +436,7 @@ if (!ipe.FromSockAddr( reinterpret_cast<const struct sockaddr*>(&addresses[i]), sizeof addresses[i])) { - return CONFIG_PARSE_POSIX_BAD_ADDRESS; + return false; } dns_config->nameservers.push_back(ipe); } @@ -513,10 +459,10 @@ addr = reinterpret_cast<const struct sockaddr*>(res._u._ext.nsaddrs[i]); addr_len = sizeof *res._u._ext.nsaddrs[i]; } else { - return CONFIG_PARSE_POSIX_BAD_EXT_STRUCT; + return false; } if (!ipe.FromSockAddr(addr, addr_len)) - return CONFIG_PARSE_POSIX_BAD_ADDRESS; + return false; dns_config->nameservers.push_back(ipe); } #else // !(defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_APPLE) || @@ -527,7 +473,7 @@ if (!ipe.FromSockAddr( reinterpret_cast<const struct sockaddr*>(&res.nsaddr_list[i]), sizeof res.nsaddr_list[i])) { - return CONFIG_PARSE_POSIX_BAD_ADDRESS; + return false; } dns_config->nameservers.push_back(ipe); } @@ -555,25 +501,25 @@ const unsigned kRequiredOptions = RES_RECURSE | RES_DEFNAMES | RES_DNSRCH; if ((res.options & kRequiredOptions) != kRequiredOptions) { dns_config->unhandled_options = true; - return CONFIG_PARSE_POSIX_MISSING_OPTIONS; + return true; } const unsigned kUnhandledOptions = RES_USEVC | RES_IGNTC | RES_USE_DNSSEC; if (res.options & kUnhandledOptions) { dns_config->unhandled_options = true; - return CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS; + return true; } if (dns_config->nameservers.empty()) - return CONFIG_PARSE_POSIX_NO_NAMESERVERS; + return false; // If any name server is 0.0.0.0, assume the configuration is invalid. // TODO(szym): Measure how often this happens. http://crbug.com/125599 for (unsigned i = 0; i < dns_config->nameservers.size(); ++i) { if (dns_config->nameservers[i].address().IsZero()) - return CONFIG_PARSE_POSIX_NULL_ADDRESS; + return false; } - return CONFIG_PARSE_POSIX_OK; + return true; } #endif // !defined(OS_ANDROID)
diff --git a/net/dns/dns_config_service_posix.h b/net/dns/dns_config_service_posix.h index d2f89611..12fa1037 100644 --- a/net/dns/dns_config_service_posix.h +++ b/net/dns/dns_config_service_posix.h
@@ -17,6 +17,7 @@ #include "base/files/file_path.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/optional.h" #include "net/base/net_export.h" #include "net/dns/dns_config_service.h" @@ -65,24 +66,12 @@ DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix); }; -enum ConfigParsePosixResult { - CONFIG_PARSE_POSIX_OK = 0, - CONFIG_PARSE_POSIX_RES_INIT_FAILED, - CONFIG_PARSE_POSIX_RES_INIT_UNSET, - CONFIG_PARSE_POSIX_BAD_ADDRESS, - CONFIG_PARSE_POSIX_BAD_EXT_STRUCT, - CONFIG_PARSE_POSIX_NULL_ADDRESS, - CONFIG_PARSE_POSIX_NO_NAMESERVERS, - CONFIG_PARSE_POSIX_MISSING_OPTIONS, - CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS, - CONFIG_PARSE_POSIX_NO_DNSINFO, - CONFIG_PARSE_POSIX_MAX // Bounding values for enumeration. -}; - #if !defined(OS_ANDROID) -// Fills in |dns_config| from |res|. -ConfigParsePosixResult NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( - const struct __res_state& res, DnsConfig* dns_config); +// Fills in |dns_config| from |res|. Returns false iff a valid config could not +// be determined. +bool NET_EXPORT_PRIVATE +ConvertResStateToDnsConfig(const struct __res_state& res, + DnsConfig* dns_config); #endif } // namespace internal
diff --git a/net/dns/dns_config_service_posix_unittest.cc b/net/dns/dns_config_service_posix_unittest.cc index e8ce230a..da0c68e 100644 --- a/net/dns/dns_config_service_posix_unittest.cc +++ b/net/dns/dns_config_service_posix_unittest.cc
@@ -149,8 +149,7 @@ DnsConfig config; EXPECT_FALSE(config.IsValid()); InitializeResState(&res); - ASSERT_EQ(internal::CONFIG_PARSE_POSIX_OK, - internal::ConvertResStateToDnsConfig(res, &config)); + ASSERT_TRUE(internal::ConvertResStateToDnsConfig(res, &config)); CloseResState(&res); EXPECT_TRUE(config.IsValid()); @@ -177,13 +176,11 @@ res.nscount = 2; DnsConfig config; - EXPECT_EQ(internal::CONFIG_PARSE_POSIX_NULL_ADDRESS, - internal::ConvertResStateToDnsConfig(res, &config)); + EXPECT_FALSE(internal::ConvertResStateToDnsConfig(res, &config)); sa.sin_addr.s_addr = 0xDEADBEEF; res.nsaddr_list[0] = sa; - EXPECT_EQ(internal::CONFIG_PARSE_POSIX_OK, - internal::ConvertResStateToDnsConfig(res, &config)); + EXPECT_TRUE(internal::ConvertResStateToDnsConfig(res, &config)); } TEST(DnsConfigServicePosixTest, DestroyWhileJobsWorking) {
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc index 1d6dcaf..8e385ab 100644 --- a/net/dns/dns_config_service_win.cc +++ b/net/dns/dns_config_service_win.cc
@@ -17,7 +17,6 @@ #include "base/logging.h" #include "base/macros.h" #include "base/memory/free_deleter.h" -#include "base/metrics/histogram_macros.h" #include "base/sequence_checker.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_piece.h" @@ -69,15 +68,6 @@ L"SYSTEM\\CurrentControlSet\\Services\\Dnscache\\Parameters\\" L"DnsConnectionsProxies"; -enum HostsParseWinResult { - HOSTS_PARSE_WIN_OK = 0, - HOSTS_PARSE_WIN_UNREADABLE_HOSTS_FILE, - HOSTS_PARSE_WIN_COMPUTER_NAME_FAILED, - HOSTS_PARSE_WIN_IPHELPER_FAILED, - HOSTS_PARSE_WIN_BAD_ADDRESS, - HOSTS_PARSE_WIN_MAX // Bounding values for enumeration. -}; - // Convenience for reading values using RegKey. class RegistryReader { public: @@ -155,7 +145,7 @@ } // Reads DnsSystemSettings from IpHelper and registry. -ConfigParseWinResult ReadSystemSettings(DnsSystemSettings* settings) { +bool ReadSystemSettings(DnsSystemSettings* settings) { base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::MAY_BLOCK); settings->addresses = ReadIpHelper(GAA_FLAG_SKIP_ANYCAST | @@ -163,7 +153,7 @@ GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_FRIENDLY_NAME); if (!settings->addresses.get()) - return CONFIG_PARSE_WIN_READ_IPHELPER; + return false; RegistryReader tcpip_reader(kTcpipPath); RegistryReader tcpip6_reader(kTcpip6Path); @@ -172,32 +162,32 @@ RegistryReader primary_dns_suffix_reader(kPrimaryDnsSuffixPath); if (!policy_reader.ReadString(L"SearchList", &settings->policy_search_list)) { - return CONFIG_PARSE_WIN_READ_POLICY_SEARCHLIST; + return false; } if (!tcpip_reader.ReadString(L"SearchList", &settings->tcpip_search_list)) - return CONFIG_PARSE_WIN_READ_TCPIP_SEARCHLIST; + return false; if (!tcpip_reader.ReadString(L"Domain", &settings->tcpip_domain)) - return CONFIG_PARSE_WIN_READ_DOMAIN; + return false; if (!ReadDevolutionSetting(policy_reader, &settings->policy_devolution)) - return CONFIG_PARSE_WIN_READ_POLICY_DEVOLUTION; + return false; if (!ReadDevolutionSetting(dnscache_reader, &settings->dnscache_devolution)) - return CONFIG_PARSE_WIN_READ_DNSCACHE_DEVOLUTION; + return false; if (!ReadDevolutionSetting(tcpip_reader, &settings->tcpip_devolution)) - return CONFIG_PARSE_WIN_READ_TCPIP_DEVOLUTION; + return false; if (!policy_reader.ReadDword(L"AppendToMultiLabelName", &settings->append_to_multi_label_name)) { - return CONFIG_PARSE_WIN_READ_APPEND_MULTILABEL; + return false; } if (!primary_dns_suffix_reader.ReadString(L"PrimaryDnsSuffix", &settings->primary_dns_suffix)) { - return CONFIG_PARSE_WIN_READ_PRIMARY_SUFFIX; + return false; } base::win::RegistryKeyIterator nrpt_rules(HKEY_LOCAL_MACHINE, kNrptPath); @@ -213,12 +203,12 @@ settings->have_proxy = (dns_connections.SubkeyCount() > 0 || dns_connections_proxies.SubkeyCount() > 0); - return CONFIG_PARSE_WIN_OK; + return true; } // Default address of "localhost" and local computer name can be overridden // by the HOSTS file, but if it's not there, then we need to fill it in. -HostsParseWinResult AddLocalhostEntries(DnsHosts* hosts) { +bool AddLocalhostEntries(DnsHosts* hosts) { IPAddress loopback_ipv4 = IPAddress::IPv4Localhost(); IPAddress loopback_ipv6 = IPAddress::IPv6Localhost(); @@ -233,7 +223,7 @@ std::string localname; if (!GetComputerNameExW(ComputerNameDnsHostname, buffer, &size) || !ParseDomainASCII(buffer, &localname)) { - return HOSTS_PARSE_WIN_COMPUTER_NAME_FAILED; + return false; } localname = base::ToLowerASCII(localname); @@ -243,13 +233,13 @@ hosts->count(DnsHostsKey(localname, ADDRESS_FAMILY_IPV6)) > 0; if (have_ipv4 && have_ipv6) - return HOSTS_PARSE_WIN_OK; + return true; std::unique_ptr<IP_ADAPTER_ADDRESSES, base::FreeDeleter> addresses = ReadIpHelper(GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_FRIENDLY_NAME); if (!addresses.get()) - return HOSTS_PARSE_WIN_IPHELPER_FAILED; + return false; // The order of adapters is the network binding order, so stick to the // first good adapter for each family. @@ -267,7 +257,7 @@ IPEndPoint ipe; if (!ipe.FromSockAddr(address->Address.lpSockaddr, address->Address.iSockaddrLength)) { - return HOSTS_PARSE_WIN_BAD_ADDRESS; + return false; } if (!have_ipv4 && (ipe.GetFamily() == ADDRESS_FAMILY_IPV4)) { have_ipv4 = true; @@ -278,7 +268,7 @@ } } } - return HOSTS_PARSE_WIN_OK; + return true; } // Watches a single registry key for changes. @@ -505,9 +495,8 @@ return !output->empty(); } -ConfigParseWinResult ConvertSettingsToDnsConfig( - const DnsSystemSettings& settings, - DnsConfig* config) { +bool ConvertSettingsToDnsConfig(const DnsSystemSettings& settings, + DnsConfig* config) { bool uses_vpn = false; *config = DnsConfig(); @@ -543,7 +532,7 @@ ipe = IPEndPoint(ipe.address(), dns_protocol::kDefaultPort); config->nameservers.push_back(ipe); } else { - return CONFIG_PARSE_WIN_BAD_ADDRESS; + return false; } } @@ -558,7 +547,7 @@ } if (config->nameservers.empty()) - return CONFIG_PARSE_WIN_NO_NAMESERVERS; // No point continuing. + return false; // No point continuing. // Windows always tries a multi-label name "as is" before using suffixes. config->ndots = 1; @@ -575,14 +564,11 @@ config->use_local_ipv6 = true; } - ConfigParseWinResult result = CONFIG_PARSE_WIN_OK; - if (settings.have_name_resolution_policy || settings.have_proxy || uses_vpn) { + if (settings.have_name_resolution_policy || settings.have_proxy || uses_vpn) config->unhandled_options = true; - result = CONFIG_PARSE_WIN_UNHANDLED_OPTIONS; - } ConfigureSuffixSearch(settings, config); - return result; + return true; } // Watches registry and HOSTS file for changes. Must live on a sequence which @@ -603,9 +589,6 @@ if (!tcpip_watcher_.Watch(kTcpipPath, callback)) { LOG(ERROR) << "DNS registry watch failed to start."; success = false; - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_TO_START_CONFIG, - DNS_CONFIG_WATCH_MAX); } // Watch for IPv6 nameservers. @@ -624,9 +607,6 @@ base::FilePathWatcher::Type::kNonRecursive, base::BindRepeating(&Watcher::OnHostsChanged, base::Unretained(this)))) { - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_TO_START_HOSTS, - DNS_CONFIG_WATCH_MAX); LOG(ERROR) << "DNS hosts watch failed to start."; success = false; } else { @@ -671,17 +651,10 @@ ~ConfigReader() override {} void DoWork() override { - base::TimeTicks start_time = base::TimeTicks::Now(); DnsSystemSettings settings = {}; - ConfigParseWinResult result = ReadSystemSettings(&settings); - if (result == CONFIG_PARSE_WIN_OK) - result = ConvertSettingsToDnsConfig(settings, &dns_config_); - success_ = (result == CONFIG_PARSE_WIN_OK || - result == CONFIG_PARSE_WIN_UNHANDLED_OPTIONS); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.ConfigParseWin", - result, CONFIG_PARSE_WIN_MAX); - UMA_HISTOGRAM_TIMES("AsyncDNS.ConfigParseDuration", - base::TimeTicks::Now() - start_time); + success_ = false; + if (ReadSystemSettings(&settings)) + success_ = ConvertSettingsToDnsConfig(settings, &dns_config_); } void OnWorkFinished() override { @@ -718,18 +691,11 @@ ~HostsReader() override {} void DoWork() override { - base::TimeTicks start_time = base::TimeTicks::Now(); base::ScopedBlockingCall scoped_blocking_call( FROM_HERE, base::BlockingType::MAY_BLOCK); - HostsParseWinResult result = HOSTS_PARSE_WIN_UNREADABLE_HOSTS_FILE; + success_ = false; if (ParseHostsFile(path_, &hosts_)) - result = AddLocalhostEntries(&hosts_); - success_ = (result == HOSTS_PARSE_WIN_OK); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.HostsParseWin", - result, HOSTS_PARSE_WIN_MAX); - UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostParseResult", success_); - UMA_HISTOGRAM_TIMES("AsyncDNS.HostsParseDuration", - base::TimeTicks::Now() - start_time); + success_ = AddLocalhostEntries(&hosts_); } void OnWorkFinished() override { @@ -774,8 +740,6 @@ hosts_reader_ = base::MakeRefCounted<HostsReader>(this); // TODO(szym): re-start watcher if that makes sense. http://crbug.com/116139 watcher_.reset(new Watcher(this)); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", DNS_CONFIG_WATCH_STARTED, - DNS_CONFIG_WATCH_MAX); return watcher_->Watch(); } @@ -785,9 +749,6 @@ if (!succeeded) { LOG(ERROR) << "DNS config watch failed."; set_watch_failed(true); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_CONFIG, - DNS_CONFIG_WATCH_MAX); } } @@ -798,9 +759,6 @@ } else { LOG(ERROR) << "DNS hosts watch failed."; set_watch_failed(true); - UMA_HISTOGRAM_ENUMERATION("AsyncDNS.WatchStatus", - DNS_CONFIG_WATCH_FAILED_HOSTS, - DNS_CONFIG_WATCH_MAX); } }
diff --git a/net/dns/dns_config_service_win.h b/net/dns/dns_config_service_win.h index 6c7e3df9..de1d1ac5 100644 --- a/net/dns/dns_config_service_win.h +++ b/net/dns/dns_config_service_win.h
@@ -114,27 +114,11 @@ bool have_proxy = false; }; -enum ConfigParseWinResult { - CONFIG_PARSE_WIN_OK = 0, - CONFIG_PARSE_WIN_READ_IPHELPER, - CONFIG_PARSE_WIN_READ_POLICY_SEARCHLIST, - CONFIG_PARSE_WIN_READ_TCPIP_SEARCHLIST, - CONFIG_PARSE_WIN_READ_DOMAIN, - CONFIG_PARSE_WIN_READ_POLICY_DEVOLUTION, - CONFIG_PARSE_WIN_READ_DNSCACHE_DEVOLUTION, - CONFIG_PARSE_WIN_READ_TCPIP_DEVOLUTION, - CONFIG_PARSE_WIN_READ_APPEND_MULTILABEL, - CONFIG_PARSE_WIN_READ_PRIMARY_SUFFIX, - CONFIG_PARSE_WIN_BAD_ADDRESS, - CONFIG_PARSE_WIN_NO_NAMESERVERS, - CONFIG_PARSE_WIN_UNHANDLED_OPTIONS, - CONFIG_PARSE_WIN_MAX // Bounding values for enumeration. -}; - -// Fills in |dns_config| from |settings|. Exposed for tests. -ConfigParseWinResult NET_EXPORT_PRIVATE ConvertSettingsToDnsConfig( - const DnsSystemSettings& settings, - DnsConfig* dns_config); +// Fills in |dns_config| from |settings|. Exposed for tests. Returns false if a +// valid config could not be determined. +bool NET_EXPORT_PRIVATE +ConvertSettingsToDnsConfig(const DnsSystemSettings& settings, + DnsConfig* dns_config); // Service for reading and watching Windows system DNS settings. This object is // not thread-safe and methods may perform blocking I/O so methods must be
diff --git a/net/dns/dns_config_service_win_unittest.cc b/net/dns/dns_config_service_win_unittest.cc index 070df338..4ab74766 100644 --- a/net/dns/dns_config_service_win_unittest.cc +++ b/net/dns/dns_config_service_win_unittest.cc
@@ -184,14 +184,11 @@ } DnsConfig config; - internal::ConfigParseWinResult result = - internal::ConvertSettingsToDnsConfig(settings, &config); - internal::ConfigParseWinResult expected_result = - expected_nameservers.empty() ? internal::CONFIG_PARSE_WIN_NO_NAMESERVERS - : internal::CONFIG_PARSE_WIN_OK; - EXPECT_EQ(expected_result, result); + bool success = internal::ConvertSettingsToDnsConfig(settings, &config); + bool expected_success = !expected_nameservers.empty(); + EXPECT_EQ(expected_success, success); EXPECT_EQ(expected_nameservers, config.nameservers); - if (result == internal::CONFIG_PARSE_WIN_OK) { + if (success) { ASSERT_EQ(1u, config.search.size()); EXPECT_EQ(t.expected_suffix, config.search[0]); } @@ -393,8 +390,7 @@ settings.tcpip_devolution = t.input_settings.tcpip_devolution; DnsConfig config; - EXPECT_EQ(internal::CONFIG_PARSE_WIN_OK, - internal::ConvertSettingsToDnsConfig(settings, &config)); + EXPECT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config)); std::vector<std::string> expected_search; for (size_t j = 0; !t.expected_search[j].empty(); ++j) { expected_search.push_back(t.expected_search[j]); @@ -421,8 +417,7 @@ settings.addresses = CreateAdapterAddresses(infos); settings.append_to_multi_label_name = t.input; DnsConfig config; - EXPECT_EQ(internal::CONFIG_PARSE_WIN_OK, - internal::ConvertSettingsToDnsConfig(settings, &config)); + EXPECT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config)); EXPECT_EQ(t.expected_output, config.append_to_multi_label_name); } } @@ -437,10 +432,9 @@ const struct TestCase { bool have_nrpt; bool unhandled_options; - internal::ConfigParseWinResult result; } cases[] = { - { false, false, internal::CONFIG_PARSE_WIN_OK }, - { true, true, internal::CONFIG_PARSE_WIN_UNHANDLED_OPTIONS }, + {false, false}, + {true, true}, }; for (const auto& t : cases) { @@ -448,8 +442,7 @@ settings.addresses = CreateAdapterAddresses(infos); settings.have_name_resolution_policy = t.have_nrpt; DnsConfig config; - EXPECT_EQ(t.result, - internal::ConvertSettingsToDnsConfig(settings, &config)); + EXPECT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config)); EXPECT_EQ(t.unhandled_options, config.unhandled_options); EXPECT_EQ(t.have_nrpt, config.use_local_ipv6); } @@ -465,10 +458,9 @@ const struct TestCase { bool have_proxy; bool unhandled_options; - internal::ConfigParseWinResult result; } cases[] = { - {false, false, internal::CONFIG_PARSE_WIN_OK}, - {true, true, internal::CONFIG_PARSE_WIN_UNHANDLED_OPTIONS}, + {false, false}, + {true, true}, }; for (const auto& t : cases) { @@ -476,8 +468,7 @@ settings.addresses = CreateAdapterAddresses(infos); settings.have_proxy = t.have_proxy; DnsConfig config; - EXPECT_EQ(t.result, - internal::ConvertSettingsToDnsConfig(settings, &config)); + EXPECT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config)); EXPECT_EQ(t.unhandled_options, config.unhandled_options); } } @@ -493,8 +484,7 @@ internal::DnsSystemSettings settings; settings.addresses = CreateAdapterAddresses(infos); DnsConfig config; - EXPECT_EQ(internal::CONFIG_PARSE_WIN_UNHANDLED_OPTIONS, - internal::ConvertSettingsToDnsConfig(settings, &config)); + EXPECT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config)); EXPECT_TRUE(config.unhandled_options); }
diff --git a/net/dns/dns_config_watcher_mac.cc b/net/dns/dns_config_watcher_mac.cc index b65be94..bb175d7 100644 --- a/net/dns/dns_config_watcher_mac.cc +++ b/net/dns/dns_config_watcher_mac.cc
@@ -78,13 +78,15 @@ } // static -ConfigParsePosixResult DnsConfigWatcher::CheckDnsConfig() { +bool DnsConfigWatcher::CheckDnsConfig(bool* out_unhandled_options) { + DCHECK(out_unhandled_options); + if (!GetDnsInfoApi().dns_configuration_copy) - return CONFIG_PARSE_POSIX_NO_DNSINFO; + return false; std::unique_ptr<dns_config_t, DnsConfigTDeleter> dns_config( GetDnsInfoApi().dns_configuration_copy()); if (!dns_config) - return CONFIG_PARSE_POSIX_NO_DNSINFO; + return false; // TODO(szym): Parse dns_config_t for resolvers rather than res_state. // DnsClient can't handle domain-specific unscoped resolvers. @@ -97,9 +99,9 @@ continue; ++num_resolvers; } - if (num_resolvers > 1) - return CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS; - return CONFIG_PARSE_POSIX_OK; + + *out_unhandled_options = num_resolvers > 1; + return true; } } // namespace internal
diff --git a/net/dns/dns_config_watcher_mac.h b/net/dns/dns_config_watcher_mac.h index a6399363..9151a52 100644 --- a/net/dns/dns_config_watcher_mac.h +++ b/net/dns/dns_config_watcher_mac.h
@@ -6,7 +6,6 @@ #define NET_DNS_DNS_CONFIG_WATCHER_MAC_H_ #include "base/callback_forward.h" -#include "net/dns/dns_config_service_posix.h" #include "net/dns/notify_watcher_mac.h" namespace net { @@ -17,9 +16,8 @@ public: bool Watch(const base::RepeatingCallback<void(bool succeeded)>& callback); - // Returns an error if the DNS configuration is invalid. - // Returns CONFIG_PARSE_POSIX_OK otherwise. - static ConfigParsePosixResult CheckDnsConfig(); + // Returns false iff a valid config could not be determined. + static bool CheckDnsConfig(bool* out_unhandled_options); private: NotifyWatcherMac watcher_;
diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc index d6fed319..996a515f 100644 --- a/net/dns/dns_session.cc +++ b/net/dns/dns_session.cc
@@ -10,7 +10,6 @@ #include <utility> #include "base/bind.h" -#include "base/metrics/histogram_macros.h" #include "base/rand_util.h" #include "base/stl_util.h" #include "net/dns/dns_config.h" @@ -28,10 +27,7 @@ rand_callback_(base::BindRepeating(rand_int_callback, 0, std::numeric_limits<uint16_t>::max())), - net_log_(net_log) { - UMA_HISTOGRAM_CUSTOM_COUNTS("AsyncDNS.ServerCount", - config_.nameservers.size(), 1, 10, 11); -} + net_log_(net_log) {} DnsSession::~DnsSession() = default;
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json index aa5901f..52e8997 100644 --- a/net/http/transport_security_state_static.json +++ b/net/http/transport_security_state_static.json
@@ -75,7 +75,6 @@ "GlobalSignRootCA_R2" ], "bad_static_spki_hashes": [ - "GlobalSignRootCA", "GlobalSignExtendedValidationCA", "GlobalSignExtendedValidationCA_G2", "GlobalSignExtendedValidationCA_SHA256_G2"
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc index 3ada2318..4a4fb96 100644 --- a/pdf/out_of_process_instance.cc +++ b/pdf/out_of_process_instance.cc
@@ -129,7 +129,12 @@ constexpr char kJSBookmarksData[] = "bookmarksData"; // Metadata (Plugin -> Page) constexpr char kJSMetadataType[] = "metadata"; +constexpr char kJSMetadataData[] = "metadataData"; constexpr char kJSTitle[] = "title"; +constexpr char kJSAuthor[] = "author"; +constexpr char kJSSubject[] = "subject"; +constexpr char kJSCreator[] = "creator"; +constexpr char kJSProducer[] = "producer"; constexpr char kJSCanSerializeDocument[] = "canSerializeDocument"; // Get password (Plugin -> Page) constexpr char kJSGetPasswordType[] = "getPassword"; @@ -758,24 +763,24 @@ } void OutOfProcessInstance::DidChangeView(const pp::View& view) { - pp::Rect view_rect(view.GetRect()); + gfx::Rect view_rect = RectFromPPRect(view.GetRect()); float old_device_scale = device_scale(); float new_device_scale = view.GetDeviceScale(); - pp::Size view_device_size(view_rect.width() * new_device_scale, - view_rect.height() * new_device_scale); + gfx::Size view_device_size(view_rect.width() * new_device_scale, + view_rect.height() * new_device_scale); - if (view_device_size != plugin_size_ || new_device_scale != device_scale() || - view_rect.point() != plugin_offset_) { + if (view_device_size != plugin_size() || new_device_scale != device_scale() || + view_rect.origin() != plugin_offset()) { set_device_scale(new_device_scale); - plugin_dip_size_ = view_rect.size(); - plugin_size_ = view_device_size; - plugin_offset_ = view_rect.point(); + set_plugin_dip_size(view_rect.size()); + set_plugin_size(view_device_size); + set_plugin_offset(view_rect.origin()); - paint_manager().SetSize(SizeFromPPSize(view_device_size), device_scale()); + paint_manager().SetSize(view_device_size, device_scale()); const gfx::Size old_image_data_size = SizeFromPPSize(image_data_.size()); - gfx::Size new_image_data_size = PaintManager::GetNewContextSize( - old_image_data_size, SizeFromPPSize(plugin_size_)); + gfx::Size new_image_data_size = + PaintManager::GetNewContextSize(old_image_data_size, plugin_size()); if (new_image_data_size != old_image_data_size) { image_data_ = pp::ImageData(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL, PPSizeFromSize(new_image_data_size), false); @@ -785,7 +790,7 @@ } if (image_data_.is_null()) { - DCHECK(plugin_size_.IsEmpty()); + DCHECK(plugin_size().IsEmpty()); return; } @@ -913,9 +918,9 @@ void OutOfProcessInstance::SendAccessibilityViewportInfo() { PP_PrivateAccessibilityViewportInfo viewport_info; - viewport_info.scroll.x = -plugin_offset_.x(); + viewport_info.scroll.x = -plugin_offset().x(); viewport_info.scroll.y = - -top_toolbar_height_in_viewport_coords() - plugin_offset_.y(); + -top_toolbar_height_in_viewport_coords() - plugin_offset().y(); viewport_info.offset.x = available_area_.x() / (device_scale() * zoom()); viewport_info.offset.y = available_area_.y() / (device_scale() * zoom()); @@ -1115,7 +1120,7 @@ std::vector<PaintReadyRect>* ready, std::vector<gfx::Rect>* pending) { if (image_data_.is_null()) { - DCHECK(plugin_size_.IsEmpty()); + DCHECK(plugin_size().IsEmpty()); return; } if (first_paint()) { @@ -1133,8 +1138,7 @@ for (const auto& paint_rect : paint_rects) { // Intersect with plugin area since there could be pending invalidates from // when the plugin area was larger. - gfx::Rect rect = gfx::IntersectRects( - paint_rect, gfx::Rect(SizeFromPPSize(plugin_size_))); + gfx::Rect rect = gfx::IntersectRects(paint_rect, gfx::Rect(plugin_size())); if (rect.IsEmpty()) continue; @@ -1161,7 +1165,7 @@ : engine()->GetPageScreenRect(0).y(); if (rect.y() < first_page_ypos) { gfx::Rect region = gfx::IntersectRects( - rect, gfx::Rect(gfx::Size(plugin_size_.width(), first_page_ypos))); + rect, gfx::Rect(gfx::Size(plugin_size().width(), first_page_ypos))); ready->push_back(PaintReadyRect(region, image_data_)); FillRect(region, GetBackgroundColor()); } @@ -1191,8 +1195,8 @@ background_parts_.clear(); int left_width = available_area_.x(); int right_start = available_area_.right(); - int right_width = abs(plugin_size_.width() - available_area_.right()); - int bottom = std::min(available_area_.bottom(), plugin_size_.height()); + int right_width = abs(plugin_size().width() - available_area_.right()); + int bottom = std::min(available_area_.bottom(), plugin_size().height()); // Add the left, right, and bottom rectangles. Note: we assume only // horizontal centering. @@ -1203,8 +1207,8 @@ part.location = pp::Rect(right_start, 0, right_width, bottom); if (!part.location.IsEmpty()) background_parts_.push_back(part); - part.location = - pp::Rect(0, bottom, plugin_size_.width(), plugin_size_.height() - bottom); + part.location = pp::Rect(0, bottom, plugin_size().width(), + plugin_size().height() - bottom); if (!part.location.IsEmpty()) background_parts_.push_back(part); } @@ -1835,7 +1839,7 @@ engine()->SetGrayscale(dict.Get(pp::Var(kJSPrintPreviewGrayscale)).AsBool()); engine()->New(url_.c_str(), /*headers=*/nullptr); - paint_manager().InvalidateRect(gfx::Rect(SizeFromPPSize(plugin_size_))); + paint_manager().InvalidateRect(gfx::Rect(plugin_size())); } void OutOfProcessInstance::HandleSaveAttachmentMessage( @@ -2008,7 +2012,7 @@ // position on screen of the paint. gfx::Vector2d paint_offset; - if (plugin_size_.width() > GetDocumentPixelWidth() * zoom_ratio) { + if (plugin_size().width() > GetDocumentPixelWidth() * zoom_ratio) { // We want to keep the paint in the middle but it must stay in the same // position relative to the scroll bars. paint_offset = gfx::Vector2d(0, (1 - zoom_ratio) * pinch_center.y()); @@ -2019,10 +2023,10 @@ pinch_vector = gfx::Vector2d(); last_bitmap_smaller_ = true; } else if (last_bitmap_smaller_) { - pinch_center = pp::Point((plugin_size_.width() / device_scale()) / 2, - (plugin_size_.height() / device_scale()) / 2); + pinch_center = pp::Point((plugin_size().width() / device_scale()) / 2, + (plugin_size().height() / device_scale()) / 2); const double zoom_when_doc_covers_plugin_width = - zoom() * plugin_size_.width() / GetDocumentPixelWidth(); + zoom() * plugin_size().width() / GetDocumentPixelWidth(); paint_offset = gfx::Vector2d( (1 - new_zoom / zoom_when_doc_covers_plugin_width) * pinch_center.x(), (1 - zoom_ratio) * pinch_center.y()); @@ -2092,7 +2096,7 @@ } document_load_state_ = LOAD_STATE_FAILED; - paint_manager().InvalidateRect(gfx::Rect(SizeFromPPSize(plugin_size_))); + paint_manager().InvalidateRect(gfx::Rect(plugin_size())); // Send a progress value of -1 to indicate a failure. SendLoadingProgress(-1); @@ -2183,7 +2187,7 @@ if (zoom() != old_zoom || device_scale() != old_device_scale) engine()->ZoomUpdated(zoom() * device_scale()); - available_area_ = gfx::Rect(SizeFromPPSize(plugin_size_)); + available_area_ = gfx::Rect(plugin_size()); int doc_width = GetDocumentPixelWidth(); if (doc_width < available_area_.width()) { available_area_.Offset((available_area_.width() - doc_width) / 2, 0); @@ -2201,7 +2205,7 @@ if (document_size().IsEmpty()) return; - paint_manager().InvalidateRect(gfx::Rect(SizeFromPPSize(plugin_size_))); + paint_manager().InvalidateRect(gfx::Rect(plugin_size())); if (accessibility_state_ == ACCESSIBILITY_STATE_LOADED) SendAccessibilityViewportInfo(); @@ -2374,14 +2378,31 @@ pp::VarDictionary metadata_message; metadata_message.Set(pp::Var(kType), pp::Var(kJSMetadataType)); - const std::string& title = engine()->GetDocumentMetadata().title; - if (!base::TrimWhitespace(base::UTF8ToUTF16(title), base::TRIM_ALL).empty()) - metadata_message.Set(pp::Var(kJSTitle), pp::Var(title)); + const DocumentMetadata& document_metadata = engine()->GetDocumentMetadata(); + pp::VarDictionary metadata_data; - metadata_message.Set( + if (!document_metadata.title.empty()) + metadata_data.Set(pp::Var(kJSTitle), pp::Var(document_metadata.title)); + + if (!document_metadata.author.empty()) + metadata_data.Set(pp::Var(kJSAuthor), pp::Var(document_metadata.author)); + + if (!document_metadata.subject.empty()) + metadata_data.Set(pp::Var(kJSSubject), pp::Var(document_metadata.subject)); + + if (!document_metadata.creator.empty()) + metadata_data.Set(pp::Var(kJSCreator), pp::Var(document_metadata.creator)); + + if (!document_metadata.producer.empty()) { + metadata_data.Set(pp::Var(kJSProducer), + pp::Var(document_metadata.producer)); + } + + metadata_data.Set( pp::Var(kJSCanSerializeDocument), pp::Var(IsSaveDataSizeValid(engine()->GetLoadedByteSize()))); + metadata_message.Set(pp::Var(kJSMetadataData), metadata_data); PostMessage(metadata_message); } @@ -2420,11 +2441,12 @@ pp::FloatPoint OutOfProcessInstance::BoundScrollOffsetToDocument( const pp::FloatPoint& scroll_offset) { float max_x = std::max( - document_size().width() * float{zoom()} - plugin_dip_size_.width(), 0.0f); + document_size().width() * float{zoom()} - plugin_dip_size().width(), + 0.0f); float x = base::ClampToRange(scroll_offset.x(), 0.0f, max_x); float min_y = -top_toolbar_height_in_viewport_coords(); float max_y = std::max( - document_size().height() * float{zoom()} - plugin_dip_size_.height(), + document_size().height() * float{zoom()} - plugin_dip_size().height(), min_y); float y = base::ClampToRange(scroll_offset.y(), min_y, max_y); return pp::FloatPoint(x, y);
diff --git a/pdf/out_of_process_instance.h b/pdf/out_of_process_instance.h index d66a82a..eec17f78 100644 --- a/pdf/out_of_process_instance.h +++ b/pdf/out_of_process_instance.h
@@ -347,15 +347,9 @@ // The current cursor. PP_CursorType_Dev cursor_ = PP_CURSORTYPE_POINTER; - // Size, in pixels, of plugin rectangle. - pp::Size plugin_size_; - // Size, in DIPs, of plugin rectangle. - pp::Size plugin_dip_size_; // Remaining area, in pixels, to render the pdf in after accounting for // horizontal centering. gfx::Rect available_area_; - // Positional offset, in CSS pixels, of the plugin rectangle. - pp::Point plugin_offset_; // The scroll offset in CSS pixels. pp::Point scroll_offset_;
diff --git a/pdf/pdf_view_plugin_base.h b/pdf/pdf_view_plugin_base.h index acc8380..b7182abb 100644 --- a/pdf/pdf_view_plugin_base.h +++ b/pdf/pdf_view_plugin_base.h
@@ -91,6 +91,15 @@ const gfx::Size& document_size() const { return document_size_; } void set_document_size(const gfx::Size& size) { document_size_ = size; } + const gfx::Size& plugin_size() const { return plugin_size_; } + void set_plugin_size(const gfx::Size& size) { plugin_size_ = size; } + + const gfx::Size& plugin_dip_size() const { return plugin_dip_size_; } + void set_plugin_dip_size(const gfx::Size& size) { plugin_dip_size_ = size; } + + const gfx::Point& plugin_offset() const { return plugin_offset_; } + void set_plugin_offset(const gfx::Point& offset) { plugin_offset_ = offset; } + void SetBackgroundColor(uint32_t background_color) { background_color_ = background_color; } @@ -124,6 +133,15 @@ // high and there are 10 pages, the height will be 8000). gfx::Size document_size_; + // Size, in pixels, of plugin rectangle. + gfx::Size plugin_size_; + + // Size, in DIPs, of plugin rectangle. + gfx::Size plugin_dip_size_; + + // Positional offset, in CSS pixels, of the plugin rectangle. + gfx::Point plugin_offset_; + // The background color of the PDF viewer. uint32_t background_color_ = 0;
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index baa08e3..3bb90f3 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -3950,19 +3950,22 @@ // Document information dictionary entries doc_metadata_.version = GetDocumentVersion(); - doc_metadata_.title = GetMetadataByField("Title"); - doc_metadata_.author = GetMetadataByField("Author"); - doc_metadata_.subject = GetMetadataByField("Subject"); - doc_metadata_.creator = GetMetadataByField("Creator"); - doc_metadata_.producer = GetMetadataByField("Producer"); + doc_metadata_.title = GetTrimmedMetadataByField("Title"); + doc_metadata_.author = GetTrimmedMetadataByField("Author"); + doc_metadata_.subject = GetTrimmedMetadataByField("Subject"); + doc_metadata_.creator = GetTrimmedMetadataByField("Creator"); + doc_metadata_.producer = GetTrimmedMetadataByField("Producer"); } -std::string PDFiumEngine::GetMetadataByField(FPDF_BYTESTRING field) const { +std::string PDFiumEngine::GetTrimmedMetadataByField( + FPDF_BYTESTRING field) const { DCHECK(doc()); - return base::UTF16ToUTF8(CallPDFiumWideStringBufferApi( + base::string16 metadata = CallPDFiumWideStringBufferApi( base::BindRepeating(&FPDF_GetMetaText, doc(), field), - /*check_expected_size=*/false)); + /*check_expected_size=*/false); + + return base::UTF16ToUTF8(base::TrimWhitespace(metadata, base::TRIM_ALL)); } PdfVersion PDFiumEngine::GetDocumentVersion() const {
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h index 39b957d..2bbdba1 100644 --- a/pdf/pdfium/pdfium_engine.h +++ b/pdf/pdfium/pdfium_engine.h
@@ -608,9 +608,9 @@ // document is loaded. void LoadDocumentMetadata(); - // Retrieves the unparsed value of |field| in the document information - // dictionary. - std::string GetMetadataByField(FPDF_BYTESTRING field) const; + // Retrieves the value of |field| in the document information dictionary. + // Trims whitespace characters from the retrieved value. + std::string GetTrimmedMetadataByField(FPDF_BYTESTRING field) const; // Retrieves the version of the PDF (e.g. 1.4 or 2.0) as an enum. PdfVersion GetDocumentVersion() const;
diff --git a/pdf/test/data/document_info.in b/pdf/test/data/document_info.in index e058b2c4..061890a8 100644 --- a/pdf/test/data/document_info.in +++ b/pdf/test/data/document_info.in
@@ -18,13 +18,13 @@ endobj {{object 4 0}} << /Author (Chromium Authors) - /CreationDate (D:20200205153912+00'00') + /CreationDate (D:20200205153912+00'00' ) /Creator (Your Preferred Text Editor) /Keywords (testing,chromium,pdfium,document,info) /ModDate (D:20200206094234+00'00') /Producer (fixup_pdf_template.py) /Subject (Testing) - /Title (Sample PDF Document Info) + /Title ( Sample PDF Document Info ) >> endobj {{xref}}
diff --git a/pdf/test/data/document_info.pdf b/pdf/test/data/document_info.pdf index db5918f..48e0c98 100644 --- a/pdf/test/data/document_info.pdf +++ b/pdf/test/data/document_info.pdf
@@ -19,13 +19,13 @@ endobj 4 0 obj << /Author (Chromium Authors) - /CreationDate (D:20200205153912+00'00') + /CreationDate (D:20200205153912+00'00' ) /Creator (Your Preferred Text Editor) /Keywords (testing,chromium,pdfium,document,info) /ModDate (D:20200206094234+00'00') /Producer (fixup_pdf_template.py) /Subject (Testing) - /Title (Sample PDF Document Info) + /Title ( Sample PDF Document Info ) >> endobj xref @@ -41,5 +41,5 @@ /Size 5 >> startxref -526 +533 %%EOF
diff --git a/remoting/host/audio_capturer_mac.cc b/remoting/host/audio_capturer_mac.cc index 48b4894..b2f688d 100644 --- a/remoting/host/audio_capturer_mac.cc +++ b/remoting/host/audio_capturer_mac.cc
@@ -33,6 +33,7 @@ constexpr float kBufferTimeDurationSec = 0.01f; // 10ms constexpr size_t kBufferByteSize = kSampleRate * kBytesPerFrame * kBufferTimeDurationSec; +constexpr int kAudioSilenceThreshold = 0; // Total delay: kBufferTimeDurationSec * kNumberBuffers constexpr int kNumberBuffers = 2; @@ -94,7 +95,8 @@ } // namespace AudioCapturerMac::AudioCapturerMac(const std::string& audio_device_uid) - : audio_device_uid_(audio_device_uid) { + : audio_device_uid_(audio_device_uid), + silence_detector_(kAudioSilenceThreshold) { DETACH_FROM_SEQUENCE(sequence_checker_); DCHECK(!audio_device_uid.empty()); @@ -170,15 +172,17 @@ DCHECK_EQ(input_queue_, aq); DCHECK(callback_); - // TODO(yuweih): Add silence detection and drop empty packets. - - auto packet = std::make_unique<AudioPacket>(); - packet->add_data(buffer->mAudioData, buffer->mAudioDataByteSize); - packet->set_encoding(AudioPacket::ENCODING_RAW); - packet->set_sampling_rate(kSampleRate); - packet->set_bytes_per_sample(AudioPacket::BYTES_PER_SAMPLE_2); - packet->set_channels(AudioPacket::CHANNELS_STEREO); - callback_.Run(std::move(packet)); + if (!silence_detector_.IsSilence( + reinterpret_cast<const int16_t*>(buffer->mAudioData), + buffer->mAudioDataByteSize / sizeof(int16_t) / kChannelsPerFrame)) { + auto packet = std::make_unique<AudioPacket>(); + packet->add_data(buffer->mAudioData, buffer->mAudioDataByteSize); + packet->set_encoding(AudioPacket::ENCODING_RAW); + packet->set_sampling_rate(kSampleRate); + packet->set_bytes_per_sample(AudioPacket::BYTES_PER_SAMPLE_2); + packet->set_channels(AudioPacket::CHANNELS_STEREO); + callback_.Run(std::move(packet)); + } // Recycle the buffer. // Only the first 2 params are needed for recording. @@ -242,6 +246,8 @@ } is_started_ = true; + silence_detector_.Reset(kSampleRate, kChannelsPerFrame); + return true; }
diff --git a/remoting/host/audio_capturer_mac.h b/remoting/host/audio_capturer_mac.h index a875e984..27e9b9f 100644 --- a/remoting/host/audio_capturer_mac.h +++ b/remoting/host/audio_capturer_mac.h
@@ -15,6 +15,7 @@ #include "base/sequence_checker.h" #include "base/sequenced_task_runner.h" #include "remoting/host/audio_capturer.h" +#include "remoting/host/audio_silence_detector.h" namespace remoting { @@ -57,6 +58,7 @@ std::string audio_device_uid_; AudioStreamBasicDescription stream_description_; + AudioSilenceDetector silence_detector_; PacketCapturedCallback callback_; AudioQueueRef input_queue_ = nullptr; bool is_started_ = false;
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 38b713d..18b0327 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -240,11 +240,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -254,7 +254,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -317,11 +317,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -331,7 +331,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -394,11 +394,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -408,7 +408,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -471,11 +471,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -485,7 +485,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -769,11 +769,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -783,7 +783,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -846,11 +846,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -860,7 +860,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -923,11 +923,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -937,7 +937,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1000,11 +1000,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -1014,7 +1014,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1298,11 +1298,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -1312,7 +1312,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1375,11 +1375,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -1389,7 +1389,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1452,11 +1452,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -1466,7 +1466,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1529,11 +1529,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -1543,7 +1543,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1827,11 +1827,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -1841,7 +1841,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1904,11 +1904,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Client Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -1918,7 +1918,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -1981,11 +1981,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.143", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 87.0.4280.145", "resultdb": { "enable": true }, @@ -1995,7 +1995,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M87", - "revision": "version:87.0.4280.143" + "revision": "version:87.0.4280.145" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -2058,11 +2058,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79" + "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.79", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Tests For 88.0.4324.82", "resultdb": { "enable": true }, @@ -2072,7 +2072,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M88", - "revision": "version:88.0.4324.79" + "revision": "version:88.0.4324.82" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.angle.json b/testing/buildbot/chromium.angle.json index de0e9241..669f27e5 100644 --- a/testing/buildbot/chromium.angle.json +++ b/testing/buildbot/chromium.angle.json
@@ -858,6 +858,115 @@ "angle_unittests" ] }, + "ios-angle-builder": {}, + "ios-angle-intel": { + "gtest_tests": [ + { + "args": [ + "angle_end2end_tests", + "--gtest_filter=-*Vulkan_SwiftShader*", + "--platform", + "iPhone X", + "--version", + "14.0", + "--bot-mode", + "--out-dir", + "${ISOLATED_OUTDIR}", + "--xcode-build-version", + "12a7209", + "--xctest" + ], + "isolate_profile_data": true, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "angle_end2end_tests_iPhone X 14.0", + "resultdb": { + "enable": true + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/mac_toolchain/${platform}", + "location": ".", + "revision": "git_revision:796d2b92cff93fc2059623ce0a66284373ceea0a" + } + ], + "containment_type": "AUTO", + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.15.5" + } + ], + "named_caches": [ + { + "name": "xcode_ios_12a7209", + "path": "Xcode.app" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "angle_end2end_tests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_end2end_tests/", + "use_isolated_scripts_api": true + }, + { + "args": [ + "angle_white_box_tests", + "--platform", + "iPhone X", + "--version", + "14.0", + "--bot-mode", + "--out-dir", + "${ISOLATED_OUTDIR}", + "--xcode-build-version", + "12a7209", + "--xctest" + ], + "isolate_profile_data": true, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "angle_white_box_tests_iPhone X 14.0", + "resultdb": { + "enable": true + }, + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/mac_toolchain/${platform}", + "location": ".", + "revision": "git_revision:796d2b92cff93fc2059623ce0a66284373ceea0a" + } + ], + "containment_type": "AUTO", + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.15.5" + } + ], + "named_caches": [ + { + "name": "xcode_ios_12a7209", + "path": "Xcode.app" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "angle_white_box_tests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_white_box_tests/", + "use_isolated_scripts_api": true + } + ] + }, "linux-angle-builder": {}, "linux-angle-chromium-builder": {}, "linux-angle-chromium-intel": {
diff --git a/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter b/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter index 7c57594..6cee29a6 100644 --- a/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter +++ b/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter
@@ -6,3 +6,8 @@ # Highly Flaky, even without Vulkan https://crbug.com/1134297 -All/DumpAccessibilityTreeTest.Accessibility* -All/ScrollBehaviorBrowserTest.OverflowScrollInterruptedByWheelScroll/1 + +# Consistent failures. https://crbug.com/1164594 +-SRC_ExternalClearKey/EncryptedMediaTest.Playback_VideoOnly_WebM_AV1_10bit/0 +-MSE_ExternalClearKey/EncryptedMediaTest.Playback_VideoOnly_WebM_AV1_10bit/0 +-MSE_ExternalClearKey/EncryptedMediaTest.Playback_VideoOnly_MP4_AV1_10bit/0 \ No newline at end of file
diff --git a/testing/buildbot/filters/lacros.browser_tests.filter b/testing/buildbot/filters/lacros.browser_tests.filter index b724e06a..db6d636 100644 --- a/testing/buildbot/filters/lacros.browser_tests.filter +++ b/testing/buildbot/filters/lacros.browser_tests.filter
@@ -1,218 +1,218 @@ -# TODO(crbug.com/1111979) Enable all tests on lacros. --AccessContextAuditBrowserTest.CheckSessionOnly --AccessContextAuditBrowserTest.PRE_RemoveRecords --AccessContextAuditBrowserTest.RemoveRecords --AdsPageLoadMetricsObserverBrowserTest.PageAdDensityIgnoreDisplayNoneFrame --AdsPageLoadMetricsObserverBrowserTest.PageAdDensityMultipleFrames --AdsPageLoadMetricsObserverBrowserTest.PageAdDensityRecordsPageMax --All/DownloadReferrerPolicyTest.SaveLinkAsReferrerPolicy* --All/HostedAppProcessModelTest.BackgroundPageWithAppCoveringDifferentSites/0 --All/HostedOrWebAppTest.CtrlClickLink/HostedApp --All/HostedOrWebAppTest.CtrlClickLink/WebApp --All/HostedOrWebAppTest.OpenLinkInNewTab* --All/IntentPickerBubbleViewBrowserTest.NavigationInAppWindowToInScopeLinkDoesNotShowIntentPicker* --All/MultiActionAPITest.PopupCreation/1 --All/MultiActionAPITest.SessionStorageDoesNotPersistBetweenOpenings/1 --All/PopupBrowserTest.MoveClampedToCurrentDisplay* --All/SystemWebAppLinkCaptureBrowserTest.IncognitoBrowserOmniboxLinkCapture* --All/SystemWebAppLinkCaptureBrowserTest.WindowOpenFromOtherSWA* --AppViewTest.KillGuestCommunicatingWithWrongAppView --AppViewTest.KillGuestWithInvalidInstanceID --AudioFocusWebContentsObserverBrowserTest.PlatformAppHasDifferentAudioFocus --AutofillProviderBrowserTest.FrameDetachedOnFormlessSubmission --AutofillProviderBrowserTestWithSkipFlagOn.InferredLabelChangeNotImpactFormComparing --AutomationApiTest.ForceLayout --AutomationManagerAuraBrowserTest.EventFromAction --AutoplayExtensionBrowserTest.AutoplayAllowedInIframe --BluetoothApiTest.* --BluetoothLowEnergyApiTest.* --BluetoothPrivateApiTest.* --BrowserActionApiTest.BrowserActionOpenPopupOnPopup --BrowserNavigatorTest.NavigateFromNoTabStripWindowToOptions --BrowserNavigatorTest.NavigateFromNTPToOptionsPageInSameTab --BrowserNavigatorTest.NavigateFromNTPToOptionsSingleton --BrowserNavigatorTest.SwitchToTabLatestWindow --BrowserTest.GetSizeForNewRenderView --BrowserTest.RestorePinnedTabs --BrowserViewTest.DevToolsUpdatesBrowserWindow --BrowserViewTest.F6CyclesThroughCaptionBubbleToo --BrowserViewTest.GetAccessibleTabModalDialogTitle --BrowserViewTest.GetAccessibleTabModalDialogTree --BrowsingDataRemoverBrowserTest.StorageRemovedFromDisk --CaptivePortalBrowserTest.SecureDnsErrorTriggersCheck --CaptivePortalBrowserTest.SlowLoadSecureDnsErrorAfterLogin --CaptivePortalBrowserTest.SlowLoadSecureDnsErrorWithCaptivePortal --ChromeSitePerProcessTest.PopupWindowFocus --ClientHintsBrowserTest.ClientHintsClearSession --ClipboardApiTest.Extension --ContentIndexTest.MetricsCollected --ContentSettingsTest.AllowCookiesForASessionUsingExceptions --ContentVerifierTest.PolicyCorrupted --ContextMenuBrowserTest.* --CrComponentsCertificateManagerV3Test.All --CrComponentsManagedFootnoteV3Test.All --CreativeOriginAdsPageLoadMetricsObserverBrowserTest.CreativeOriginStatusWithThrottlingNestedThrottled --CrSettingsAdvancedPageV3Test.Load --CrSettingsBasicPageV3Test.All --CrSettingsClearBrowsingDataV3Test.ClearBrowsingDataAllPlatforms --CrSettingsDownloadsPageV3Test.All --CrSettingsLanguagesPageV3Test.AddLanguagesDialog --CrSettingsLanguagesPageV3Test.LanguageMenu --CrSettingsLanguagesPageV3Test.Spellcheck --CrSettingsLanguagesV3Test.All --CrSettingsMainPageV3Test.MainPageV3 --CrSettingsRouteV3Test.DynamicParameters --CrSettingsRouteV3Test.NonExistentRoute --CrSettingsSiteDetailsV3Test.SiteDetails --CrSettingsSiteListEntryV3Test.All --CrSettingsSyncAccountControlV3Test.All --CustomTabBarViewBrowserTest.BackToAppButtonIsNotVisibleInOutOfScopePopups --CustomTabBarViewBrowserTest.IsNotCreatedInPopup --CustomTabBarViewBrowserTest.RightClickMenuShowsCopyUrl --DeclarativeContentApiTest.RulesPersistence --DeepScanningDialogDelegateBlockLargeFileTransferBrowserTest.Test/3 --DesktopCaptureApiTest.ChooseDesktopMedia --DiceManageAccountBrowserTest.ClearManagedProfileOnStartup --DownloadExtensionTest.DownloadExtensionTest_SearchEmptyQuery --DownloadTest.DownloadTest_History --DownloadWakeLockTest.WakeLockAcquireAndCancel --ExtensionLoadingTest.KeepAliveWithDevToolsOpenOnReload --ExtensionManagementApiBrowserTest.GetAllIncludesTerminated --ExtensionManagementApiEscalationTest.SetEnabled --ExtensionOverrideTest.SubframeNavigationInOverridenNTPDoesNotAffectFocus --ExtensionPreferenceApiTest.Standard --ExtensionsMenuViewBrowserTest.ClickingContextMenuButton --ExtensionWebRequestApiTest.WebSocketRequest --ExtensionWebRequestApiTest.WebSocketRequestAuthRequired --ExternalProtocolDialogBrowserTest.TestFocus --FeedbackTest.AnonymousUser --FeedbackTest.ExtraDiagnostics --FeedbackTest.ShowFeedback --FeedbackTest.ShowFeedbackFromAssistant --FeedbackTest.ShowLoginFeedback --FeedbackTest.SubmissionTest --FindInPageControllerTest.FindMovesOnTabClose_Issue1343052 --FindInPageControllerTest.FindMovesWhenObscuring --FolderUploadConfirmationViewTest.InitiallyFocusesCancel --GlobalErrorBubbleTest.InvokeUi_ExtensionDisabledGlobalError --GlobalErrorBubbleTest.InvokeUi_ExtensionDisabledGlobalErrorRemote --GlobalErrorBubbleTest.InvokeUi_ExternalInstallBubbleAlert --IconLoaderBrowserTest.LoadGroup --InlineLoginHelperBrowserTest.ForceSigninWithUserManager --KeepAliveDevToolsTest.KeepsAliveUntilBrowserClose --LiteVideoBrowserTest.SimplePlayback --LoadImageBrowserTest.LoadImageWithMap --LocalCardMigrationBrowserTestForNickname.CardIdentifierString/1 --MediaRouterUIBrowserTest.EphemeralToolbarIconForDialog --MediaRouterUIBrowserTest.OpenDialogFromAppMenu --MediaSessionPictureInPictureWindowControllerBrowserTest.PlayPauseButtonVisibility --MediaSessionPictureInPictureWindowControllerBrowserTest.PreviousTrackHandlerCalled --NotificationPermissionContextApiTest.Granted --NtpExtensionBubbleViewBrowserTest.InvokeUi_ntp_override --NtpExtensionBubbleViewBrowserTest.TestControlledNewTabPageMessageBubble --NtpExtensionBubbleViewBrowserTest.TestControlledNewTabPageMessageBubbleLearnMore --OmniboxPopupContentsViewTest.ClickOmnibox --OmniboxPopupContentsViewTest.PopupMatchesLocationBarBackground --OutOfProcessPPAPITest.FlashClipboard --OutOfProcessPPAPITest.NetAddress --OutOfProcessPPAPITest.Printing --OutOfProcessPPAPITest.URLRequest_CreateAndIsURLRequestInfo --PageInfoBubbleViewBrowserTest.FocusDoesNotReturnToContentsOnReloadPrompt --PageInfoBubbleViewBrowserTest.FocusReturnsToContentOnClose --PageLoadMetricsBrowserTest.MainFrameIntersectionsMainFrame --PaymentRequestCompletionStatusMetricsTest.UserAborted_TabClosed --PaymentRequestCreditCardEditorTest.EditingExpiredCard --PaymentRequestShippingAddressEditorTest.FocusFirstField_Name --PaymentRequestShippingAddressEditorTest.FocusFirstInvalidField_NotName --PDFExtensionJSTest.Bookmark/1 --PDFExtensionTestWithTestGuestViewManager* --PermissionRequestManagerWithBackForwardCacheBrowserTest.RequestsForPagesInCacheNotGrouped --PermissionsApiTest.AlwaysAllowed --PictureInPicturePixelComparisonBrowserTest.PlayAndPauseControls --PictureInPictureWindowControllerBrowserTest.* --PopupTrackerBrowserTest.PopupInWindow_IsWindowTrue --PopupTrackerBrowserTest.ShiftClick_HasTracker --PPAPINaClNewlibTest.TrueTypeFont --PPAPINaClPNaClNonSfiTest.TrueTypeFont --PresentationReceiverWindowControllerBrowserTest.CreatesWindow --PreservedWindowPlacement.Test --PrintPreviewDestinationSelectTest.ChangeIconDeprecationWarnings --PrintPreviewDestinationSelectTest.UpdateStatusDeprecationWarnings --PrintPreviewDestinationStoreTest.LoadAndSelectDestination --PrintPreviewModelSettingsAvailabilityTest.All --PrintPreviewModelTest.GetPrintTicket --PrintPreviewModelTest.SetStickySettings --PrintPreviewRestoreStateTest.SaveValues --ProfileHelperTest.OpenNewWindowForProfile --ProfileListDesktopBrowserTest.SwitchToProfile --ProfileManagerBrowserTest.EphemeralProfile --ProfileManagerBrowserTest.SwitchToProfile --RemoteCopyBrowserTest.ImageUrl --RemoteCopyBrowserTest.Text --RemoteCopyBrowserTest.TextThenImageUrl --RunInBackgroundTest.RunInBackgroundBasicTest --RuntimeAPIUpdateTest.TerminatedExtensionUpdateHasCorrectPreviousVersion --SafeBrowsingBlockingPageBrowserTestWithThreatTypeAndIsolationSetting/SafeBrowsingBlockingPageBrowserTest.IframeOptInAndReportThreatDetails/3 --SafeBrowsingBlockingPageWithDelayedWarningsBrowserTest/SafeBrowsingBlockingPageDelayedWarningBrowserTest.JavaScriptDialog_WarningShown/3 --SafeBrowsingNetworkContext/NetworkContextConfigurationBrowserTest.Cache/0 --SaveCardBubbleViewsFullFormBrowserTest.StrikeDatabase_Local_AddStrikeIfBubbleDeclined --SaveCardBubbleViewsFullFormBrowserTestForManageCard.Local_Metrics_AcceptingFootnotePromoManageCards --SaveCardBubbleViewsFullFormBrowserTestForStatusChip.ClickingOnCreditCardIconInStatusChipReshowsBubble --SaveCardBubbleViewsFullFormBrowserTestForStatusChip.CreditCardIconShownInStatusChip --SaveCardBubbleViewsFullFormBrowserTestForStatusChip.Feedback_Success --SaveCardBubbleViewsFullFormBrowserTestForStatusChip.Local_ClickingSaveShowsSigninPromo --SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream.StrikeDatabase_Upload_AddStrikeIfBubbleIgnored --SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream.Upload_SubmittingFormWithExpirationDateMonthAndCurrentYear --SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream.Upload_SubmittingFormWithMissingExpirationDateYearAndWithMonth --SaveCardBubbleViewsSyncTransportFullFormBrowserTest.Upload_TransportMode_RequestedCardholderNameTextfieldIsPrefilledWithFocusName --SearchByImageBrowserTest.ImageSearchWithCorruptImage --SearchByImageBrowserTest.ImageSearchWithValidImage --SecurityStateTabHelperTestWithFormsDangerous.MarkHttpAsWarningAndDangerousOnFormEdits --SerialTest.NavigateWithChooserCrossOrigin --ServiceWorkerAndExtensionsMenu/BrowserActionApiLazyTest.IncognitoBasic/0 --SessionCrashedBubbleViewTest.InvokeUi_SessionCrashedBubble --SessionRestoreTest.RestoredTabsHaveCorrectInitialSize --SettingsA11yAccessibilityV3.Accessibility_* --SettingsA11yBasicV3.Basic_* --SettingsA11yManageProfileV3.ManageProfile_* --SettingsA11yPasswordsV3.Passwords_* --SettingsA11ySignoutV3.Signout_* --SSLUITest.DisplayedContentWithCertErrorsClearedOnNavigation --SSLUITest.InAppTestHTTPSExpiredCertAndPreviouslyProceeded --StartupBrowserCreatorExtensionsCheckupExperimentTest.ExtensionsCheckup --StartupBrowserCreatorTest.RestoreWithNoStartupWindow --SubresourceRedirectBrowserTest.TestBypassOn503LoadShedFailure --TabActivityWatcherTest.AllWindowMetricsArePopulated --TabGroupEditorBubbleViewDialogBrowserTest.InvokeUi_default --TabHoverCardBubbleViewBrowserTest.WidgetNotVisibleOnMousePressAfterTabFocus --TabHoverCardBubbleViewBrowserTest.WidgetVisibleOnKeyPressAfterTabFocus --TabRestoreTest.RestoreWindowBounds --TabSearchBubbleBrowserTest.InvokeUi_default --TabStripDragManagerTest.All --TabStripUIBrowserTest.ActivatingTabClosesEmbedder --TranslateLanguageBrowserTest.LanguageModelLogSucceed --TranslateLanguageBrowserTest.TranslateAndRevert --TranslateLanguageBrowserTestWithTranslateRecentTarget.RecentTargetLanguage --TranslateManagerBrowserTest.PageTranslationTimeoutError --WebAppBrowserTest.CopyURL --WebAppBrowserTest.InScopePWAPopupsHaveCorrectSize --WebAppBrowserTest.OffScopePWAPopupsHaveCorrectSize --WebAppEngagementBrowserTest.CommandLineWindow --WebAppLinkCapturingBrowserTest.AboutBlankNavigationReparented --WebRtcDesktopCaptureBrowserTest.RunsScreenshareFromOneTabToAnother --WebRtcGetDisplayMediaBrowserTestWithPicker.GetDisplayMediaVideo --WebRtcGetDisplayMediaBrowserTestWithPicker.GetDisplayMediaVideoAndAudio --WebViewTest.SelectShowHide --WebViewTest.Shim_TestDisplayNoneWebviewRemoveChild --WelcomeA11y.WelcomeFlow_listitem --WorkerTaskProviderBrowserTest.CreateTasksForMultiProfiles - -# crbug.com/1121486 -# Following tests were flaky. We disable them first until we have time to investigate. --DevToolsExtensionTest.HttpIframeInDevToolsExtensionDevtools --DevToolsSanityTest.* --FindInPageControllerTest.SingleOccurrence --MediaRouterUIBrowserTest.PinAndUnpinToolbarIcon --MultiActionAPITest.PopupCreation/* --PDFExtensionClipboardTest.CombinedShiftArrowPresses --PopupTrackerBrowserTest.ControlClick_HasTracker +# TODO(crbug.com/1111979) Enable all tests on lacros. +-AccessContextAuditBrowserTest.CheckSessionOnly +-AccessContextAuditBrowserTest.PRE_RemoveRecords +-AccessContextAuditBrowserTest.RemoveRecords +-AdsPageLoadMetricsObserverBrowserTest.PageAdDensityIgnoreDisplayNoneFrame +-AdsPageLoadMetricsObserverBrowserTest.PageAdDensityMultipleFrames +-AdsPageLoadMetricsObserverBrowserTest.PageAdDensityRecordsPageMax +-All/DownloadReferrerPolicyTest.SaveLinkAsReferrerPolicy* +-All/HostedAppProcessModelTest.BackgroundPageWithAppCoveringDifferentSites/0 +-All/HostedOrWebAppTest.CtrlClickLink/HostedApp +-All/HostedOrWebAppTest.CtrlClickLink/WebApp +-All/HostedOrWebAppTest.OpenLinkInNewTab* +-All/IntentPickerBubbleViewBrowserTest.NavigationInAppWindowToInScopeLinkDoesNotShowIntentPicker* +-All/MultiActionAPITest.PopupCreation/1 +-All/MultiActionAPITest.SessionStorageDoesNotPersistBetweenOpenings/1 +-All/PopupBrowserTest.MoveClampedToCurrentDisplay* +-All/SystemWebAppLinkCaptureBrowserTest.IncognitoBrowserOmniboxLinkCapture* +-All/SystemWebAppLinkCaptureBrowserTest.WindowOpenFromOtherSWA* +-AppViewTest.KillGuestCommunicatingWithWrongAppView +-AppViewTest.KillGuestWithInvalidInstanceID +-AudioFocusWebContentsObserverBrowserTest.PlatformAppHasDifferentAudioFocus +-AutofillProviderBrowserTest.FrameDetachedOnFormlessSubmission +-AutofillProviderBrowserTestWithSkipFlagOn.InferredLabelChangeNotImpactFormComparing +-AutomationApiTest.ForceLayout +-AutomationManagerAuraBrowserTest.EventFromAction +-AutoplayExtensionBrowserTest.AutoplayAllowedInIframe +-BluetoothApiTest.* +-BluetoothLowEnergyApiTest.* +-BluetoothPrivateApiTest.* +-BrowserActionApiTest.BrowserActionOpenPopupOnPopup +-BrowserNavigatorTest.NavigateFromNoTabStripWindowToOptions +-BrowserNavigatorTest.NavigateFromNTPToOptionsPageInSameTab +-BrowserNavigatorTest.NavigateFromNTPToOptionsSingleton +-BrowserNavigatorTest.SwitchToTabLatestWindow +-BrowserTest.GetSizeForNewRenderView +-BrowserTest.RestorePinnedTabs +-BrowserViewTest.DevToolsUpdatesBrowserWindow +-BrowserViewTest.F6CyclesThroughCaptionBubbleToo +-BrowserViewTest.GetAccessibleTabModalDialogTitle +-BrowserViewTest.GetAccessibleTabModalDialogTree +-BrowsingDataRemoverBrowserTest.StorageRemovedFromDisk +-CaptivePortalBrowserTest.SecureDnsErrorTriggersCheck +-CaptivePortalBrowserTest.SlowLoadSecureDnsErrorAfterLogin +-CaptivePortalBrowserTest.SlowLoadSecureDnsErrorWithCaptivePortal +-ChromeSitePerProcessTest.PopupWindowFocus +-ClientHintsBrowserTest.ClientHintsClearSession +-ClipboardApiTest.Extension +-ContentIndexTest.MetricsCollected +-ContentSettingsTest.AllowCookiesForASessionUsingExceptions +-ContentVerifierTest.PolicyCorrupted +-ContextMenuBrowserTest.* +-CrComponentsCertificateManagerV3Test.All +-CrComponentsManagedFootnoteV3Test.All +-CreativeOriginAdsPageLoadMetricsObserverBrowserTest.CreativeOriginStatusWithThrottlingNestedThrottled +-CrSettingsAdvancedPageV3Test.Load +-CrSettingsBasicPageV3Test.All +-CrSettingsClearBrowsingDataV3Test.ClearBrowsingDataAllPlatforms +-CrSettingsDownloadsPageV3Test.All +-CrSettingsLanguagesPageV3Test.AddLanguagesDialog +-CrSettingsLanguagesPageV3Test.LanguageMenu +-CrSettingsLanguagesPageV3Test.Spellcheck +-CrSettingsLanguagesV3Test.All +-CrSettingsMainPageV3Test.MainPageV3 +-CrSettingsRouteV3Test.DynamicParameters +-CrSettingsRouteV3Test.NonExistentRoute +-CrSettingsSiteDetailsV3Test.SiteDetails +-CrSettingsSiteListEntryV3Test.All +-CrSettingsSyncAccountControlV3Test.All +-CustomTabBarViewBrowserTest.BackToAppButtonIsNotVisibleInOutOfScopePopups +-CustomTabBarViewBrowserTest.IsNotCreatedInPopup +-CustomTabBarViewBrowserTest.RightClickMenuShowsCopyUrl +-DeclarativeContentApiTest.RulesPersistence +-DeepScanningDialogDelegateBlockLargeFileTransferBrowserTest.Test/3 +-DesktopCaptureApiTest.ChooseDesktopMedia +-DiceManageAccountBrowserTest.ClearManagedProfileOnStartup +-DownloadExtensionTest.DownloadExtensionTest_SearchEmptyQuery +-DownloadTest.DownloadTest_History +-DownloadWakeLockTest.WakeLockAcquireAndCancel +-ExtensionLoadingTest.KeepAliveWithDevToolsOpenOnReload +-ExtensionManagementApiBrowserTest.GetAllIncludesTerminated +-ExtensionManagementApiEscalationTest.SetEnabled +-ExtensionOverrideTest.SubframeNavigationInOverridenNTPDoesNotAffectFocus +-ExtensionPreferenceApiTest.Standard +-ExtensionsMenuViewBrowserTest.ClickingContextMenuButton +-ExtensionWebRequestApiTest.WebSocketRequest +-ExtensionWebRequestApiTest.WebSocketRequestAuthRequired +-ExternalProtocolDialogBrowserTest.TestFocus +-FeedbackTest.AnonymousUser +-FeedbackTest.ExtraDiagnostics +-FeedbackTest.ShowFeedback +-FeedbackTest.ShowFeedbackFromAssistant +-FeedbackTest.ShowLoginFeedback +-FeedbackTest.SubmissionTest +-FindInPageControllerTest.FindMovesOnTabClose_Issue1343052 +-FindInPageControllerTest.FindMovesWhenObscuring +-FolderUploadConfirmationViewTest.InitiallyFocusesCancel +-GlobalErrorBubbleTest.InvokeUi_ExtensionDisabledGlobalError +-GlobalErrorBubbleTest.InvokeUi_ExtensionDisabledGlobalErrorRemote +-GlobalErrorBubbleTest.InvokeUi_ExternalInstallBubbleAlert +-IconLoaderBrowserTest.LoadGroup +-InlineLoginHelperBrowserTest.ForceSigninWithUserManager +-KeepAliveDevToolsTest.KeepsAliveUntilBrowserClose +-LiteVideoBrowserTest.SimplePlayback +-LoadImageBrowserTest.LoadImageWithMap +-LocalCardMigrationBrowserTestForNickname.CardIdentifierString/1 +-MediaRouterUIBrowserTest.EphemeralToolbarIconForDialog +-MediaRouterUIBrowserTest.OpenDialogFromAppMenu +-MediaSessionPictureInPictureWindowControllerBrowserTest.PlayPauseButtonVisibility +-MediaSessionPictureInPictureWindowControllerBrowserTest.PreviousTrackHandlerCalled +-NotificationPermissionContextApiTest.Granted +-NtpExtensionBubbleViewBrowserTest.InvokeUi_ntp_override +-NtpExtensionBubbleViewBrowserTest.TestControlledNewTabPageMessageBubble +-NtpExtensionBubbleViewBrowserTest.TestControlledNewTabPageMessageBubbleLearnMore +-OmniboxPopupContentsViewTest.ClickOmnibox +-OmniboxPopupContentsViewTest.PopupMatchesLocationBarBackground +-OutOfProcessPPAPITest.FlashClipboard +-OutOfProcessPPAPITest.NetAddress +-OutOfProcessPPAPITest.Printing +-OutOfProcessPPAPITest.URLRequest_CreateAndIsURLRequestInfo +-PageInfoBubbleViewBrowserTest.FocusDoesNotReturnToContentsOnReloadPrompt +-PageInfoBubbleViewBrowserTest.FocusReturnsToContentOnClose +-PageLoadMetricsBrowserTest.MainFrameIntersectionsMainFrame +-PaymentRequestCompletionStatusMetricsTest.UserAborted_TabClosed +-PaymentRequestCreditCardEditorTest.EditingExpiredCard +-PaymentRequestShippingAddressEditorTest.FocusFirstField_Name +-PaymentRequestShippingAddressEditorTest.FocusFirstInvalidField_NotName +-PDFExtensionJSTest.Bookmark/1 +-PDFExtensionTestWithTestGuestViewManager* +-PermissionRequestManagerWithBackForwardCacheBrowserTest.RequestsForPagesInCacheNotGrouped +-PermissionsApiTest.AlwaysAllowed +-PictureInPicturePixelComparisonBrowserTest.PlayAndPauseControls +-PictureInPictureWindowControllerBrowserTest.* +-PopupTrackerBrowserTest.PopupInWindow_IsWindowTrue +-PopupTrackerBrowserTest.ShiftClick_HasTracker +-PPAPINaClNewlibTest.TrueTypeFont +-PPAPINaClPNaClNonSfiTest.TrueTypeFont +-PresentationReceiverWindowControllerBrowserTest.CreatesWindow +-PreservedWindowPlacement.Test +-PrintPreviewDestinationSelectTest.ChangeIconDeprecationWarnings +-PrintPreviewDestinationSelectTest.UpdateStatusDeprecationWarnings +-PrintPreviewDestinationStoreTest.LoadAndSelectDestination +-PrintPreviewModelSettingsAvailabilityTest.All +-PrintPreviewModelTest.GetPrintTicket +-PrintPreviewModelTest.SetStickySettings +-PrintPreviewRestoreStateTest.SaveValues +-ProfileHelperTest.OpenNewWindowForProfile +-ProfileListDesktopBrowserTest.SwitchToProfile +-ProfileManagerBrowserTest.EphemeralProfile +-ProfileManagerBrowserTest.SwitchToProfile +-RemoteCopyBrowserTest.ImageUrl +-RemoteCopyBrowserTest.Text +-RemoteCopyBrowserTest.TextThenImageUrl +-RunInBackgroundTest.RunInBackgroundBasicTest +-RuntimeAPIUpdateTest.TerminatedExtensionUpdateHasCorrectPreviousVersion +-SafeBrowsingBlockingPageBrowserTestWithThreatTypeAndIsolationSetting/SafeBrowsingBlockingPageBrowserTest.IframeOptInAndReportThreatDetails/3 +-SafeBrowsingBlockingPageWithDelayedWarningsBrowserTest/SafeBrowsingBlockingPageDelayedWarningBrowserTest.JavaScriptDialog_WarningShown/3 +-SafeBrowsingNetworkContext/NetworkContextConfigurationBrowserTest.Cache/0 +-SaveCardBubbleViewsFullFormBrowserTest.StrikeDatabase_Local_AddStrikeIfBubbleDeclined +-SaveCardBubbleViewsFullFormBrowserTestForManageCard.Local_Metrics_AcceptingFootnotePromoManageCards +-SaveCardBubbleViewsFullFormBrowserTestForStatusChip.ClickingOnCreditCardIconInStatusChipReshowsBubble +-SaveCardBubbleViewsFullFormBrowserTestForStatusChip.CreditCardIconShownInStatusChip +-SaveCardBubbleViewsFullFormBrowserTestForStatusChip.Feedback_Success +-SaveCardBubbleViewsFullFormBrowserTestForStatusChip.Local_ClickingSaveShowsSigninPromo +-SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream.StrikeDatabase_Upload_AddStrikeIfBubbleIgnored +-SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream.Upload_SubmittingFormWithExpirationDateMonthAndCurrentYear +-SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream.Upload_SubmittingFormWithMissingExpirationDateYearAndWithMonth +-SaveCardBubbleViewsSyncTransportFullFormBrowserTest.Upload_TransportMode_RequestedCardholderNameTextfieldIsPrefilledWithFocusName +-SearchByImageBrowserTest.ImageSearchWithCorruptImage +-SearchByImageBrowserTest.ImageSearchWithValidImage +-SecurityStateTabHelperTestWithFormsDangerous.MarkHttpAsWarningAndDangerousOnFormEdits +-SerialTest.NavigateWithChooserCrossOrigin +-ServiceWorkerAndExtensionsMenu/BrowserActionApiLazyTest.IncognitoBasic/0 +-SessionCrashedBubbleViewTest.InvokeUi_SessionCrashedBubble +-SessionRestoreTest.RestoredTabsHaveCorrectInitialSize +-SettingsA11yAccessibilityV3.Accessibility_* +-SettingsA11yBasicV3.Basic_* +-SettingsA11yManageProfileV3.ManageProfile_* +-SettingsA11yPasswordsV3.Passwords_* +-SettingsA11ySignoutV3.Signout_* +-SSLUITest.DisplayedContentWithCertErrorsClearedOnNavigation +-SSLUITest.InAppTestHTTPSExpiredCertAndPreviouslyProceeded +-StartupBrowserCreatorExtensionsCheckupExperimentTest.ExtensionsCheckup +-StartupBrowserCreatorTest.RestoreWithNoStartupWindow +-SubresourceRedirectBrowserTest.TestBypassOn503LoadShedFailure +-TabActivityWatcherTest.AllWindowMetricsArePopulated +-TabGroupEditorBubbleViewDialogBrowserTest.InvokeUi_default +-TabHoverCardBubbleViewBrowserTest.WidgetNotVisibleOnMousePressAfterTabFocus +-TabHoverCardBubbleViewBrowserTest.WidgetVisibleOnKeyPressAfterTabFocus +-TabRestoreTest.RestoreWindowBounds +-TabSearchBubbleBrowserTest.InvokeUi_default +-TabStripDragManagerTest.All +-TabStripUIBrowserTest.ActivatingTabClosesEmbedder +-TranslateLanguageBrowserTest.LanguageModelLogSucceed +-TranslateLanguageBrowserTest.TranslateAndRevert +-TranslateLanguageBrowserTestWithTranslateRecentTarget.RecentTargetLanguage +-TranslateManagerBrowserTest.PageTranslationTimeoutError +-WebAppBrowserTest.CopyURL +-WebAppBrowserTest.InScopePWAPopupsHaveCorrectSize +-WebAppBrowserTest.OffScopePWAPopupsHaveCorrectSize +-WebAppEngagementBrowserTest.CommandLineWindow +-WebAppLinkCapturingBrowserTest.AboutBlankNavigationReparented +-WebRtcDesktopCaptureBrowserTest.RunsScreenshareFromOneTabToAnother +-WebRtcGetDisplayMediaBrowserTestWithPicker.GetDisplayMediaVideo +-WebRtcGetDisplayMediaBrowserTestWithPicker.GetDisplayMediaVideoAndAudio +-WebViewTest.SelectShowHide +-WebViewTest.Shim_TestDisplayNoneWebviewRemoveChild +-WelcomeA11y.WelcomeFlow_listitem +-WorkerTaskProviderBrowserTest.CreateTasksForMultiProfiles + +# crbug.com/1121486 +# Following tests were flaky. We disable them first until we have time to investigate. +-DevToolsExtensionTest.HttpIframeInDevToolsExtensionDevtools +-DevToolsSanityTest.* +-FindInPageControllerTest.SingleOccurrence +-MediaRouterUIBrowserTest.PinAndUnpinToolbarIcon +-MultiActionAPITest.PopupCreation/* +-PDFExtensionClipboardTest.CombinedShiftArrowPresses +-PopupTrackerBrowserTest.ControlClick_HasTracker
diff --git a/testing/buildbot/filters/lacros.content_browsertests.filter b/testing/buildbot/filters/lacros.content_browsertests.filter index bf84e3e4..81c99ff9 100644 --- a/testing/buildbot/filters/lacros.content_browsertests.filter +++ b/testing/buildbot/filters/lacros.content_browsertests.filter
@@ -1,6 +1,6 @@ - -# TODO(crbug.com/1111979) Enable all tests on lacros. --OutOfProcessPPAPITest.TrueTypeFont - -# Following tests are flaky. --All/WebContentsVideoCaptureDeviceBrowserTestP.CapturesContentChanges* + +# TODO(crbug.com/1111979) Enable all tests on lacros. +-OutOfProcessPPAPITest.TrueTypeFont + +# Following tests are flaky. +-All/WebContentsVideoCaptureDeviceBrowserTestP.CapturesContentChanges*
diff --git a/testing/buildbot/filters/lacros.interactive_ui_tests.filter b/testing/buildbot/filters/lacros.interactive_ui_tests.filter index 17a4192c..0e3b4a2 100644 --- a/testing/buildbot/filters/lacros.interactive_ui_tests.filter +++ b/testing/buildbot/filters/lacros.interactive_ui_tests.filter
@@ -1,56 +1,56 @@ -# TODO(crbug.com/1111979) Enable all tests on lacros. --AppWindowInteractiveTest.TestFullscreen --AppWindowTest* --BookmarkBarViewTest* --BrowserActionInteractiveTest.OpenPopupOnPopup --BrowserActionInteractiveTest.TestOpenPopup --BrowserActionInteractiveTest.TestOpenPopupIncognito --BrowserFocusTest.BackgroundBrowserDontStealFocus --ChromeVisibilityObserverInteractiveTest.VisibilityTest --ClipboardTest/PlatformClipboardTest.ReadAvailablePlatformSpecificFormatNamesTest --CrossSiteSubframe/DragAndDropBrowserTest* --DesktopWidgetTestInteractive* --DevToolsManagerDelegateTest* --ExtensionApiTest.WindowOpen --ExtensionApiTest.WindowOpenFocus --ExtensionPointerLockTest.ExtensionPointerLockAccessPass --GlobalCommandsApiTest.GlobalCommand --KeyboardLockInteractiveBrowserTest.ActiveWithSomeKeysLocked --KeyboardLockInteractiveBrowserTest.RequestedButNotActive --MenuControllerMnemonicTestMnemonicMatch.MnemonicMatch --MenuControllerMnemonicTestNoMatch.NoMatch --MenuControllerMnemonicTestTitleMatch.TitleMatch --MenuControllerUITest.TestMouseOverShownMenu --MenuItemViewTestBasic* --MenuItemViewTestInsert* --MenuItemViewTestRemove* --MenuModelAdapterTest.RebuildMenu --MenuViewDragAndDropForDropCancel.MenuViewCancelsForOwnDrag --MenuViewDragAndDropForDropStayOpen.MenuViewStaysOpenForNestedDrag --MenuViewDragAndDropTestNestedDrag.MenuViewDragAndDropNestedDrag --MenuViewDragAndDropTestTestInMenuDrag.TestInMenuDrag --NotificationsTest.TestShouldDisplayMultiFullscreen --OmniboxViewTest.Paste --OmniboxViewViewsTest.SelectionClipboard --PopupBlockerBrowserTest.ModalPopUnder --SameSiteSubframe* --SettingsUIV3InteractiveTest* --SitePerProcessInteractiveBrowserTest.ShowAndHideDatePopupInOOPIFMultipleTimes --SitePerProcessInteractiveBrowserTest.TabAndMouseFocusNavigation --StartupBrowserCreatorTest.LastUsedProfileActivated --TabDragging* --TabMetricsLoggerTest* --ToolbarActionViewInteractiveUITest* --WidgetCaptureTest.SystemModalWindowReleasesCapture --WidgetInputMethodInteractiveTest* - -# crbug.com/1121486 -# Following tests were flaky. We disable them first until we have time to investigate. --BrowserCommandControllerInteractiveTest.ShortcutsShouldTakeEffectInBrowserFullscreen --ExtensionApiTest.DisplayModeWindowIsInFullscreen --ExtensionCrashRecoveryTest.TwoExtensionsReloadIndependently --KeyboardLockInteractiveBrowserTest.SubsequentLockCallSupersedesPreviousCall --NewTabPageDoodleShareDialogFocusTest.All --PlatformNotificationServiceBrowserTest.TestShouldDisplayMultiFullscreen --PopupBlockerBrowserTest.BlockWebContentsCreationIncognito --NotificationsApiTest* +# TODO(crbug.com/1111979) Enable all tests on lacros. +-AppWindowInteractiveTest.TestFullscreen +-AppWindowTest* +-BookmarkBarViewTest* +-BrowserActionInteractiveTest.OpenPopupOnPopup +-BrowserActionInteractiveTest.TestOpenPopup +-BrowserActionInteractiveTest.TestOpenPopupIncognito +-BrowserFocusTest.BackgroundBrowserDontStealFocus +-ChromeVisibilityObserverInteractiveTest.VisibilityTest +-ClipboardTest/PlatformClipboardTest.ReadAvailablePlatformSpecificFormatNamesTest +-CrossSiteSubframe/DragAndDropBrowserTest* +-DesktopWidgetTestInteractive* +-DevToolsManagerDelegateTest* +-ExtensionApiTest.WindowOpen +-ExtensionApiTest.WindowOpenFocus +-ExtensionPointerLockTest.ExtensionPointerLockAccessPass +-GlobalCommandsApiTest.GlobalCommand +-KeyboardLockInteractiveBrowserTest.ActiveWithSomeKeysLocked +-KeyboardLockInteractiveBrowserTest.RequestedButNotActive +-MenuControllerMnemonicTestMnemonicMatch.MnemonicMatch +-MenuControllerMnemonicTestNoMatch.NoMatch +-MenuControllerMnemonicTestTitleMatch.TitleMatch +-MenuControllerUITest.TestMouseOverShownMenu +-MenuItemViewTestBasic* +-MenuItemViewTestInsert* +-MenuItemViewTestRemove* +-MenuModelAdapterTest.RebuildMenu +-MenuViewDragAndDropForDropCancel.MenuViewCancelsForOwnDrag +-MenuViewDragAndDropForDropStayOpen.MenuViewStaysOpenForNestedDrag +-MenuViewDragAndDropTestNestedDrag.MenuViewDragAndDropNestedDrag +-MenuViewDragAndDropTestTestInMenuDrag.TestInMenuDrag +-NotificationsTest.TestShouldDisplayMultiFullscreen +-OmniboxViewTest.Paste +-OmniboxViewViewsTest.SelectionClipboard +-PopupBlockerBrowserTest.ModalPopUnder +-SameSiteSubframe* +-SettingsUIV3InteractiveTest* +-SitePerProcessInteractiveBrowserTest.ShowAndHideDatePopupInOOPIFMultipleTimes +-SitePerProcessInteractiveBrowserTest.TabAndMouseFocusNavigation +-StartupBrowserCreatorTest.LastUsedProfileActivated +-TabDragging* +-TabMetricsLoggerTest* +-ToolbarActionViewInteractiveUITest* +-WidgetCaptureTest.SystemModalWindowReleasesCapture +-WidgetInputMethodInteractiveTest* + +# crbug.com/1121486 +# Following tests were flaky. We disable them first until we have time to investigate. +-BrowserCommandControllerInteractiveTest.ShortcutsShouldTakeEffectInBrowserFullscreen +-ExtensionApiTest.DisplayModeWindowIsInFullscreen +-ExtensionCrashRecoveryTest.TwoExtensionsReloadIndependently +-KeyboardLockInteractiveBrowserTest.SubsequentLockCallSupersedesPreviousCall +-NewTabPageDoodleShareDialogFocusTest.All +-PlatformNotificationServiceBrowserTest.TestShouldDisplayMultiFullscreen +-PopupBlockerBrowserTest.BlockWebContentsCreationIncognito +-NotificationsApiTest*
diff --git a/testing/buildbot/filters/lacros.unit_tests.filter b/testing/buildbot/filters/lacros.unit_tests.filter index 27dd462..2186395 100644 --- a/testing/buildbot/filters/lacros.unit_tests.filter +++ b/testing/buildbot/filters/lacros.unit_tests.filter
@@ -1,6 +1,6 @@ -# TODO(crbug.com/1111979) Enable all tests on lacros. --ChromeContentBrowserClientTest.UserAgentStringOrdering --NativeDesktopMediaListTest.* --PermissionMessageCombinationsUnittest.USBSerialBluetoothCoalescing --RelaunchNotificationControllerPlatformImplTest.SynchronousNotification --WindowSizerTest.* +# TODO(crbug.com/1111979) Enable all tests on lacros. +-ChromeContentBrowserClientTest.UserAgentStringOrdering +-NativeDesktopMediaListTest.* +-PermissionMessageCombinationsUnittest.USBSerialBluetoothCoalescing +-RelaunchNotificationControllerPlatformImplTest.SynchronousNotification +-WindowSizerTest.*
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index ef7b12a9..bb6db0b 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -6423,6 +6423,19 @@ }, }, + 'gpu_angle_ios_gtests': { + 'gpu_angle_end2end_gtests': { + 'variants': [ + 'SIM_IPHONE_X_14_0', + ], + }, + 'gpu_angle_white_box_gtests': { + 'variants': [ + 'SIM_IPHONE_X_14_0', + ], + }, + }, + # ios14-beta-sim runs sims only on 14.0+ since # ios13-beta-sim already runs 13.x and 12.4 'ios14_beta_simulator_tests': {
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index b2ecfb3..f782eb49 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -319,13 +319,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--impl-version=88', ], - 'identifier': 'Implementation Tests For 88.0.4324.79', + 'identifier': 'Implementation Tests For 88.0.4324.82', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M88', - 'revision': 'version:88.0.4324.79', + 'revision': 'version:88.0.4324.82', } ], }, @@ -342,13 +342,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--impl-version=87', ], - 'identifier': 'Implementation Tests For 87.0.4280.143', + 'identifier': 'Implementation Tests For 87.0.4280.145', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M87', - 'revision': 'version:87.0.4280.143', + 'revision': 'version:87.0.4280.145', } ], }, @@ -388,13 +388,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--client-version=88', ], - 'identifier': 'Client Tests For 88.0.4324.79', + 'identifier': 'Client Tests For 88.0.4324.82', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M88', - 'revision': 'version:88.0.4324.79', + 'revision': 'version:88.0.4324.82', } ], }, @@ -411,13 +411,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--client-version=87', ], - 'identifier': 'Client Tests For 87.0.4280.143', + 'identifier': 'Client Tests For 87.0.4280.145', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M87', - 'revision': 'version:87.0.4280.143', + 'revision': 'version:87.0.4280.145', } ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index c67ebef..ea4593be 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1318,6 +1318,22 @@ 'angle_unittests', ], }, + 'ios-angle-builder': {}, + 'ios-angle-intel': { + 'os_type': 'mac', + 'mixins': [ + 'mac_mini_intel_gpu_stable', + 'enable_resultdb', + 'isolate_profile_data', + 'mac_toolchain', + 'out_dir_arg', + 'xcode_12a7209', + 'xctest', + ], + 'test_suites': { + 'gtest_tests': 'gpu_angle_ios_gtests', + }, + }, 'linux-angle-builder': {}, 'linux-angle-chromium-builder': {}, 'linux-angle-chromium-intel': {
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 3f3555d..40cb89ea1 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -620,6 +620,21 @@ ] } ], + "ArcUseHighMemoryDalvikProfile": [ + { + "platforms": [ + "chromeos" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "ArcUseHighMemoryDalvikProfile" + ] + } + ] + } + ], "AssistAutocorrect": [ { "platforms": [ @@ -5022,6 +5037,7 @@ "OmniboxDisplayTitleForCurrentUrl", "OmniboxDynamicMaxAutocomplete", "OmniboxEntitySuggestionsReduceLatency", + "OmniboxHistoryQuickProviderAblateInMemoryURLIndexCacheFile", "OmniboxLocalZeroSuggestAgeThreshold", "OmniboxLocalZeroSuggestFrecencyRanking", "OmniboxMaxURLMatches", @@ -5061,6 +5077,7 @@ "enable_features": [ "OmniboxAdaptiveSuggestionsCount", "OmniboxCompactSuggestions", + "OmniboxHistoryQuickProviderAblateInMemoryURLIndexCacheFile", "OmniboxLocalZeroSuggestAgeThreshold", "OmniboxLocalZeroSuggestFrecencyRanking", "OmniboxMaxURLMatches",
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index ed8e453..dbb154e 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -3065,6 +3065,9 @@ kReadableStreamWithByteSource = 3743, kReadableStreamBYOBReader = 3744, kEmbedElementWithoutTypeSrcChanged = 3745, + kSamePartyCookieAttribute = 3746, + kSamePartyCookieExclusionOverruledSameSite = 3747, + kSamePartyCookieInclusionOverruledSameSite = 3748, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/bindings/idl_in_core.gni b/third_party/blink/renderer/bindings/idl_in_core.gni index a1049e5..c9200eb 100644 --- a/third_party/blink/renderer/bindings/idl_in_core.gni +++ b/third_party/blink/renderer/bindings/idl_in_core.gni
@@ -261,6 +261,7 @@ "//third_party/blink/renderer/core/frame/feature_policy_violation_report_body.idl", "//third_party/blink/renderer/core/frame/fragment_directive.idl", "//third_party/blink/renderer/core/frame/history.idl", + "//third_party/blink/renderer/core/frame/impression_params.idl", "//third_party/blink/renderer/core/frame/intervention_report_body.idl", "//third_party/blink/renderer/core/frame/is_input_pending_options.idl", "//third_party/blink/renderer/core/frame/location.idl",
diff --git a/third_party/blink/renderer/core/core_idl_files.gni b/third_party/blink/renderer/core/core_idl_files.gni index cf2e127..c9fa0f41 100644 --- a/third_party/blink/renderer/core/core_idl_files.gni +++ b/third_party/blink/renderer/core/core_idl_files.gni
@@ -697,6 +697,7 @@ "fetch/trust_token.idl", "fileapi/blob_property_bag.idl", "fileapi/file_property_bag.idl", + "frame/impression_params.idl", "frame/is_input_pending_options.idl", "frame/navigator_ua_brand_version.idl", "frame/reporting_observer_options.idl",
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 a49a490..58fd788 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3381,7 +3381,8 @@ return; } if (root_layer_exists) { - UpdateDeviceEmulationTransform(); + if (!device_emulation_transform_.IsIdentity()) + UpdateDeviceEmulationTransform(); } else { // When the document in an already-attached main frame is being replaced by // a navigation then DidChangeRootLayer(false) will be called. Since we are @@ -3459,13 +3460,18 @@ void WebViewImpl::UpdateDeviceEmulationTransform() { GetPage()->GetVisualViewport().SetNeedsPaintPropertyUpdate(); - if (MainFrameImpl()) { + if (auto* main_frame = MainFrameImpl()) { // When the device emulation transform is updated, to avoid incorrect // scales and fuzzy raster from the compositor, force all content to // pick ideal raster scales. // TODO(wjmaclean): This is only done on the main frame's widget currently, // it should update all local frames. - MainFrameImpl()->FrameWidgetImpl()->SetNeedsRecalculateRasterScales(); + main_frame->FrameWidgetImpl()->SetNeedsRecalculateRasterScales(); + + // Device emulation transform also affects the overriding visible rect + // which is used as the overflow rect of the main frame layout view. + if (auto* view = main_frame->GetFrameView()) + view->SetNeedsPaintPropertyUpdate(); } }
diff --git a/third_party/blink/renderer/core/frame/impression_params.idl b/third_party/blink/renderer/core/frame/impression_params.idl new file mode 100644 index 0000000..3e25e357 --- /dev/null +++ b/third_party/blink/renderer/core/frame/impression_params.idl
@@ -0,0 +1,11 @@ +// Copyright 2020 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. + +// An ImpressionParams object represents registration info for an impression for the Conversion Measurement API. These mirror the conversion measurement attributes exposed HTML anchor elements. See https://github.com/WICG/conversion-measurement-api/blob/master/README.md for more information. +dictionary ImpressionParams { + required DOMString impressionData; + required USVString conversionDestination; + USVString reportingOrigin; + unsigned long long impressionExpiry; +};
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index cb4b823..f1e2b20 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -46,6 +46,7 @@ #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/source_location.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_impression_params.h" #include "third_party/blink/renderer/bindings/core/v8/v8_scroll_to_options.h" #include "third_party/blink/renderer/bindings/core/v8/v8_void_function.h" #include "third_party/blink/renderer/bindings/core/v8/window_proxy.h" @@ -94,6 +95,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/viewport_data.h" #include "third_party/blink/renderer/core/frame/visual_viewport.h" +#include "third_party/blink/renderer/core/html/conversion_measurement_parsing.h" #include "third_party/blink/renderer/core/html/custom/custom_element_registry.h" #include "third_party/blink/renderer/core/html/forms/form_controller.h" #include "third_party/blink/renderer/core/html/html_frame_owner_element.h" @@ -607,25 +609,29 @@ } Document* LocalDOMWindow::InstallNewDocument(const DocumentInit& init) { - DCHECK_EQ(init.GetWindow(), this); + // Blink should never attempt to install a new Document to a LocalDOMWindow + // that's not attached to a LocalFrame. + DCHECK(GetFrame()); + // Either: + // - `this` should be a new LocalDOMWindow, that has never had a Document + // associated with it or + // - `this` is being reused, and the previous Document has been disassociated + // via `ClearForReuse()`. DCHECK(!document_); + DCHECK_EQ(init.GetWindow(), this); + document_ = init.CreateDocument(); document_->Initialize(); - if (!GetFrame()) - return document_; - GetScriptController().UpdateDocument(); document_->GetViewportData().UpdateViewportDescription(); - if (FrameScheduler* frame_scheduler = GetFrame()->GetFrameScheduler()) { - frame_scheduler->TraceUrlChange(document_->Url().GetString()); - frame_scheduler->SetCrossOriginToMainFrame( - GetFrame()->IsCrossOriginToMainFrame()); - } - if (GetFrame()->GetPage() && GetFrame()->View()) { - GetFrame()->GetPage()->GetChromeClient().InstallSupplements(*GetFrame()); - } + auto* frame_scheduler = GetFrame()->GetFrameScheduler(); + frame_scheduler->TraceUrlChange(document_->Url().GetString()); + frame_scheduler->SetCrossOriginToMainFrame( + GetFrame()->IsCrossOriginToMainFrame()); + + GetFrame()->GetPage()->GetChromeClient().InstallSupplements(*GetFrame()); return document_; } @@ -1912,6 +1918,24 @@ const AtomicString& target, const String& features, ExceptionState& exception_state) { + return open(isolate, url_string, target, features, + nullptr /* impression_params */, exception_state); +} + +DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, + const String& url_string, + const AtomicString& target, + const String& features, + const ImpressionParams* impression_params, + ExceptionState& exception_state) { + if (!RuntimeEnabledFeatures::ConversionMeasurementEnabled(this)) { + // The usage of `impression_params` is gated on a runtime enabled feature + // in the implementation rather than in the IDL definition, because the + // RuntimeEnabled extended attribute cannot be used with an operation + // overload. + impression_params = nullptr; + } + LocalDOMWindow* incumbent_window = IncumbentDOMWindow(isolate); LocalDOMWindow* entered_window = EnteredDOMWindow(isolate); @@ -1967,10 +1991,17 @@ frame_request.GetResourceRequest().SetReferrerPolicy( referrer.referrer_policy); - frame_request.GetResourceRequest().SetHasUserGesture( - LocalFrame::HasTransientUserActivation(GetFrame())); + bool has_user_gesture = LocalFrame::HasTransientUserActivation(GetFrame()); + frame_request.GetResourceRequest().SetHasUserGesture(has_user_gesture); GetFrame()->MaybeLogAdClickNavigation(); + if (has_user_gesture && impression_params) { + base::Optional<WebImpression> impression = + GetImpressionForParams(incumbent_window, impression_params); + if (impression) + frame_request.SetImpression(*impression); + } + FrameTree::FindResult result = GetFrame()->Tree().FindOrCreateFrameForNavigation( frame_request, target.IsEmpty() ? "_blank" : target);
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.h b/third_party/blink/renderer/core/frame/local_dom_window.h index e83e57a..4e028a6 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.h +++ b/third_party/blink/renderer/core/frame/local_dom_window.h
@@ -64,6 +64,7 @@ class FrameConsole; class History; class IdleRequestOptions; +class ImpressionParams; class MediaQueryList; class MessageEvent; class Modulator; @@ -347,6 +348,13 @@ const String& features, ExceptionState&); + DOMWindow* open(v8::Isolate*, + const String& url_string, + const AtomicString& target, + const String& features, + const ImpressionParams* impression_params, + ExceptionState&); + FrameConsole* GetFrameConsole() const; void PrintErrorMessage(const String&) const;
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc index 8c0c8ab..bc44c082 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -1993,6 +1993,9 @@ if (GetDocument()->IsPaintingPreview()) return false; + if (ShouldUsePrintingLayout()) + return false; + if (IsMainFrame()) return GetSettings()->GetMainFrameClipsContent(); // By default clip to viewport.
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 45e54ba0..104082f 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -3856,33 +3856,6 @@ SetNeedsLayout(); } -void LocalFrameView::ClipPaintRect(FloatRect* paint_rect) const { - // TODO(wangxianzhu): Support ChromeClient::VisibleContentRectForPainting() - // with CompositeAfterPaint. - DCHECK(!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()); - - // Paint the whole rect if ClipsContent is false, meaning that the whole - // document should be recorded. This occurs if: - // - A paint preview is being captured. - // - WebPreferences::record_whole_document is true. - if (!frame_->ClipsContent()) - return; - - // By default we consider the bounds of the FrameView to be what is considered - // visible for the Frame. - IntRect visible_rect = IntRect(IntPoint(), Size()); - // Non-main frames always clip to their FrameView bounds. Main frames can - // have this behaviour modified by devtools. - if (frame_->IsMainFrame()) { - // If devtools is overriding the viewport, then the FrameView's bounds are - // not what we should paint, instead we should paint inside the bounds - // specified by devtools. - GetPage()->GetChromeClient().OverrideVisibleRectForMainFrame(*frame_, - &visible_rect); - } - paint_rect->Intersect(visible_rect); -} - void LocalFrameView::DidChangeScrollOffset() { GetFrame().Client()->DidChangeScrollOffset(); if (GetFrame().IsMainFrame()) {
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 29dc0e61..7e5d326 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/third_party/blink/renderer/core/frame/local_frame_view.h
@@ -75,7 +75,6 @@ class ChromeClient; class CompositorAnimationTimeline; class DocumentLifecycle; -class FloatRect; class FloatSize; class FragmentAnchor; class Frame; @@ -502,11 +501,6 @@ void RemoveScrollbar(Scrollbar*); void AddScrollbar(Scrollbar*); - // Clips the provided rect to the visible content area. For this purpose, we - // also query the chrome client for any active overrides to the visible area - // (e.g. DevTool's viewport override). - void ClipPaintRect(FloatRect*) const; - // Indicates the root layer's scroll offset changed since the last frame void SetRootLayerDidScroll() { root_layer_did_scroll_ = true; }
diff --git a/third_party/blink/renderer/core/frame/settings.json5 b/third_party/blink/renderer/core/frame/settings.json5 index 29ea43a..936f088 100644 --- a/third_party/blink/renderer/core/frame/settings.json5 +++ b/third_party/blink/renderer/core/frame/settings.json5
@@ -251,7 +251,7 @@ { name: "threadedScrollingEnabled", initial: true, - invalidate: ["Style"], + invalidate: ["Style", "ViewportPaintProperties"], }, // Used in web tests for gesture tap highlights. Makes the highlights square
diff --git a/third_party/blink/renderer/core/frame/window.idl b/third_party/blink/renderer/core/frame/window.idl index 26fe778..f20359b 100644 --- a/third_party/blink/renderer/core/frame/window.idl +++ b/third_party/blink/renderer/core/frame/window.idl
@@ -63,7 +63,12 @@ [CrossOrigin, Custom=Setter] attribute Window opener; [Replaceable, CrossOrigin] readonly attribute Window? parent; [CheckSecurity=ReturnValue, Custom=Getter] readonly attribute Element? frameElement; - [CallWith=Isolate, RaisesException] Window? open(optional USVString url="", optional DOMString target = "_blank", optional [TreatNullAs=EmptyString] DOMString features = ""); + + // The usage of |impression_params| is gated on a runtime enabled feature + // in the implementation rather than in this definition, because the + // RuntimeEnabled extended attribute cannot be used with an operation + // overload. + [CallWith=Isolate, RaisesException] Window? open(optional USVString url="", optional DOMString target = "_blank", optional [TreatNullAs=EmptyString] DOMString features = "", optional ImpressionParams impression_params); // indexed properties // https://html.spec.whatwg.org/C/browsers.html#windowproxy-getownproperty
diff --git a/third_party/blink/renderer/core/html/build.gni b/third_party/blink/renderer/core/html/build.gni index fec4450..4c4b6b5 100644 --- a/third_party/blink/renderer/core/html/build.gni +++ b/third_party/blink/renderer/core/html/build.gni
@@ -33,6 +33,8 @@ "canvas/ukm_parameters.h", "collection_items_cache.h", "collection_type.h", + "conversion_measurement_parsing.cc", + "conversion_measurement_parsing.h", "cross_origin_attribute.cc", "cross_origin_attribute.h", "custom/ce_reactions_scope.cc",
diff --git a/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc b/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc new file mode 100644 index 0000000..f2a1eb8 --- /dev/null +++ b/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc
@@ -0,0 +1,148 @@ +// Copyright 2020 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 "third_party/blink/renderer/core/html/conversion_measurement_parsing.h" + +#include "base/time/time.h" +#include "third_party/blink/public/mojom/devtools/console_message.mojom-blink.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_impression_params.h" +#include "third_party/blink/renderer/core/execution_context/execution_context.h" +#include "third_party/blink/renderer/core/execution_context/security_context.h" +#include "third_party/blink/renderer/core/frame/frame.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" +#include "third_party/blink/renderer/core/html/html_anchor_element.h" +#include "third_party/blink/renderer/core/html_names.h" +#include "third_party/blink/renderer/core/inspector/console_message.h" +#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" +#include "third_party/blink/renderer/platform/runtime_enabled_features.h" +#include "third_party/blink/renderer/platform/weborigin/security_origin.h" + +namespace blink { + +namespace { + +base::Optional<WebImpression> GetImpression( + ExecutionContext* execution_context, + const String& impression_data_string, + const String& conversion_destination_string, + const base::Optional<String>& reporting_origin_string, + base::Optional<uint64_t> impression_expiry_milliseconds) { + if (!RuntimeEnabledFeatures::ConversionMeasurementEnabled(execution_context)) + return base::nullopt; + + if (!execution_context->IsFeatureEnabled( + mojom::blink::FeaturePolicyFeature::kConversionMeasurement)) { + String message = + "The 'conversion-measurement' feature policy must be enabled to " + "declare an impression."; + execution_context->AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>( + mojom::blink::ConsoleMessageSource::kOther, + mojom::blink::ConsoleMessageLevel::kError, message)); + return base::nullopt; + } + + // Conversion measurement is only allowed when both the frame and the main + // frame (if different) have a secure origin. + LocalFrame* frame = nullptr; + if (auto* window = DynamicTo<LocalDOMWindow>(execution_context)) { + frame = window->GetFrame(); + } else { + return base::nullopt; + } + + const Frame& main_frame = frame->Tree().Top(); + if (!main_frame.GetSecurityContext() + ->GetSecurityOrigin() + ->IsPotentiallyTrustworthy()) { + return base::nullopt; + } + + if (!frame->IsMainFrame() && !frame->GetSecurityContext() + ->GetSecurityOrigin() + ->IsPotentiallyTrustworthy()) { + return base::nullopt; + } + + scoped_refptr<const SecurityOrigin> conversion_destination = + SecurityOrigin::CreateFromString(conversion_destination_string); + if (!conversion_destination->IsPotentiallyTrustworthy()) + return base::nullopt; + + bool impression_data_is_valid = false; + uint64_t impression_data = + impression_data_string.HexToUInt64Strict(&impression_data_is_valid); + + // Provide a default of 0 if the impression data was not valid. + impression_data = impression_data_is_valid ? impression_data : 0UL; + + // Reporting origin is an optional attribute. Reporting origins must be + // secure. + base::Optional<WebSecurityOrigin> reporting_origin; + if (reporting_origin_string) { + reporting_origin = + SecurityOrigin::CreateFromString(*reporting_origin_string); + + if (!reporting_origin->IsPotentiallyTrustworthy()) + return base::nullopt; + } + + base::Optional<base::TimeDelta> expiry; + if (impression_expiry_milliseconds) + expiry = base::TimeDelta::FromMilliseconds(*impression_expiry_milliseconds); + + UseCounter::Count(execution_context, + mojom::blink::WebFeature::kConversionAPIAll); + UseCounter::Count(execution_context, + mojom::blink::WebFeature::kImpressionRegistration); + + return WebImpression{conversion_destination, reporting_origin, + impression_data, expiry}; +} + +} // namespace + +base::Optional<WebImpression> GetImpressionForAnchor( + HTMLAnchorElement* element) { + base::Optional<uint64_t> expiry; + if (element->hasAttribute(html_names::kImpressionexpiryAttr)) { + bool expiry_is_valid = false; + uint64_t expiry_milliseconds = + element->FastGetAttribute(html_names::kImpressionexpiryAttr) + .GetString() + .ToUInt64Strict(&expiry_is_valid); + if (expiry_is_valid) + expiry = expiry_milliseconds; + } + + DCHECK(element->hasAttribute(html_names::kConversiondestinationAttr)); + DCHECK(element->hasAttribute(html_names::kImpressiondataAttr)); + + return GetImpression( + element->GetExecutionContext(), + element->FastGetAttribute(html_names::kImpressiondataAttr).GetString(), + element->FastGetAttribute(html_names::kConversiondestinationAttr) + .GetString(), + element->hasAttribute(html_names::kReportingoriginAttr) + ? base::make_optional( + element->FastGetAttribute(html_names::kReportingoriginAttr) + .GetString()) + : base::nullopt, + expiry); +} + +base::Optional<WebImpression> GetImpressionForParams( + ExecutionContext* execution_context, + const ImpressionParams* params) { + return GetImpression(execution_context, params->impressionData(), + params->conversionDestination(), + params->hasReportingOrigin() + ? base::make_optional(params->reportingOrigin()) + : base::nullopt, + params->hasImpressionExpiry() + ? base::make_optional(params->impressionExpiry()) + : base::nullopt); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/html/conversion_measurement_parsing.h b/third_party/blink/renderer/core/html/conversion_measurement_parsing.h new file mode 100644 index 0000000..82e4c04 --- /dev/null +++ b/third_party/blink/renderer/core/html/conversion_measurement_parsing.h
@@ -0,0 +1,35 @@ +// Copyright 2020 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 THIRD_PARTY_BLINK_RENDERER_CORE_HTML_CONVERSION_MEASUREMENT_PARSING_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_CONVERSION_MEASUREMENT_PARSING_H_ + +#include <stdint.h> +#include <memory> + +#include "base/optional.h" +#include "third_party/blink/public/platform/web_impression.h" +#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + +namespace blink { + +class ExecutionContext; +class HTMLAnchorElement; +class ImpressionParams; + +// Returns the WebImpression struct with all data declared by impression +// related attributes on |element|. If the impression attributes do not contain +// allowed values, base::nullopt is returned. +base::Optional<WebImpression> GetImpressionForAnchor( + HTMLAnchorElement* element); + +// Same as GetImpressionForAnchor(), but gets an impression specified by an +// ImpressionParams dictionary associated with a window.open call. +base::Optional<WebImpression> GetImpressionForParams( + ExecutionContext* execution_context, + const ImpressionParams* params); + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_HTML_CONVERSION_MEASUREMENT_PARSING_H_
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc index 5e1bcf7..5e1eea1 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.cc +++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
@@ -42,6 +42,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/html/anchor_element_metrics.h" #include "third_party/blink/renderer/core/html/anchor_element_metrics_sender.h" +#include "third_party/blink/renderer/core/html/conversion_measurement_parsing.h" #include "third_party/blink/renderer/core/html/html_image_element.h" #include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h" #include "third_party/blink/renderer/core/html_names.h" @@ -358,90 +359,6 @@ hasAttribute(html_names::kConversiondestinationAttr); } -base::Optional<WebImpression> HTMLAnchorElement::GetImpressionForNavigation() - const { - DCHECK(HasImpression()); - - if (!RuntimeEnabledFeatures::ConversionMeasurementEnabled( - GetExecutionContext())) - return base::nullopt; - - if (!GetExecutionContext()->IsFeatureEnabled( - mojom::blink::FeaturePolicyFeature::kConversionMeasurement)) { - String message = - "The 'conversion-measurement' feature policy must be enabled to " - "declare an impression."; - GetExecutionContext()->AddConsoleMessage( - MakeGarbageCollected<ConsoleMessage>( - mojom::blink::ConsoleMessageSource::kOther, - mojom::blink::ConsoleMessageLevel::kError, message)); - return base::nullopt; - } - - // Conversion measurement is only allowed when both the frame and the main - // frame (if different) have a secure origin. - LocalFrame* frame = GetDocument().GetFrame(); - const Frame& main_frame = frame->Tree().Top(); - if (!main_frame.GetSecurityContext() - ->GetSecurityOrigin() - ->IsPotentiallyTrustworthy()) { - return base::nullopt; - } - if (!frame->IsMainFrame() && !frame->GetSecurityContext() - ->GetSecurityOrigin() - ->IsPotentiallyTrustworthy()) { - return base::nullopt; - } - - const AtomicString& conversion_destination_string = - FastGetAttribute(html_names::kConversiondestinationAttr); - scoped_refptr<const SecurityOrigin> conversion_destination = - SecurityOrigin::CreateFromString(conversion_destination_string); - if (!conversion_destination->IsPotentiallyTrustworthy()) - return base::nullopt; - - bool impression_data_is_valid = false; - uint64_t impression_data = FastGetAttribute(html_names::kImpressiondataAttr) - .GetString() - .HexToUInt64Strict(&impression_data_is_valid); - - // Provide a default of 0 if the impression data was not valid. - impression_data = impression_data_is_valid ? impression_data : 0UL; - - // Reporting origin is an optional attribute. Reporting origins must be - // secure. - base::Optional<WebSecurityOrigin> reporting_origin; - if (hasAttribute(html_names::kReportingoriginAttr)) { - const AtomicString& reporting_origin_string = - FastGetAttribute(html_names::kReportingoriginAttr); - reporting_origin = - SecurityOrigin::CreateFromString(reporting_origin_string); - - if (!reporting_origin->IsPotentiallyTrustworthy()) - return base::nullopt; - } - - // Impression expiry is an optional attribute. - base::Optional<base::TimeDelta> expiry; - if (hasAttribute(html_names::kImpressionexpiryAttr)) { - bool expiry_is_valid = false; - uint64_t expiry_milliseconds = - FastGetAttribute(html_names::kImpressionexpiryAttr) - .GetString() - .ToUInt64Strict(&expiry_is_valid); - if (expiry_is_valid) - expiry = base::TimeDelta::FromMilliseconds(expiry_milliseconds); - } - - UseCounter::Count(GetExecutionContext(), - mojom::blink::WebFeature::kConversionAPIAll); - UseCounter::Count(GetExecutionContext(), - mojom::blink::WebFeature::kImpressionRegistration); - - return WebImpression{conversion_destination, reporting_origin, - impression_data, expiry}; -} - void HTMLAnchorElement::SendPings(const KURL& destination_url) const { const AtomicString& ping_value = FastGetAttribute(html_names::kPingAttr); if (ping_value.IsNull() || !GetDocument().GetSettings() || @@ -563,7 +480,7 @@ // FindOrCreateFrameForNavigation() call, as that call may result in // performing a navigation if the call results in creating a new window with // noopener set. - base::Optional<WebImpression> impression = GetImpressionForNavigation(); + base::Optional<WebImpression> impression = GetImpressionForAnchor(this); if (impression) frame_request.SetImpression(*impression); }
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.h b/third_party/blink/renderer/core/html/html_anchor_element.h index e1478ded..249ff4e 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.h +++ b/third_party/blink/renderer/core/html/html_anchor_element.h
@@ -101,11 +101,6 @@ // determined by looking at the presence of required attributes. bool HasImpression() const; - // Returns the WebImpression struct with all data declared by impression - // related attributes on |this|. If the impression attributes do not contain - // allowed values, base::nullopt is returned. - base::Optional<WebImpression> GetImpressionForNavigation() const; - void SendPings(const KURL& destination_url) const; void Trace(Visitor*) const override;
diff --git a/third_party/blink/renderer/core/html/resources/forced_colors.css b/third_party/blink/renderer/core/html/resources/forced_colors.css index d59c129..61102aa 100644 --- a/third_party/blink/renderer/core/html/resources/forced_colors.css +++ b/third_party/blink/renderer/core/html/resources/forced_colors.css
@@ -157,7 +157,7 @@ select:-internal-list-box:disabled option:hover { background-color: Canvas !important; -internal-forced-background-color: Canvas !important; - -internal-forced-color: GrayText !important; + color: GrayText !important; } /* option selected */
diff --git a/third_party/blink/renderer/core/layout/layout_view.cc b/third_party/blink/renderer/core/layout/layout_view.cc index 9953bfc..c536f43 100644 --- a/third_party/blink/renderer/core/layout/layout_view.cc +++ b/third_party/blink/renderer/core/layout/layout_view.cc
@@ -628,8 +628,15 @@ NOT_DESTROYED(); if (ShouldUsePrintingLayout()) return PhysicalRect(PhysicalOffset(), Size()); - if (frame_view_) - return PhysicalRect(PhysicalOffset(), PhysicalSize(frame_view_->Size())); + if (frame_view_) { + IntRect view_rect(IntPoint(), frame_view_->Size()); + auto& frame = frame_view_->GetFrame(); + if (frame.IsMainFrame()) { + frame.GetChromeClient().OverrideVisibleRectForMainFrame(frame, + &view_rect); + } + return PhysicalRect(view_rect); + } return PhysicalRect(); } @@ -643,7 +650,7 @@ overlay_scrollbar_clip_behavior); } - rect.offset = location; + rect.offset += location; if (IsScrollContainer()) ExcludeScrollbars(rect, overlay_scrollbar_clip_behavior);
diff --git a/third_party/blink/renderer/core/loader/frame_loader.cc b/third_party/blink/renderer/core/loader/frame_loader.cc index a5cc196..98aff1672 100644 --- a/third_party/blink/renderer/core/loader/frame_loader.cc +++ b/third_party/blink/renderer/core/loader/frame_loader.cc
@@ -1140,6 +1140,9 @@ bool FrameLoader::DetachDocument( SecurityOrigin* committing_origin, base::Optional<Document::UnloadEventTiming>* timing) { + DCHECK(frame_->GetDocument()); + DCHECK(document_loader_); + PluginScriptForbiddenScope forbid_plugin_destructor_scripting; ClientNavigationState* client_navigation = client_navigation_.get(); @@ -1157,8 +1160,7 @@ // both when unloading itself and when unloading its descendants. IgnoreOpensDuringUnloadCountIncrementer ignore_opens_during_unload( frame_->GetDocument()); - if (document_loader_) - DispatchUnloadEvent(committing_origin, timing); + DispatchUnloadEvent(committing_origin, timing); frame_->DetachChildren(); // The previous calls to dispatchUnloadEvent() and detachChildren() can // execute arbitrary script via things like unload events. If the executed @@ -1168,14 +1170,13 @@ return false; // FrameNavigationDisabler should prevent another load from starting. DCHECK_EQ(client_navigation_.get(), client_navigation); - // detachFromFrame() will abort XHRs that haven't completed, which can trigger - // event listeners for 'abort'. These event listeners might call + // Detaching the document loader will abort XHRs that haven't completed, which + // can trigger event listeners for 'abort'. These event listeners might call // window.stop(), which will in turn detach the provisional document loader. // At this point, the provisional document loader should not detach, because // then the FrameLoader would not have any attached DocumentLoaders. This is // guaranteed by FrameNavigationDisabler above. - if (document_loader_) - DetachDocumentLoader(document_loader_, true); + DetachDocumentLoader(document_loader_, true); // 'abort' listeners can also detach the frame. if (!frame_->Client()) return false; @@ -1185,8 +1186,7 @@ // No more events will be dispatched so detach the Document. // TODO(yoav): Should we also be nullifying domWindow's document (or // domWindow) since the doc is now detached? - if (frame_->GetDocument()) - frame_->GetDocument()->Shutdown(); + frame_->GetDocument()->Shutdown(); document_loader_ = nullptr; return true;
diff --git a/third_party/blink/renderer/core/page/context_menu_controller.cc b/third_party/blink/renderer/core/page/context_menu_controller.cc index 518ba80c..1d738187 100644 --- a/third_party/blink/renderer/core/page/context_menu_controller.cc +++ b/third_party/blink/renderer/core/page/context_menu_controller.cc
@@ -55,6 +55,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" +#include "third_party/blink/renderer/core/html/conversion_measurement_parsing.h" #include "third_party/blink/renderer/core/html/forms/html_form_element.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" #include "third_party/blink/renderer/core/html/html_anchor_element.h" @@ -490,7 +491,7 @@ data.link_text = anchor->innerText(); if (anchor->HasImpression()) - data.impression = anchor->GetImpressionForNavigation(); + data.impression = GetImpressionForAnchor(anchor); } data.input_field_type = ComputeInputFieldType(result);
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc index 80004fd..f8ae475 100644 --- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc +++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
@@ -1601,38 +1601,26 @@ while (root_view->GetFrame()->OwnerLayoutObject()) root_view = root_view->GetFrame()->OwnerLayoutObject()->View(); - auto root_view_contents_state = - root_view->FirstFragment().ContentsProperties(); - auto root_view_border_box_state = - root_view->FirstFragment().LocalBorderBoxProperties(); + auto root_view_state = root_view->FirstFragment().LocalBorderBoxProperties(); // 1. Move into local transform space. mapping_rect.MoveBy(FloatPoint(graphics_layer->GetOffsetFromTransformNode())); - // 2. Map into contents space of the root LayoutView. - GeometryMapper::LocalToAncestorVisualRect( - source_state, root_view_contents_state, mapping_rect); + // 2. Map into visible space of the root LayoutView. + GeometryMapper::LocalToAncestorVisualRect(source_state, root_view_state, + mapping_rect); FloatRect visible_content_rect(EnclosingIntRect(mapping_rect.Rect())); - // 3. Move into local border box transform space of the root LayoutView. - // Note that the overflow clip has *not* been applied. - GeometryMapper::SourceToDestinationRect( - root_view_contents_state.Transform(), - root_view_border_box_state.Transform(), visible_content_rect); - - // 4. Apply overflow clip, or adjusted version if necessary. - root_view->GetFrameView()->ClipPaintRect(&visible_content_rect); - FloatRect local_interest_rect; // If the visible content rect is empty, then it makes no sense to map it back // since there is nothing to map. if (!visible_content_rect.IsEmpty()) { local_interest_rect = visible_content_rect; - // 5. Map the visible content rect from root view space to local graphics + // 3. Map the visible content rect from root view space to local graphics // layer space. - GeometryMapper::SourceToDestinationRect( - root_view_border_box_state.Transform(), source_state.Transform(), - local_interest_rect); + GeometryMapper::SourceToDestinationRect(root_view_state.Transform(), + source_state.Transform(), + local_interest_rect); local_interest_rect.MoveBy( -FloatPoint(graphics_layer->GetOffsetFromTransformNode()));
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc index 979f565..2d5ce78 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.cc +++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -1124,7 +1124,11 @@ PhysicalRect mapping_rect = LocalBoundingBoxForCompositingOverlapTest(); GetLayoutObject().MapToVisualRectInAncestorSpace( GetLayoutObject().View(), mapping_rect, kUseGeometryMapper); - return EnclosingIntRect(mapping_rect); + // We use PixelSnappedIntRect here to match the behavior in + // CIU:: UpdateAncestorDependentCompositingInputs, even though the code + // in UnclippedAbsoluteBoundingBox and its equivalent in + // CIU::UpdateAncestorDependentCompositingInputs uses EnclosingIntRect. + return PixelSnappedIntRect(mapping_rect); } else { return GetAncestorDependentCompositingInputs() .clipped_absolute_bounding_box;
diff --git a/third_party/blink/renderer/core/paint/paint_layer_painter.cc b/third_party/blink/renderer/core/paint/paint_layer_painter.cc index 51438ea..07b11da 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_painter.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_painter.cc
@@ -159,8 +159,24 @@ return false; } +static bool IsUnclippedLayoutView(const PaintLayer& layer) { + // If MainFrameClipsContent is false which means that WebPreferences:: + // record_whole_document is true, we should not cull the scrolling contents + // of the main frame. + if (IsA<LayoutView>(layer.GetLayoutObject())) { + const auto* frame = layer.GetLayoutObject().GetFrame(); + if (frame && frame->IsMainFrame() && !frame->ClipsContent()) + return true; + } + return false; +} + static bool ShouldUseInfiniteCullRect(const PaintLayer& layer, PaintLayerPaintingInfo& painting_info) { + bool is_printing = layer.GetLayoutObject().GetDocument().Printing(); + if (IsUnclippedLayoutView(layer) && !is_printing) + return true; + // Cull rects and clips can't be propagated across a filter which moves // pixels, since the input of the filter may be outside the cull rect / // clips yet still result in painted output. @@ -172,7 +188,7 @@ // TODO(crbug.com/1098995): For now we don't adjust cull rect for clips. // When we do, we need to check if we are painting under a real clip. // This won't be a problem when we use block fragments for printing. - !layer.GetLayoutObject().GetDocument().Printing()) + !is_printing) return true; // Cull rect mapping doesn't work under perspective in some cases. @@ -189,41 +205,24 @@ if (layer.PaintsWithTransform(painting_info.GetGlobalPaintFlags()) && // The reasons don't apply for printing though, because when we enter and // leaving printing mode, full invalidations occur. - !layer.GetLayoutObject().GetDocument().Printing()) + !is_printing) return true; return false; } -static bool IsUnclippedLayoutView(const PaintLayer& layer) { - // If MainFrameClipsContent is false which means that WebPreferences:: - // record_whole_document is true, we should not cull the scrolling contents - // of the main frame. - if (IsA<LayoutView>(layer.GetLayoutObject())) { - const auto* frame = layer.GetLayoutObject().GetFrame(); - if (frame && frame->IsMainFrame() && !frame->ClipsContent()) - return true; - // True regardless whether this is the main frame when painting a preview. - if (frame && frame->GetDocument()->IsPaintingPreview()) - return true; - } - return false; -} - void PaintLayerPainter::AdjustForPaintProperties( const GraphicsContext& context, PaintLayerPaintingInfo& painting_info, PaintLayerFlags& paint_flags) { const auto& first_fragment = paint_layer_.GetLayoutObject().FirstFragment(); - bool is_unclipped_layout_view = IsUnclippedLayoutView(paint_layer_); bool should_use_infinite_cull_rect = - is_unclipped_layout_view || ShouldUseInfiniteCullRect(paint_layer_, painting_info); if (should_use_infinite_cull_rect) { painting_info.cull_rect = CullRect::Infinite(); // Avoid clipping during CollectFragments. - if (is_unclipped_layout_view) + if (IsUnclippedLayoutView(paint_layer_)) paint_flags |= kPaintLayerPaintingOverflowContents; } @@ -410,8 +409,10 @@ subsequence_recorder.emplace(context, paint_layer_); } - PhysicalOffset offset_from_root; - paint_layer_.ConvertToLayerCoords(painting_info.root_layer, offset_from_root); + PhysicalOffset offset_from_root = + paint_layer_.GetLayoutObject().FirstFragment().PaintOffset(); + if (const PaintLayer* root = painting_info.root_layer) + offset_from_root -= root->GetLayoutObject().FirstFragment().PaintOffset(); offset_from_root += subpixel_accumulation; PhysicalRect bounds = paint_layer_.PhysicalBoundingBox(offset_from_root);
diff --git a/third_party/blink/renderer/core/paint/paint_layer_test.cc b/third_party/blink/renderer/core/paint/paint_layer_test.cc index 6d0eb2a..8fa57a9 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_test.cc
@@ -2968,7 +2968,13 @@ EXPECT_EQ(fixed->LocalBoundingBoxForCompositingOverlapTest(), PhysicalRect(0, 0, 50, 50)); EXPECT_EQ(fixed->UnclippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66)); - EXPECT_EQ(fixed->ClippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66)); + // These values differ because CompositingOptimizationsEnabled takes into + // account transforms (the one one the .xform element), whereas + // CompositingOptimizationsDisabled (incorrectly) does not. + if (!RuntimeEnabledFeatures::CompositingOptimizationsEnabled()) + EXPECT_EQ(fixed->ClippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66)); + else + EXPECT_EQ(fixed->ClippedAbsoluteBoundingBox(), IntRect(118, 118, 64, 64)); } TEST_P(PaintLayerOverlapTest, NestedFixedUsesExpandedBoundingBoxForOverlap) {
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc index 2227b7db..87c0843 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -1547,29 +1547,6 @@ } } -// Returns true if we are printing which was initiated by the frame. We should -// ignore clipping and scroll transform on contents. WebLocalFrameImpl will -// issue artificial page clip for each page, and always print from the origin -// of the contents for which no scroll offset should be applied. -static bool IsPrintingRootLayoutView(const LayoutObject& object) { - if (!IsA<LayoutView>(object)) - return false; - - const auto& frame = *object.GetFrame(); - if (!frame.GetDocument()->Printing()) - return false; - - const auto* parent_frame = frame.Tree().Parent(); - // TODO(crbug.com/455764): The local frame may be not the root frame of - // printing when it's printing under a remote frame. - auto* parent_local_frame = DynamicTo<LocalFrame>(parent_frame); - if (!parent_local_frame) - return true; - - // If the parent frame is printing, this frame should clip normally. - return !parent_local_frame->GetDocument()->Printing(); -} - // TODO(wangxianzhu): Combine the logic by overriding LayoutBox:: // ComputeOverflowClipAxes() in LayoutReplaced and subclasses and remove // this function. @@ -1604,9 +1581,16 @@ SVGLayoutSupport::IsOverflowHidden(object)) return true; - return object.IsBox() && - To<LayoutBox>(object).ShouldClipOverflowAlongEitherAxis() && - !IsPrintingRootLayoutView(object); + if (!object.IsBox()) + return false; + + if (!To<LayoutBox>(object).ShouldClipOverflowAlongEitherAxis()) + return false; + + if (IsA<LayoutView>(object) && !object.GetFrame()->ClipsContent()) + return false; + + return true; } void FragmentPaintPropertyTreeBuilder::UpdateLocalBorderBoxContext() { @@ -1735,10 +1719,6 @@ static bool CanOmitOverflowClip(const LayoutObject& object) { DCHECK(NeedsOverflowClip(object)); - if (IsA<LayoutView>(object) && !object.GetFrame()->ClipsContent()) { - return true; - } - // Some non-block boxes and SVG objects have special overflow rules. const auto* block = DynamicTo<LayoutBlock>(object); if (!block || object.IsSVG()) @@ -1767,14 +1747,15 @@ if (block->HasLayer() && block->Layer()->FirstChild()) return false; - // TODO(wangxianzhu): It's incorrect to test the physical clip_rect against - // the flipped ContentsVisualOverflowRect and LayoutOverflowRect. - if (!clip_rect.ToLayoutRect().Contains(block->ContentsVisualOverflowRect())) + if (!clip_rect.Contains(block->PhysicalContentsVisualOverflowRect())) return false; // Content can scroll, and needs to be clipped, if the layout overflow extends // beyond the clip rect. - return clip_rect.ToLayoutRect().Contains(block->LayoutOverflowRect()); + if (!clip_rect.Contains(block->PhysicalLayoutOverflowRect())) + return false; + + return true; } void FragmentPaintPropertyTreeBuilder::UpdateOverflowClip() {
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc index 3b8a918..a6404fa9 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc
@@ -178,22 +178,22 @@ void GPUQueue::writeBuffer(GPUBuffer* buffer, uint64_t buffer_offset, const MaybeShared<DOMArrayBufferView>& data, - uint64_t data_byte_offset, + uint64_t data_element_offset, ExceptionState& exception_state) { WriteBufferImpl(buffer, buffer_offset, data->byteLength(), data->BaseAddressMaybeShared(), data->TypeSize(), - data_byte_offset, {}, exception_state); + data_element_offset, {}, exception_state); } void GPUQueue::writeBuffer(GPUBuffer* buffer, uint64_t buffer_offset, const MaybeShared<DOMArrayBufferView>& data, - uint64_t data_byte_offset, - uint64_t byte_size, + uint64_t data_element_offset, + uint64_t data_element_count, ExceptionState& exception_state) { WriteBufferImpl(buffer, buffer_offset, data->byteLength(), data->BaseAddressMaybeShared(), data->TypeSize(), - data_byte_offset, byte_size, exception_state); + data_element_offset, data_element_count, exception_state); } void GPUQueue::writeBuffer(GPUBuffer* buffer, @@ -222,41 +222,40 @@ uint64_t data_byte_length, const void* data_base_ptr, unsigned data_bytes_per_element, - uint64_t data_byte_offset, - base::Optional<uint64_t> byte_size, + uint64_t data_element_offset, + base::Optional<uint64_t> data_element_count, ExceptionState& exception_state) { if (buffer_offset % 4 != 0) { exception_state.ThrowDOMException(DOMExceptionCode::kOperationError, - "bufferOffset must be a multiple of 4"); + "Buffer offset must be a multiple of 4"); return; } - if (data_byte_offset % data_bytes_per_element != 0) { - exception_state.ThrowDOMException( - DOMExceptionCode::kOperationError, - "dataByteOffset must be a multiple of data.BYTES_PER_ELEMENT"); - return; - } + CHECK_LE(data_bytes_per_element, 8u); - if (data_byte_offset > data_byte_length) { + if (data_element_offset > data_byte_length / data_bytes_per_element) { exception_state.ThrowDOMException(DOMExceptionCode::kOperationError, - "dataByteOffset is too large"); + "Data offset is too large"); return; } + + uint64_t data_byte_offset = data_element_offset * data_bytes_per_element; uint64_t max_write_size = data_byte_length - data_byte_offset; uint64_t write_byte_size = max_write_size; - if (byte_size.has_value()) { - write_byte_size = byte_size.value(); - if (write_byte_size > max_write_size) { - exception_state.ThrowDOMException(DOMExceptionCode::kOperationError, - "byteSize is too large"); + if (data_element_count.has_value()) { + if (data_element_count.value() > max_write_size / data_bytes_per_element) { + exception_state.ThrowDOMException( + DOMExceptionCode::kOperationError, + "Number of bytes to write is too large"); return; } + write_byte_size = data_element_count.value() * data_bytes_per_element; } - if (write_byte_size % std::max(4u, data_bytes_per_element) != 0) { - exception_state.ThrowRangeError( - "byteSize must be a multiple of max(4, data.BYTES_PER_ELEMENT)"); + if (write_byte_size % 4 != 0) { + exception_state.ThrowDOMException( + DOMExceptionCode::kOperationError, + "Number of bytes to write must be a multiple of 4"); return; }
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.h b/third_party/blink/renderer/modules/webgpu/gpu_queue.h index 7ada744..282cbd5 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.h
@@ -37,13 +37,13 @@ void writeBuffer(GPUBuffer* buffer, uint64_t buffer_offset, const MaybeShared<DOMArrayBufferView>& data, - uint64_t data_byte_offset, + uint64_t data_element_offset, ExceptionState& exception_state); void writeBuffer(GPUBuffer* buffer, uint64_t buffer_offset, const MaybeShared<DOMArrayBufferView>& data, - uint64_t data_byte_offset, - uint64_t byte_size, + uint64_t data_element_offset, + uint64_t data_element_count, ExceptionState& exception_state); void writeBuffer(GPUBuffer* buffer, uint64_t buffer_offset,
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.idl b/third_party/blink/renderer/modules/webgpu/gpu_queue.idl index 26be9a3..4da8ca40 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.idl
@@ -19,8 +19,8 @@ GPUBuffer buffer, GPUSize64 bufferOffset, [AllowShared] ArrayBufferView data, - optional GPUSize64 dataByteOffset = 0, - optional GPUSize64 byteSize); + optional GPUSize64 dataElementOffset = 0, + optional GPUSize64 dataElementCount); [RaisesException] void writeBuffer( GPUBuffer buffer, GPUSize64 bufferOffset,
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index c37c11a..edef967 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -2194,6 +2194,7 @@ "//ui/gfx/geometry/mojom:test_interfaces_blink", "//ui/gfx/mojom:test_interfaces_blink", "//url", + "//url:url_test_support", "//url/mojom:test_url_mojom_gurl_blink", ]
diff --git a/third_party/blink/renderer/platform/bindings/active_script_wrappable_base.h b/third_party/blink/renderer/platform/bindings/active_script_wrappable_base.h index ed8bac6b..371a8a4 100644 --- a/third_party/blink/renderer/platform/bindings/active_script_wrappable_base.h +++ b/third_party/blink/renderer/platform/bindings/active_script_wrappable_base.h
@@ -24,6 +24,14 @@ virtual bool IsContextDestroyed() const = 0; virtual bool DispatchHasPendingActivity() const = 0; + // See trait below. + // + // Registering the ActiveScriptWrappableBase after construction means that + // the garbage collector does not need to deal with objects that are + // currently under construction. This is important as checking whether ASW + // should be treated as active involves calling virtual functions which may + // not work during construction. The objects in construction are kept alive + // via conservative stack scanning. void ActiveScriptWrappableBaseConstructed(); protected: @@ -33,6 +41,31 @@ DISALLOW_COPY_AND_ASSIGN(ActiveScriptWrappableBase); }; +} // namespace blink + +#if BUILDFLAG(USE_V8_OILPAN) + +namespace cppgc { +template <typename T, typename = void> +struct PostConstructionCallbackTrait; + +template <typename T> +struct PostConstructionCallbackTrait< + T, + base::void_t<decltype( + std::declval<T>().ActiveScriptWrappableBaseConstructed())>> { + static void Call(T* object) { + static_assert(std::is_base_of<blink::ActiveScriptWrappableBase, T>::value, + "Only ActiveScriptWrappableBase should use the " + "post-construction hook."); + object->ActiveScriptWrappableBaseConstructed(); + } +}; +} // namespace cppgc + +#else // !USE_V8_OILPAN + +namespace blink { template <typename T> struct PostConstructionHookTrait< T, @@ -42,16 +75,12 @@ static_assert(std::is_base_of<ActiveScriptWrappableBase, T>::value, "Only ActiveScriptWrappableBase should use the " "post-construction hook."); - // Registering the ActiveScriptWrappableBase after construction means that - // the garbage collector does not need to deal with objects that are - // currently under construction. This is imnportant as checking whether ASW - // should be treated as active involves calling virtual functions which may - // not work during construction. The objects in construction are kept alive - // via conservative stack scanning. object->ActiveScriptWrappableBaseConstructed(); } }; } // namespace blink +#endif // !USE_V8_OILPAN + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_ACTIVE_SCRIPT_WRAPPABLE_BASE_H_
diff --git a/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h b/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h index 80a5914..2a9c47f 100644 --- a/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h +++ b/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h
@@ -12,6 +12,7 @@ #include "third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/buildflags.h" +#include "third_party/blink/renderer/platform/wtf/hash_traits.h" #include "third_party/blink/renderer/platform/wtf/vector_traits.h" #include "v8/include/v8.h" @@ -78,7 +79,8 @@ } template <class S> - TraceWrapperV8Reference(TraceWrapperV8Reference<S>&& other) noexcept { + TraceWrapperV8Reference( // NOLINT + TraceWrapperV8Reference<S>&& other) noexcept { *this = std::move(other); } @@ -140,17 +142,17 @@ namespace cppgc { template <typename T> -struct TraceTrait<TraceWrapperV8Reference<T>> { +struct TraceTrait<blink::TraceWrapperV8Reference<T>> { STATIC_ONLY(TraceTrait); static cppgc::TraceDescriptor GetTraceDescriptor( - const TraceWrapperV8Reference<T>* ref) { + const blink::TraceWrapperV8Reference<T>* ref) { return {ref, Trace}; } static void Trace(Visitor* visitor, const void* self) { visitor->Trace( - static_cast<const TraceWrapperV8Reference<T>*>(self)->handle_); + static_cast<const blink::TraceWrapperV8Reference<T>*>(self)->handle_); } }; } // namespace cppgc
diff --git a/third_party/blink/renderer/platform/bindings/wrapper_type_info.h b/third_party/blink/renderer/platform/bindings/wrapper_type_info.h index e544f77..5ce607c 100644 --- a/third_party/blink/renderer/platform/bindings/wrapper_type_info.h +++ b/third_party/blink/renderer/platform/bindings/wrapper_type_info.h
@@ -33,6 +33,7 @@ #include "gin/public/wrapper_info.h" #include "third_party/blink/renderer/platform/bindings/v8_interface_bridge_base.h" +#include "third_party/blink/renderer/platform/heap/visitor.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/assertions.h" @@ -43,7 +44,6 @@ class CustomWrappable; class DOMWrapperWorld; class ScriptWrappable; -class Visitor; static const int kV8DOMWrapperTypeIndex = static_cast<int>(gin::kWrapperInfoIndex);
diff --git a/third_party/blink/renderer/platform/heap/BUILD.gn b/third_party/blink/renderer/platform/heap/BUILD.gn index c627958..e7419b5 100644 --- a/third_party/blink/renderer/platform/heap/BUILD.gn +++ b/third_party/blink/renderer/platform/heap/BUILD.gn
@@ -54,10 +54,15 @@ sources = [ "blink_gc_memory_dump_provider.h", + "collection_support/heap_deque.h", + "collection_support/heap_hash_counted_set.h", + "collection_support/heap_hash_map.h", + "collection_support/heap_hash_set.h", "collection_support/heap_hash_table_backing.h", "collection_support/heap_linked_hash_set.h", "collection_support/heap_linked_stack.h", "collection_support/heap_list_hash_set.h", + "collection_support/heap_vector.h", "collection_support/heap_vector_backing.h", "disallow_new_wrapper.h", "garbage_collected.h", @@ -65,6 +70,7 @@ "handle.h", "heap.h", "heap_allocator.h", + "heap_allocator_impl.h", "heap_stats_collector.h", "heap_traits.h", "member.h", @@ -128,8 +134,8 @@ "impl/gc_task_runner.h", "impl/heap.cc", "impl/heap.h", - "impl/heap_allocator.cc", - "impl/heap_allocator.h", + "impl/heap_allocator_impl.cc", + "impl/heap_allocator_impl.h", "impl/heap_compact.cc", "impl/heap_compact.h", "impl/heap_page.cc",
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h b/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h new file mode 100644 index 0000000..323d0190 --- /dev/null +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h
@@ -0,0 +1,57 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_DEQUE_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_DEQUE_H_ + +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" +#include "third_party/blink/renderer/platform/heap/visitor.h" +#include "third_party/blink/renderer/platform/wtf/deque.h" +#include "third_party/blink/renderer/platform/wtf/type_traits.h" + +namespace blink { + +template <typename T> +class HeapDeque final : public GarbageCollected<HeapDeque<T>>, + public Deque<T, 0, HeapAllocator> { + DISALLOW_NEW(); + + public: + HeapDeque() = default; + + explicit HeapDeque(wtf_size_t size) : Deque<T, 0, HeapAllocator>(size) { + } + + HeapDeque(wtf_size_t size, const T& val) + : Deque<T, 0, HeapAllocator>(size, val) { + } + + HeapDeque& operator=(const HeapDeque& other) { + HeapDeque<T> copy(other); + Deque<T, 0, HeapAllocator>::Swap(copy); + return *this; + } + + HeapDeque(const HeapDeque<T>& other) : Deque<T, 0, HeapAllocator>(other) {} + + void Trace(Visitor* visitor) const { + CheckType(); + Deque<T, 0, HeapAllocator>::Trace(visitor); + } + + private: + static constexpr void CheckType() { + static_assert(WTF::IsMemberType<T>::value, + "HeapDeque supports only Member."); + static_assert(std::is_trivially_destructible<HeapDeque>::value, + "HeapDeque must be trivially destructible."); + static_assert(WTF::IsTraceable<T>::value, + "For vectors without traceable elements, use Deque<> instead " + "of HeapDeque<>"); + } +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_DEQUE_H_
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_counted_set.h b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_counted_set.h new file mode 100644 index 0000000..ed1034f9 --- /dev/null +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_counted_set.h
@@ -0,0 +1,63 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_COUNTED_SET_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_COUNTED_SET_H_ + +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" +#include "third_party/blink/renderer/platform/wtf/hash_counted_set.h" + +namespace blink { + +template <typename Value, + typename HashFunctions = typename DefaultHash<Value>::Hash, + typename Traits = HashTraits<Value>> +class HeapHashCountedSet final + : public HashCountedSet<Value, HashFunctions, Traits, HeapAllocator> { + IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); + DISALLOW_NEW(); + + static void CheckType() { + static_assert(WTF::IsMemberOrWeakMemberType<Value>::value, + "HeapHashCountedSet supports only Member and WeakMember."); + static_assert(std::is_trivially_destructible<HeapHashCountedSet>::value, + "HeapHashCountedSet must be trivially destructible."); + static_assert(WTF::IsTraceable<Value>::value, + "For counted sets without traceable elements, use " + "HashCountedSet<> instead of HeapHashCountedSet<>."); + } + + public: + template <typename> + static void* AllocateObject(size_t size) { + return ThreadHeap::Allocate< + HeapHashCountedSet<Value, HashFunctions, Traits>>(size); + } + + HeapHashCountedSet() { CheckType(); } +}; + +template <typename T, typename U, typename V> +struct GCInfoTrait<HeapHashCountedSet<T, U, V>> + : public GCInfoTrait<HashCountedSet<T, U, V, HeapAllocator>> {}; + +} // namespace blink + +namespace WTF { + +template <typename Value, + typename HashFunctions, + typename Traits, + typename VectorType> +inline void CopyToVector( + const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, + VectorType& vector) { + CopyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, + blink::HeapAllocator>&>(set), + vector); +} + +} // namespace WTF + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_COUNTED_SET_H_
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h new file mode 100644 index 0000000..a184316d --- /dev/null +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h
@@ -0,0 +1,64 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_MAP_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_MAP_H_ + +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" +#include "third_party/blink/renderer/platform/wtf/hash_map.h" + +namespace blink { + +template <typename KeyArg, + typename MappedArg, + typename HashArg = typename DefaultHash<KeyArg>::Hash, + typename KeyTraitsArg = HashTraits<KeyArg>, + typename MappedTraitsArg = HashTraits<MappedArg>> +class HeapHashMap final : public HashMap<KeyArg, + MappedArg, + HashArg, + KeyTraitsArg, + MappedTraitsArg, + HeapAllocator> { + IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); + DISALLOW_NEW(); + + static void CheckType() { + static_assert(std::is_trivially_destructible<HeapHashMap>::value, + "HeapHashMap must be trivially destructible."); + static_assert( + WTF::IsTraceable<KeyArg>::value || WTF::IsTraceable<MappedArg>::value, + "For hash maps without traceable elements, use HashMap<> " + "instead of HeapHashMap<>."); + static_assert(WTF::IsMemberOrWeakMemberType<KeyArg>::value || + !WTF::IsTraceable<KeyArg>::value, + "HeapHashMap supports only Member, WeakMember and " + "non-traceable types as keys."); + static_assert(WTF::IsMemberOrWeakMemberType<MappedArg>::value || + !WTF::IsTraceable<MappedArg>::value || + WTF::IsSubclassOfTemplate<MappedArg, + TraceWrapperV8Reference>::value, + "HeapHashMap supports only Member, WeakMember, " + "TraceWrapperV8Reference and " + "non-traceable types as values."); + } + + public: + template <typename> + static void* AllocateObject(size_t size) { + return ThreadHeap::Allocate< + HeapHashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>>( + size); + } + + HeapHashMap() { CheckType(); } +}; + +template <typename T, typename U, typename V, typename W, typename X> +struct GCInfoTrait<HeapHashMap<T, U, V, W, X>> + : public GCInfoTrait<HashMap<T, U, V, W, X, HeapAllocator>> {}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_MAP_H_
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h new file mode 100644 index 0000000..03207de75 --- /dev/null +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h
@@ -0,0 +1,47 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_SET_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_SET_H_ + +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" +#include "third_party/blink/renderer/platform/wtf/hash_set.h" + +namespace blink { + +template <typename ValueArg, + typename HashArg = typename DefaultHash<ValueArg>::Hash, + typename TraitsArg = HashTraits<ValueArg>> +class HeapHashSet + : public HashSet<ValueArg, HashArg, TraitsArg, HeapAllocator> { + IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); + DISALLOW_NEW(); + + static void CheckType() { + static_assert(WTF::IsMemberOrWeakMemberType<ValueArg>::value, + "HeapHashSet supports only Member and WeakMember."); + static_assert(std::is_trivially_destructible<HeapHashSet>::value, + "HeapHashSet must be trivially destructible."); + static_assert(WTF::IsTraceable<ValueArg>::value, + "For hash sets without traceable elements, use HashSet<> " + "instead of HeapHashSet<>."); + } + + public: + template <typename> + static void* AllocateObject(size_t size) { + return ThreadHeap::Allocate<HeapHashSet<ValueArg, HashArg, TraitsArg>>( + size); + } + + HeapHashSet() { CheckType(); } +}; + +template <typename T, typename U, typename V> +struct GCInfoTrait<HeapHashSet<T, U, V>> + : public GCInfoTrait<HashSet<T, U, V, HeapAllocator>> {}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_HASH_SET_H_
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h b/third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h index 7e9b074..12a4600 100644 --- a/third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_LINKED_HASH_SET_H_ #include "third_party/blink/renderer/platform/heap/heap.h" +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" #include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" #include "third_party/blink/renderer/platform/wtf/type_traits.h"
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_linked_stack.h b/third_party/blink/renderer/platform/heap/collection_support/heap_linked_stack.h index 051dc07..e56c90e 100644 --- a/third_party/blink/renderer/platform/heap/collection_support/heap_linked_stack.h +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_linked_stack.h
@@ -32,9 +32,10 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_LINKED_STACK_H_ #include "third_party/blink/renderer/platform/heap/heap.h" -#include "third_party/blink/renderer/platform/heap/heap_allocator.h" +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" #include "third_party/blink/renderer/platform/heap/visitor.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +#include "third_party/blink/renderer/platform/wtf/type_traits.h" namespace blink { @@ -76,7 +77,7 @@ }; static void CheckType() { - static_assert(internal::IsMember<T>, + static_assert(WTF::IsMemberType<T>::value, "HeapLinkedStack supports only Member."); }
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_vector.h b/third_party/blink/renderer/platform/heap/collection_support/heap_vector.h new file mode 100644 index 0000000..b0f439e --- /dev/null +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_vector.h
@@ -0,0 +1,167 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_VECTOR_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_VECTOR_H_ + +#include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" +#include "third_party/blink/renderer/platform/wtf/type_traits.h" +#include "third_party/blink/renderer/platform/wtf/vector.h" + +namespace blink { + +template <typename T, wtf_size_t inlineCapacity = 0> +class HeapVector final : public Vector<T, inlineCapacity, HeapAllocator> { + IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); + DISALLOW_NEW(); + + static void CheckType() { + static_assert( + std::is_trivially_destructible<HeapVector>::value || inlineCapacity, + "HeapVector must be trivially destructible."); + static_assert(WTF::IsTraceable<T>::value, + "For vectors without traceable elements, use Vector<> " + "instead of HeapVector<>."); + static_assert(!WTF::IsWeak<T>::value, + "Weak types are not allowed in HeapVector."); + static_assert(WTF::IsTraceableInCollectionTrait<VectorTraits<T>>::value, + "Type must be traceable in collection"); + } + + public: + template <typename> + static void* AllocateObject(size_t size) { + // On-heap HeapVectors generally should not have inline capacity, but it is + // hard to avoid when using a type alias. Hence we only disallow the + // VectorTraits<T>::kNeedsDestruction case for now. + static_assert(inlineCapacity == 0 || !VectorTraits<T>::kNeedsDestruction, + "on-heap HeapVector<> should not have an inline capacity"); + return ThreadHeap::Allocate<HeapVector<T, inlineCapacity>>(size); + } + + HeapVector() { CheckType(); } + + explicit HeapVector(wtf_size_t size) + : Vector<T, inlineCapacity, HeapAllocator>(size) { + CheckType(); + } + + HeapVector(wtf_size_t size, const T& val) + : Vector<T, inlineCapacity, HeapAllocator>(size, val) { + CheckType(); + } + + template <wtf_size_t otherCapacity> + HeapVector(const HeapVector<T, otherCapacity>& other) // NOLINT + : Vector<T, inlineCapacity, HeapAllocator>(other) { + CheckType(); + } + + HeapVector(const HeapVector& other) + : Vector<T, inlineCapacity, HeapAllocator>(other) { + CheckType(); + } + + HeapVector& operator=(const HeapVector& other) { + Vector<T, inlineCapacity, HeapAllocator>::operator=(other); + return *this; + } + + HeapVector(HeapVector&& other) noexcept + : Vector<T, inlineCapacity, HeapAllocator>(std::move(other)) { + CheckType(); + } + + HeapVector& operator=(HeapVector&& other) noexcept { + Vector<T, inlineCapacity, HeapAllocator>::operator=(std::move(other)); + return *this; + } + + HeapVector(std::initializer_list<T> elements) + : Vector<T, inlineCapacity, HeapAllocator>(elements) { + CheckType(); + } +}; + +template <typename T, wtf_size_t inlineCapacity> +struct GCInfoTrait<HeapVector<T, inlineCapacity>> + : public GCInfoTrait<Vector<T, inlineCapacity, HeapAllocator>> {}; + +} // namespace blink + +namespace WTF { + +template <typename T> +struct VectorTraits<blink::Member<T>> : VectorTraitsBase<blink::Member<T>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = false; + static const bool kCanInitializeWithMemset = true; + static const bool kCanClearUnusedSlotsWithMemset = true; + static const bool kCanCopyWithMemcpy = true; + static const bool kCanMoveWithMemcpy = true; + + static constexpr bool kCanTraceConcurrently = true; +}; + +// These traits are used in VectorBackedLinkedList to support WeakMember in +// HeapLinkedHashSet though HeapVector<WeakMember> usage is still banned. +// (See the discussion in https://crrev.com/c/2246014) +template <typename T> +struct VectorTraits<blink::WeakMember<T>> + : VectorTraitsBase<blink::WeakMember<T>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = false; + static const bool kCanInitializeWithMemset = true; + static const bool kCanClearUnusedSlotsWithMemset = true; + static const bool kCanCopyWithMemcpy = true; + static const bool kCanMoveWithMemcpy = true; + + static constexpr bool kCanTraceConcurrently = true; +}; + +template <typename T> +struct VectorTraits<blink::UntracedMember<T>> + : VectorTraitsBase<blink::UntracedMember<T>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = false; + static const bool kCanInitializeWithMemset = true; + static const bool kCanClearUnusedSlotsWithMemset = true; + static const bool kCanMoveWithMemcpy = true; +}; + +template <typename T> +struct VectorTraits<blink::HeapVector<T, 0>> + : VectorTraitsBase<blink::HeapVector<T, 0>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = false; + static const bool kCanInitializeWithMemset = true; + static const bool kCanClearUnusedSlotsWithMemset = true; + static const bool kCanMoveWithMemcpy = true; +}; + +template <typename T> +struct VectorTraits<blink::HeapDeque<T>> + : VectorTraitsBase<blink::HeapDeque<T>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = false; + static const bool kCanInitializeWithMemset = true; + static const bool kCanClearUnusedSlotsWithMemset = true; + static const bool kCanMoveWithMemcpy = true; +}; + +template <typename T, wtf_size_t inlineCapacity> +struct VectorTraits<blink::HeapVector<T, inlineCapacity>> + : VectorTraitsBase<blink::HeapVector<T, inlineCapacity>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = VectorTraits<T>::kNeedsDestruction; + static const bool kCanInitializeWithMemset = + VectorTraits<T>::kCanInitializeWithMemset; + static const bool kCanClearUnusedSlotsWithMemset = + VectorTraits<T>::kCanClearUnusedSlotsWithMemset; + static const bool kCanMoveWithMemcpy = VectorTraits<T>::kCanMoveWithMemcpy; +}; + +} // namespace WTF + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_HEAP_VECTOR_H_
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h b/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h index b75d0fc..bf51857 100644 --- a/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h
@@ -7,7 +7,6 @@ #include "base/check_op.h" #include "third_party/blink/renderer/platform/heap/heap.h" -#include "third_party/blink/renderer/platform/heap/heap_allocator.h" #include "third_party/blink/renderer/platform/heap/impl/finalizer_traits.h" #include "third_party/blink/renderer/platform/heap/impl/gc_info.h" #include "third_party/blink/renderer/platform/heap/impl/threading_traits.h"
diff --git a/third_party/blink/renderer/platform/heap/heap_allocator.h b/third_party/blink/renderer/platform/heap/heap_allocator.h index 7d8916d..90fbb02 100644 --- a/third_party/blink/renderer/platform/heap/heap_allocator.h +++ b/third_party/blink/renderer/platform/heap/heap_allocator.h
@@ -5,12 +5,15 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_HEAP_ALLOCATOR_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_HEAP_ALLOCATOR_H_ +// Legacy: Users including `heap_allocator.h` actually expect it to pull in the +// containers. +#include "third_party/blink/renderer/platform/heap/collection_support/heap_deque.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_counted_set.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_list_hash_set.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" #include "third_party/blink/renderer/platform/wtf/buildflags.h" -#if BUILDFLAG(USE_V8_OILPAN) -#include "third_party/blink/renderer/platform/heap/v8_wrapper/heap_allocator.h" -#else // !USE_V8_OILPAN -#include "third_party/blink/renderer/platform/heap/impl/heap_allocator.h" -#endif // !USE_V8_OILPAN - #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_HEAP_ALLOCATOR_H_
diff --git a/third_party/blink/renderer/platform/heap/heap_allocator_impl.h b/third_party/blink/renderer/platform/heap/heap_allocator_impl.h new file mode 100644 index 0000000..05a45a6 --- /dev/null +++ b/third_party/blink/renderer/platform/heap/heap_allocator_impl.h
@@ -0,0 +1,16 @@ +// Copyright 2020 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_HEAP_ALLOCATOR_IMPL_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_HEAP_ALLOCATOR_IMPL_H_ + +#include "third_party/blink/renderer/platform/wtf/buildflags.h" + +#if BUILDFLAG(USE_V8_OILPAN) +// TODO(1056170): Add wrapper version. +#else // !USE_V8_OILPAN +#include "third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.h" +#endif // !USE_V8_OILPAN + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_HEAP_ALLOCATOR_IMPL_H_
diff --git a/third_party/blink/renderer/platform/heap/impl/heap_allocator.h b/third_party/blink/renderer/platform/heap/impl/heap_allocator.h deleted file mode 100644 index 9d1af70..0000000 --- a/third_party/blink/renderer/platform/heap/impl/heap_allocator.h +++ /dev/null
@@ -1,631 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_HEAP_ALLOCATOR_H_ -#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_HEAP_ALLOCATOR_H_ - -#include <type_traits> - -#include "build/build_config.h" -#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h" -#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" -#include "third_party/blink/renderer/platform/heap/collection_support/heap_list_hash_set.h" -#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h" -#include "third_party/blink/renderer/platform/heap/heap.h" -#include "third_party/blink/renderer/platform/heap/heap_buildflags.h" -#include "third_party/blink/renderer/platform/heap/impl/marking_visitor.h" -#include "third_party/blink/renderer/platform/heap/impl/trace_traits.h" -#include "third_party/blink/renderer/platform/heap/thread_state_scopes.h" -#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -#include "third_party/blink/renderer/platform/wtf/assertions.h" -#include "third_party/blink/renderer/platform/wtf/construct_traits.h" -#include "third_party/blink/renderer/platform/wtf/deque.h" -#include "third_party/blink/renderer/platform/wtf/doubly_linked_list.h" -#include "third_party/blink/renderer/platform/wtf/hash_counted_set.h" -#include "third_party/blink/renderer/platform/wtf/hash_map.h" -#include "third_party/blink/renderer/platform/wtf/hash_set.h" -#include "third_party/blink/renderer/platform/wtf/hash_table.h" -#include "third_party/blink/renderer/platform/wtf/type_traits.h" -#include "third_party/blink/renderer/platform/wtf/vector.h" - -namespace blink { - -namespace internal { - -template <typename T> -constexpr bool IsMember = WTF::IsSubclassOfTemplate<T, Member>::value; - -} // namespace internal - -// This is a static-only class used as a trait on collections to make them heap -// allocated. -class PLATFORM_EXPORT HeapAllocator { - STATIC_ONLY(HeapAllocator); - - public: - using LivenessBroker = blink::LivenessBroker; - using Visitor = blink::Visitor; - static constexpr bool kIsGarbageCollected = true; - - // See wtf/size_t.h for details. - static constexpr size_t kMaxHeapObjectSizeLog2 = 27; - static constexpr size_t kMaxHeapObjectSize = 1 << kMaxHeapObjectSizeLog2; - - template <typename T> - static size_t MaxElementCountInBackingStore() { - return kMaxHeapObjectSize / sizeof(T); - } - - template <typename T> - static size_t QuantizedSize(size_t count) { - CHECK_LE(count, MaxElementCountInBackingStore<T>()); - // Oilpan's internal size is independent of MaxElementCountInBackingStore() - // and the required size to match capacity needs. - return count * sizeof(T); - } - - template <typename T> - static T* AllocateVectorBacking(size_t size) { - return reinterpret_cast<T*>( - MakeGarbageCollected<HeapVectorBacking<T>>(size / sizeof(T))); - } - static void FreeVectorBacking(void*); - static bool ExpandVectorBacking(void*, size_t); - static bool ShrinkVectorBacking(void* address, - size_t quantized_current_size, - size_t quantized_shrunk_size); - - template <typename T, typename HashTable> - static T* AllocateHashTableBacking(size_t size) { - return reinterpret_cast<T*>( - MakeGarbageCollected<HeapHashTableBacking<HashTable>>( - size / sizeof(typename HashTable::ValueType))); - } - template <typename T, typename HashTable> - static T* AllocateZeroedHashTableBacking(size_t size) { - return AllocateHashTableBacking<T, HashTable>(size); - } - static void FreeHashTableBacking(void* address); - static bool ExpandHashTableBacking(void*, size_t); - - static bool IsAllocationAllowed() { - return ThreadState::Current()->IsAllocationAllowed(); - } - - static bool IsIncrementalMarking() { - return ThreadState::IsAnyIncrementalMarking() && - ThreadState::Current()->IsIncrementalMarking(); - } - - static void EnterGCForbiddenScope() { - ThreadState::Current()->EnterGCForbiddenScope(); - } - - static void LeaveGCForbiddenScope() { - ThreadState::Current()->LeaveGCForbiddenScope(); - } - - template <typename T, typename Traits> - static void Trace(Visitor* visitor, const T& t) { - TraceCollectionIfEnabled<WTF::WeakHandlingTrait<T>::value, T, - Traits>::Trace(visitor, &t); - } - - template <typename T> - static void TraceVectorBacking(Visitor* visitor, - const T* backing, - const T* const* backing_slot) { - visitor->TraceMovablePointer(backing_slot); - visitor->Trace(reinterpret_cast<const HeapVectorBacking<T>*>(backing)); - } - - template <typename T, typename HashTable> - static void TraceHashTableBackingStrongly(Visitor* visitor, - const T* backing, - const T* const* backing_slot) { - visitor->TraceMovablePointer(backing_slot); - visitor->Trace( - reinterpret_cast<const HeapHashTableBacking<HashTable>*>(backing)); - } - - template <typename T, typename HashTable> - static void TraceHashTableBackingWeakly(Visitor* visitor, - const T* backing, - const T* const* backing_slot, - WeakCallback callback, - const void* parameter) { - visitor->TraceMovablePointer(backing_slot); - visitor->TraceWeakContainer( - reinterpret_cast<const HeapHashTableBacking<HashTable>*>(backing), - reinterpret_cast<const HeapHashTableBacking<HashTable>* const*>( - backing_slot), - TraceTrait<HeapHashTableBacking<HashTable>>::GetTraceDescriptor( - backing), - TraceTrait<HeapHashTableBacking<HashTable>>::GetWeakTraceDescriptor( - backing), - callback, parameter); - } - - template <typename T> - static void BackingWriteBarrier(T** slot) { - MarkingVisitor::WriteBarrier(reinterpret_cast<void**>(slot)); - } - - static void TraceBackingStoreIfMarked(const void* object) { - MarkingVisitor::RetraceObject(object); - } - - template <typename T, typename Traits> - static void NotifyNewObject(T* object) { - MarkingVisitor::WriteBarrier( - []() { return ThreadState::Current(); }, object, sizeof(T), 1, - TraceCollectionIfEnabled<WTF::kNoWeakHandling, T, Traits>::Trace); - } - - template <typename T, typename Traits> - static void NotifyNewObjects(T* array, size_t len) { - MarkingVisitor::WriteBarrier( - []() { return ThreadState::Current(); }, array, sizeof(T), len, - TraceCollectionIfEnabled<WTF::kNoWeakHandling, T, Traits>::Trace); - } - - private: - static void BackingFree(void*); - static bool BackingExpand(void*, size_t); - static bool BackingShrink(void*, - size_t quantized_current_size, - size_t quantized_shrunk_size); -}; - -template <typename KeyArg, - typename MappedArg, - typename HashArg = typename DefaultHash<KeyArg>::Hash, - typename KeyTraitsArg = HashTraits<KeyArg>, - typename MappedTraitsArg = HashTraits<MappedArg>> -class HeapHashMap final : public HashMap<KeyArg, - MappedArg, - HashArg, - KeyTraitsArg, - MappedTraitsArg, - HeapAllocator> { - IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); - DISALLOW_NEW(); - - static void CheckType() { - static_assert(std::is_trivially_destructible<HeapHashMap>::value, - "HeapHashMap must be trivially destructible."); - static_assert( - WTF::IsTraceable<KeyArg>::value || WTF::IsTraceable<MappedArg>::value, - "For hash maps without traceable elements, use HashMap<> " - "instead of HeapHashMap<>."); - static_assert(WTF::IsMemberOrWeakMemberType<KeyArg>::value || - !WTF::IsTraceable<KeyArg>::value, - "HeapHashMap supports only Member, WeakMember and " - "non-traceable types as keys."); - static_assert(WTF::IsMemberOrWeakMemberType<MappedArg>::value || - !WTF::IsTraceable<MappedArg>::value || - WTF::IsSubclassOfTemplate<MappedArg, - TraceWrapperV8Reference>::value, - "HeapHashMap supports only Member, WeakMember, " - "TraceWrapperV8Reference and " - "non-traceable types as values."); - } - - public: - template <typename> - static void* AllocateObject(size_t size) { - return ThreadHeap::Allocate< - HeapHashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>>( - size); - } - - HeapHashMap() { CheckType(); } -}; - -template <typename T, typename U, typename V, typename W, typename X> -struct GCInfoTrait<HeapHashMap<T, U, V, W, X>> - : public GCInfoTrait<HashMap<T, U, V, W, X, HeapAllocator>> {}; - -template <typename ValueArg, - typename HashArg = typename DefaultHash<ValueArg>::Hash, - typename TraitsArg = HashTraits<ValueArg>> -class HeapHashSet - : public HashSet<ValueArg, HashArg, TraitsArg, HeapAllocator> { - IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); - DISALLOW_NEW(); - - static void CheckType() { - static_assert(WTF::IsMemberOrWeakMemberType<ValueArg>::value, - "HeapHashSet supports only Member and WeakMember."); - static_assert(std::is_trivially_destructible<HeapHashSet>::value, - "HeapHashSet must be trivially destructible."); - static_assert(WTF::IsTraceable<ValueArg>::value, - "For hash sets without traceable elements, use HashSet<> " - "instead of HeapHashSet<>."); - } - - public: - template <typename> - static void* AllocateObject(size_t size) { - return ThreadHeap::Allocate<HeapHashSet<ValueArg, HashArg, TraitsArg>>( - size); - } - - HeapHashSet() { CheckType(); } -}; - -template <typename T, typename U, typename V> -struct GCInfoTrait<HeapHashSet<T, U, V>> - : public GCInfoTrait<HashSet<T, U, V, HeapAllocator>> {}; - -template <typename Value, - typename HashFunctions = typename DefaultHash<Value>::Hash, - typename Traits = HashTraits<Value>> -class HeapHashCountedSet final - : public HashCountedSet<Value, HashFunctions, Traits, HeapAllocator> { - IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); - DISALLOW_NEW(); - - static void CheckType() { - static_assert(WTF::IsMemberOrWeakMemberType<Value>::value, - "HeapHashCountedSet supports only Member and WeakMember."); - static_assert(std::is_trivially_destructible<HeapHashCountedSet>::value, - "HeapHashCountedSet must be trivially destructible."); - static_assert(WTF::IsTraceable<Value>::value, - "For counted sets without traceable elements, use " - "HashCountedSet<> instead of HeapHashCountedSet<>."); - } - - public: - template <typename> - static void* AllocateObject(size_t size) { - return ThreadHeap::Allocate< - HeapHashCountedSet<Value, HashFunctions, Traits>>(size); - } - - HeapHashCountedSet() { CheckType(); } -}; - -template <typename T, typename U, typename V> -struct GCInfoTrait<HeapHashCountedSet<T, U, V>> - : public GCInfoTrait<HashCountedSet<T, U, V, HeapAllocator>> {}; - -template <typename T, wtf_size_t inlineCapacity = 0> -class HeapVector final : public Vector<T, inlineCapacity, HeapAllocator> { - IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); - DISALLOW_NEW(); - - static void CheckType() { - static_assert( - std::is_trivially_destructible<HeapVector>::value || inlineCapacity, - "HeapVector must be trivially destructible."); - static_assert(WTF::IsTraceable<T>::value, - "For vectors without traceable elements, use Vector<> " - "instead of HeapVector<>."); - static_assert(!WTF::IsWeak<T>::value, - "Weak types are not allowed in HeapVector."); - static_assert(WTF::IsTraceableInCollectionTrait<VectorTraits<T>>::value, - "Type must be traceable in collection"); - } - - public: - template <typename> - static void* AllocateObject(size_t size) { - // On-heap HeapVectors generally should not have inline capacity, but it is - // hard to avoid when using a type alias. Hence we only disallow the - // VectorTraits<T>::kNeedsDestruction case for now. - static_assert(inlineCapacity == 0 || !VectorTraits<T>::kNeedsDestruction, - "on-heap HeapVector<> should not have an inline capacity"); - return ThreadHeap::Allocate<HeapVector<T, inlineCapacity>>(size); - } - - HeapVector() { CheckType(); } - - explicit HeapVector(wtf_size_t size) - : Vector<T, inlineCapacity, HeapAllocator>(size) { - CheckType(); - } - - HeapVector(wtf_size_t size, const T& val) - : Vector<T, inlineCapacity, HeapAllocator>(size, val) { - CheckType(); - } - - template <wtf_size_t otherCapacity> - HeapVector(const HeapVector<T, otherCapacity>& other) - : Vector<T, inlineCapacity, HeapAllocator>(other) { - CheckType(); - } - - HeapVector(const HeapVector& other) - : Vector<T, inlineCapacity, HeapAllocator>(other) { - CheckType(); - } - - HeapVector& operator=(const HeapVector& other) { - Vector<T, inlineCapacity, HeapAllocator>::operator=(other); - return *this; - } - - HeapVector(HeapVector&& other) noexcept - : Vector<T, inlineCapacity, HeapAllocator>(std::move(other)) { - CheckType(); - } - - HeapVector& operator=(HeapVector&& other) noexcept { - Vector<T, inlineCapacity, HeapAllocator>::operator=(std::move(other)); - return *this; - } - - HeapVector(std::initializer_list<T> elements) - : Vector<T, inlineCapacity, HeapAllocator>(elements) { - CheckType(); - } -}; - -template <typename T, wtf_size_t inlineCapacity> -struct GCInfoTrait<HeapVector<T, inlineCapacity>> - : public GCInfoTrait<Vector<T, inlineCapacity, HeapAllocator>> {}; - -template <typename T> -class HeapDeque final : public Deque<T, 0, HeapAllocator> { - IS_GARBAGE_COLLECTED_CONTAINER_TYPE(); - DISALLOW_NEW(); - - static void CheckType() { - static_assert(internal::IsMember<T>, "HeapDeque supports only Member."); - static_assert(std::is_trivially_destructible<HeapDeque>::value, - "HeapDeque must be trivially destructible."); - static_assert(WTF::IsTraceable<T>::value, - "For vectors without traceable elements, use Deque<> instead " - "of HeapDeque<>"); - } - - public: - template <typename> - static void* AllocateObject(size_t size) { - return ThreadHeap::Allocate<HeapDeque<T>>(size); - } - - HeapDeque() { CheckType(); } - - explicit HeapDeque(wtf_size_t size) : Deque<T, 0, HeapAllocator>(size) { - CheckType(); - } - - HeapDeque(wtf_size_t size, const T& val) - : Deque<T, 0, HeapAllocator>(size, val) { - CheckType(); - } - - HeapDeque& operator=(const HeapDeque& other) { - HeapDeque<T> copy(other); - Deque<T, 0, HeapAllocator>::Swap(copy); - return *this; - } - - HeapDeque(const HeapDeque<T>& other) : Deque<T, 0, HeapAllocator>(other) {} -}; - -template <typename T> -struct GCInfoTrait<HeapDeque<T>> - : public GCInfoTrait<Deque<T, 0, HeapAllocator>> {}; - -} // namespace blink - -namespace WTF { - -template <typename T> -struct VectorTraits<blink::Member<T>> : VectorTraitsBase<blink::Member<T>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = false; - static const bool kCanInitializeWithMemset = true; - static const bool kCanClearUnusedSlotsWithMemset = true; - static const bool kCanCopyWithMemcpy = true; - static const bool kCanMoveWithMemcpy = true; - - static constexpr bool kCanTraceConcurrently = true; -}; - -// These traits are used in VectorBackedLinkedList to support WeakMember in -// HeapLinkedHashSet though HeapVector<WeakMember> usage is still banned. -// (See the discussion in https://crrev.com/c/2246014) -template <typename T> -struct VectorTraits<blink::WeakMember<T>> - : VectorTraitsBase<blink::WeakMember<T>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = false; - static const bool kCanInitializeWithMemset = true; - static const bool kCanClearUnusedSlotsWithMemset = true; - static const bool kCanCopyWithMemcpy = true; - static const bool kCanMoveWithMemcpy = true; - - static constexpr bool kCanTraceConcurrently = true; -}; - -template <typename T> -struct VectorTraits<blink::UntracedMember<T>> - : VectorTraitsBase<blink::UntracedMember<T>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = false; - static const bool kCanInitializeWithMemset = true; - static const bool kCanClearUnusedSlotsWithMemset = true; - static const bool kCanMoveWithMemcpy = true; -}; - -template <typename T> -struct VectorTraits<blink::HeapVector<T, 0>> - : VectorTraitsBase<blink::HeapVector<T, 0>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = false; - static const bool kCanInitializeWithMemset = true; - static const bool kCanClearUnusedSlotsWithMemset = true; - static const bool kCanMoveWithMemcpy = true; -}; - -template <typename T> -struct VectorTraits<blink::HeapDeque<T>> - : VectorTraitsBase<blink::HeapDeque<T>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = false; - static const bool kCanInitializeWithMemset = true; - static const bool kCanClearUnusedSlotsWithMemset = true; - static const bool kCanMoveWithMemcpy = true; -}; - -template <typename T, wtf_size_t inlineCapacity> -struct VectorTraits<blink::HeapVector<T, inlineCapacity>> - : VectorTraitsBase<blink::HeapVector<T, inlineCapacity>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = VectorTraits<T>::kNeedsDestruction; - static const bool kCanInitializeWithMemset = - VectorTraits<T>::kCanInitializeWithMemset; - static const bool kCanClearUnusedSlotsWithMemset = - VectorTraits<T>::kCanClearUnusedSlotsWithMemset; - static const bool kCanMoveWithMemcpy = VectorTraits<T>::kCanMoveWithMemcpy; -}; - -template <typename T> -struct HashTraits<blink::Member<T>> : SimpleClassHashTraits<blink::Member<T>> { - STATIC_ONLY(HashTraits); - // FIXME: Implement proper const'ness for iterator types. Requires support - // in the marking Visitor. - using PeekInType = T*; - using IteratorGetType = blink::Member<T>*; - using IteratorConstGetType = const blink::Member<T>*; - using IteratorReferenceType = blink::Member<T>&; - using IteratorConstReferenceType = const blink::Member<T>&; - static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { - return *x; - } - static IteratorConstReferenceType GetToReferenceConstConversion( - IteratorConstGetType x) { - return *x; - } - - using PeekOutType = T*; - - template <typename U> - static void Store(const U& value, blink::Member<T>& storage) { - storage = value; - } - - static PeekOutType Peek(const blink::Member<T>& value) { return value; } - - static void ConstructDeletedValue(blink::Member<T>& slot, bool) { - slot = WTF::kHashTableDeletedValue; - } - - static constexpr bool kCanTraceConcurrently = true; -}; - -template <typename T> -struct HashTraits<blink::WeakMember<T>> - : SimpleClassHashTraits<blink::WeakMember<T>> { - STATIC_ONLY(HashTraits); - static const bool kNeedsDestruction = false; - // FIXME: Implement proper const'ness for iterator types. Requires support - // in the marking Visitor. - using PeekInType = T*; - using IteratorGetType = blink::WeakMember<T>*; - using IteratorConstGetType = const blink::WeakMember<T>*; - using IteratorReferenceType = blink::WeakMember<T>&; - using IteratorConstReferenceType = const blink::WeakMember<T>&; - static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { - return *x; - } - static IteratorConstReferenceType GetToReferenceConstConversion( - IteratorConstGetType x) { - return *x; - } - - using PeekOutType = T*; - - template <typename U> - static void Store(const U& value, blink::WeakMember<T>& storage) { - storage = value; - } - - static PeekOutType Peek(const blink::WeakMember<T>& value) { return value; } - - static void ConstructDeletedValue(blink::WeakMember<T>& slot, bool) { - slot = WTF::kHashTableDeletedValue; - } - - static constexpr bool kCanTraceConcurrently = true; -}; - -template <typename T> -struct HashTraits<blink::UntracedMember<T>> - : SimpleClassHashTraits<blink::UntracedMember<T>> { - STATIC_ONLY(HashTraits); - static const bool kNeedsDestruction = false; - // FIXME: Implement proper const'ness for iterator types. - using PeekInType = T*; - using IteratorGetType = blink::UntracedMember<T>*; - using IteratorConstGetType = const blink::UntracedMember<T>*; - using IteratorReferenceType = blink::UntracedMember<T>&; - using IteratorConstReferenceType = const blink::UntracedMember<T>&; - static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { - return *x; - } - static IteratorConstReferenceType GetToReferenceConstConversion( - IteratorConstGetType x) { - return *x; - } - using PeekOutType = T*; - - template <typename U> - static void Store(const U& value, blink::UntracedMember<T>& storage) { - storage = value; - } - - static PeekOutType Peek(const blink::UntracedMember<T>& value) { - return value; - } -}; - -template <typename T, typename H> -struct HandleHashTraits : SimpleClassHashTraits<H> { - STATIC_ONLY(HandleHashTraits); - // TODO: Implement proper const'ness for iterator types. Requires support - // in the marking Visitor. - using PeekInType = T*; - using IteratorGetType = H*; - using IteratorConstGetType = const H*; - using IteratorReferenceType = H&; - using IteratorConstReferenceType = const H&; - static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { - return *x; - } - static IteratorConstReferenceType GetToReferenceConstConversion( - IteratorConstGetType x) { - return *x; - } - - using PeekOutType = T*; - - template <typename U> - static void Store(const U& value, H& storage) { - storage = value; - } - - static PeekOutType Peek(const H& value) { return value; } -}; - -template <typename Value, - typename HashFunctions, - typename Traits, - typename VectorType> -inline void CopyToVector( - const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, - VectorType& vector) { - CopyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, - blink::HeapAllocator>&>(set), - vector); -} - -} // namespace WTF - -#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_HEAP_ALLOCATOR_H_
diff --git a/third_party/blink/renderer/platform/heap/impl/heap_allocator.cc b/third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.cc similarity index 96% rename from third_party/blink/renderer/platform/heap/impl/heap_allocator.cc rename to third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.cc index f4e2745..8f0efaa 100644 --- a/third_party/blink/renderer/platform/heap/impl/heap_allocator.cc +++ b/third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.cc
@@ -1,8 +1,8 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// Copyright 2021 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 "third_party/blink/renderer/platform/heap/heap_allocator.h" +#include "third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.h" namespace blink {
diff --git a/third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.h b/third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.h new file mode 100644 index 0000000..33d8c6e --- /dev/null +++ b/third_party/blink/renderer/platform/heap/impl/heap_allocator_impl.h
@@ -0,0 +1,160 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_HEAP_ALLOCATOR_IMPL_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_HEAP_ALLOCATOR_IMPL_H_ + +#include "build/build_config.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h" +#include "third_party/blink/renderer/platform/heap/impl/heap.h" +#include "third_party/blink/renderer/platform/heap/impl/marking_visitor.h" +#include "third_party/blink/renderer/platform/heap/impl/trace_traits.h" +#include "third_party/blink/renderer/platform/wtf/type_traits.h" + +namespace blink { + +// This is a static-only class used as a trait on collections to make them heap +// allocated. +class PLATFORM_EXPORT HeapAllocator { + STATIC_ONLY(HeapAllocator); + + public: + using LivenessBroker = blink::LivenessBroker; + using Visitor = blink::Visitor; + static constexpr bool kIsGarbageCollected = true; + + // See wtf/size_t.h for details. + static constexpr size_t kMaxHeapObjectSizeLog2 = 27; + static constexpr size_t kMaxHeapObjectSize = 1 << kMaxHeapObjectSizeLog2; + + template <typename T> + static size_t MaxElementCountInBackingStore() { + return kMaxHeapObjectSize / sizeof(T); + } + + template <typename T> + static size_t QuantizedSize(size_t count) { + CHECK_LE(count, MaxElementCountInBackingStore<T>()); + // Oilpan's internal size is independent of MaxElementCountInBackingStore() + // and the required size to match capacity needs. + return count * sizeof(T); + } + + template <typename T> + static T* AllocateVectorBacking(size_t size) { + return reinterpret_cast<T*>( + MakeGarbageCollected<HeapVectorBacking<T>>(size / sizeof(T))); + } + static void FreeVectorBacking(void*); + static bool ExpandVectorBacking(void*, size_t); + static bool ShrinkVectorBacking(void* address, + size_t quantized_current_size, + size_t quantized_shrunk_size); + + template <typename T, typename HashTable> + static T* AllocateHashTableBacking(size_t size) { + return reinterpret_cast<T*>( + MakeGarbageCollected<HeapHashTableBacking<HashTable>>( + size / sizeof(typename HashTable::ValueType))); + } + template <typename T, typename HashTable> + static T* AllocateZeroedHashTableBacking(size_t size) { + return AllocateHashTableBacking<T, HashTable>(size); + } + static void FreeHashTableBacking(void* address); + static bool ExpandHashTableBacking(void*, size_t); + + static bool IsAllocationAllowed() { + return ThreadState::Current()->IsAllocationAllowed(); + } + + static bool IsIncrementalMarking() { + return ThreadState::IsAnyIncrementalMarking() && + ThreadState::Current()->IsIncrementalMarking(); + } + + static void EnterGCForbiddenScope() { + ThreadState::Current()->EnterGCForbiddenScope(); + } + + static void LeaveGCForbiddenScope() { + ThreadState::Current()->LeaveGCForbiddenScope(); + } + + template <typename T, typename Traits> + static void Trace(Visitor* visitor, const T& t) { + TraceCollectionIfEnabled<WTF::WeakHandlingTrait<T>::value, T, + Traits>::Trace(visitor, &t); + } + + template <typename T> + static void TraceVectorBacking(Visitor* visitor, + const T* backing, + const T* const* backing_slot) { + visitor->TraceMovablePointer(backing_slot); + visitor->Trace(reinterpret_cast<const HeapVectorBacking<T>*>(backing)); + } + + template <typename T, typename HashTable> + static void TraceHashTableBackingStrongly(Visitor* visitor, + const T* backing, + const T* const* backing_slot) { + visitor->TraceMovablePointer(backing_slot); + visitor->Trace( + reinterpret_cast<const HeapHashTableBacking<HashTable>*>(backing)); + } + + template <typename T, typename HashTable> + static void TraceHashTableBackingWeakly(Visitor* visitor, + const T* backing, + const T* const* backing_slot, + WeakCallback callback, + const void* parameter) { + visitor->TraceMovablePointer(backing_slot); + visitor->TraceWeakContainer( + reinterpret_cast<const HeapHashTableBacking<HashTable>*>(backing), + reinterpret_cast<const HeapHashTableBacking<HashTable>* const*>( + backing_slot), + TraceTrait<HeapHashTableBacking<HashTable>>::GetTraceDescriptor( + backing), + TraceTrait<HeapHashTableBacking<HashTable>>::GetWeakTraceDescriptor( + backing), + callback, parameter); + } + + template <typename T> + static void BackingWriteBarrier(T** slot) { + MarkingVisitor::WriteBarrier(reinterpret_cast<void**>(slot)); + } + + static void TraceBackingStoreIfMarked(const void* object) { + MarkingVisitor::RetraceObject(object); + } + + template <typename T, typename Traits> + static void NotifyNewObject(T* object) { + MarkingVisitor::WriteBarrier( + []() { return ThreadState::Current(); }, object, sizeof(T), 1, + TraceCollectionIfEnabled<WTF::kNoWeakHandling, T, Traits>::Trace); + } + + template <typename T, typename Traits> + static void NotifyNewObjects(T* array, size_t len) { + MarkingVisitor::WriteBarrier( + []() { return ThreadState::Current(); }, array, sizeof(T), len, + TraceCollectionIfEnabled<WTF::kNoWeakHandling, T, Traits>::Trace); + } + + private: + static void BackingFree(void*); + static bool BackingExpand(void*, size_t); + static bool BackingShrink(void*, + size_t quantized_current_size, + size_t quantized_shrunk_size); +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_HEAP_ALLOCATOR_IMPL_H_
diff --git a/third_party/blink/renderer/platform/heap/impl/member.h b/third_party/blink/renderer/platform/heap/impl/member.h index 17dd6db..f9c8fe7 100644 --- a/third_party/blink/renderer/platform/heap/impl/member.h +++ b/third_party/blink/renderer/platform/heap/impl/member.h
@@ -10,6 +10,7 @@ #include "third_party/blink/renderer/platform/heap/impl/heap_page.h" #include "third_party/blink/renderer/platform/heap/impl/marking_visitor.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +#include "third_party/blink/renderer/platform/wtf/construct_traits.h" #include "third_party/blink/renderer/platform/wtf/hash_functions.h" #include "third_party/blink/renderer/platform/wtf/hash_traits.h"
diff --git a/third_party/blink/renderer/platform/heap/impl/persistent.h b/third_party/blink/renderer/platform/heap/impl/persistent.h index 00cff273..09ef3bc1 100644 --- a/third_party/blink/renderer/platform/heap/impl/persistent.h +++ b/third_party/blink/renderer/platform/heap/impl/persistent.h
@@ -886,86 +886,4 @@ } // namespace blink -namespace WTF { - -template < - typename T, - blink::WeaknessPersistentConfiguration weaknessConfiguration, - blink::CrossThreadnessPersistentConfiguration crossThreadnessConfiguration> -struct VectorTraits<blink::PersistentBase<T, - weaknessConfiguration, - crossThreadnessConfiguration>> - : VectorTraitsBase<blink::PersistentBase<T, - weaknessConfiguration, - crossThreadnessConfiguration>> { - STATIC_ONLY(VectorTraits); - static const bool kNeedsDestruction = true; - static const bool kCanInitializeWithMemset = true; - static const bool kCanClearUnusedSlotsWithMemset = false; - static const bool kCanMoveWithMemcpy = true; -}; - -template <typename T> -struct HashTraits<blink::Persistent<T>> - : HandleHashTraits<T, blink::Persistent<T>> {}; - -template <typename T> -struct HashTraits<blink::CrossThreadPersistent<T>> - : HandleHashTraits<T, blink::CrossThreadPersistent<T>> {}; - -template <typename T> -struct DefaultHash<blink::Persistent<T>> { - STATIC_ONLY(DefaultHash); - using Hash = MemberHash<T>; -}; - -template <typename T> -struct DefaultHash<blink::WeakPersistent<T>> { - STATIC_ONLY(DefaultHash); - using Hash = MemberHash<T>; -}; - -template <typename T> -struct DefaultHash<blink::CrossThreadPersistent<T>> { - STATIC_ONLY(DefaultHash); - using Hash = MemberHash<T>; -}; - -template <typename T> -struct DefaultHash<blink::CrossThreadWeakPersistent<T>> { - STATIC_ONLY(DefaultHash); - using Hash = MemberHash<T>; -}; - -template <typename T> -struct CrossThreadCopier<blink::CrossThreadPersistent<T>> - : public CrossThreadCopierPassThrough<blink::CrossThreadPersistent<T>> { - STATIC_ONLY(CrossThreadCopier); -}; - -template <typename T> -struct CrossThreadCopier<blink::CrossThreadWeakPersistent<T>> - : public CrossThreadCopierPassThrough<blink::CrossThreadWeakPersistent<T>> { - STATIC_ONLY(CrossThreadCopier); -}; - -} // namespace WTF - -namespace base { - -template <typename T> -struct IsWeakReceiver<blink::WeakPersistent<T>> : std::true_type {}; - -template <typename T> -struct IsWeakReceiver<blink::CrossThreadWeakPersistent<T>> : std::true_type {}; - -template <typename T> -struct BindUnwrapTraits<blink::CrossThreadWeakPersistent<T>> { - static blink::CrossThreadPersistent<T> Unwrap( - const blink::CrossThreadWeakPersistent<T>& wrapped) { - return blink::CrossThreadPersistent<T>(wrapped); - } -}; -} // namespace base - #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_IMPL_PERSISTENT_H_
diff --git a/third_party/blink/renderer/platform/heap/member.h b/third_party/blink/renderer/platform/heap/member.h index 82e4557..d01f2714 100644 --- a/third_party/blink/renderer/platform/heap/member.h +++ b/third_party/blink/renderer/platform/heap/member.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_MEMBER_H_ #include "third_party/blink/renderer/platform/wtf/buildflags.h" +#include "third_party/blink/renderer/platform/wtf/hash_traits.h" #if BUILDFLAG(USE_V8_OILPAN) #include "third_party/blink/renderer/platform/heap/v8_wrapper/member.h" @@ -13,4 +14,108 @@ #include "third_party/blink/renderer/platform/heap/impl/member.h" #endif // !USE_V8_OILPAN +namespace WTF { + +template <typename T> +struct HashTraits<blink::Member<T>> : SimpleClassHashTraits<blink::Member<T>> { + STATIC_ONLY(HashTraits); + // FIXME: Implement proper const'ness for iterator types. Requires support + // in the marking Visitor. + using PeekInType = T*; + using IteratorGetType = blink::Member<T>*; + using IteratorConstGetType = const blink::Member<T>*; + using IteratorReferenceType = blink::Member<T>&; + using IteratorConstReferenceType = const blink::Member<T>&; + static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { + return *x; + } + static IteratorConstReferenceType GetToReferenceConstConversion( + IteratorConstGetType x) { + return *x; + } + + using PeekOutType = T*; + + template <typename U> + static void Store(const U& value, blink::Member<T>& storage) { + storage = value; + } + + static PeekOutType Peek(const blink::Member<T>& value) { return value; } + + static void ConstructDeletedValue(blink::Member<T>& slot, bool) { + slot = WTF::kHashTableDeletedValue; + } + + static constexpr bool kCanTraceConcurrently = true; +}; + +template <typename T> +struct HashTraits<blink::WeakMember<T>> + : SimpleClassHashTraits<blink::WeakMember<T>> { + STATIC_ONLY(HashTraits); + static const bool kNeedsDestruction = false; + // FIXME: Implement proper const'ness for iterator types. Requires support + // in the marking Visitor. + using PeekInType = T*; + using IteratorGetType = blink::WeakMember<T>*; + using IteratorConstGetType = const blink::WeakMember<T>*; + using IteratorReferenceType = blink::WeakMember<T>&; + using IteratorConstReferenceType = const blink::WeakMember<T>&; + static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { + return *x; + } + static IteratorConstReferenceType GetToReferenceConstConversion( + IteratorConstGetType x) { + return *x; + } + + using PeekOutType = T*; + + template <typename U> + static void Store(const U& value, blink::WeakMember<T>& storage) { + storage = value; + } + + static PeekOutType Peek(const blink::WeakMember<T>& value) { return value; } + + static void ConstructDeletedValue(blink::WeakMember<T>& slot, bool) { + slot = WTF::kHashTableDeletedValue; + } + + static constexpr bool kCanTraceConcurrently = true; +}; + +template <typename T> +struct HashTraits<blink::UntracedMember<T>> + : SimpleClassHashTraits<blink::UntracedMember<T>> { + STATIC_ONLY(HashTraits); + static const bool kNeedsDestruction = false; + // FIXME: Implement proper const'ness for iterator types. + using PeekInType = T*; + using IteratorGetType = blink::UntracedMember<T>*; + using IteratorConstGetType = const blink::UntracedMember<T>*; + using IteratorReferenceType = blink::UntracedMember<T>&; + using IteratorConstReferenceType = const blink::UntracedMember<T>&; + static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { + return *x; + } + static IteratorConstReferenceType GetToReferenceConstConversion( + IteratorConstGetType x) { + return *x; + } + using PeekOutType = T*; + + template <typename U> + static void Store(const U& value, blink::UntracedMember<T>& storage) { + storage = value; + } + + static PeekOutType Peek(const blink::UntracedMember<T>& value) { + return value; + } +}; + +} // namespace WTF + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_MEMBER_H_
diff --git a/third_party/blink/renderer/platform/heap/persistent.h b/third_party/blink/renderer/platform/heap/persistent.h index d3815f9..ff2311d3 100644 --- a/third_party/blink/renderer/platform/heap/persistent.h +++ b/third_party/blink/renderer/platform/heap/persistent.h
@@ -13,4 +13,115 @@ #include "third_party/blink/renderer/platform/heap/impl/persistent.h" #endif // !USE_V8_OILPAN +namespace WTF { + +template < + typename T, + blink::WeaknessPersistentConfiguration weaknessConfiguration, + blink::CrossThreadnessPersistentConfiguration crossThreadnessConfiguration> +struct VectorTraits<blink::PersistentBase<T, + weaknessConfiguration, + crossThreadnessConfiguration>> + : VectorTraitsBase<blink::PersistentBase<T, + weaknessConfiguration, + crossThreadnessConfiguration>> { + STATIC_ONLY(VectorTraits); + static const bool kNeedsDestruction = true; + static const bool kCanInitializeWithMemset = true; + static const bool kCanClearUnusedSlotsWithMemset = false; + static const bool kCanMoveWithMemcpy = true; +}; + +template <typename T, typename H> +struct HandleHashTraits : SimpleClassHashTraits<H> { + STATIC_ONLY(HandleHashTraits); + // TODO: Implement proper const'ness for iterator types. Requires support + // in the marking Visitor. + using PeekInType = T*; + using IteratorGetType = H*; + using IteratorConstGetType = const H*; + using IteratorReferenceType = H&; + using IteratorConstReferenceType = const H&; + static IteratorReferenceType GetToReferenceConversion(IteratorGetType x) { + return *x; + } + static IteratorConstReferenceType GetToReferenceConstConversion( + IteratorConstGetType x) { + return *x; + } + + using PeekOutType = T*; + + template <typename U> + static void Store(const U& value, H& storage) { + storage = value; + } + + static PeekOutType Peek(const H& value) { return value; } +}; + +template <typename T> +struct HashTraits<blink::Persistent<T>> + : HandleHashTraits<T, blink::Persistent<T>> {}; + +template <typename T> +struct HashTraits<blink::CrossThreadPersistent<T>> + : HandleHashTraits<T, blink::CrossThreadPersistent<T>> {}; + +template <typename T> +struct DefaultHash<blink::Persistent<T>> { + STATIC_ONLY(DefaultHash); + using Hash = MemberHash<T>; +}; + +template <typename T> +struct DefaultHash<blink::WeakPersistent<T>> { + STATIC_ONLY(DefaultHash); + using Hash = MemberHash<T>; +}; + +template <typename T> +struct DefaultHash<blink::CrossThreadPersistent<T>> { + STATIC_ONLY(DefaultHash); + using Hash = MemberHash<T>; +}; + +template <typename T> +struct DefaultHash<blink::CrossThreadWeakPersistent<T>> { + STATIC_ONLY(DefaultHash); + using Hash = MemberHash<T>; +}; + +template <typename T> +struct CrossThreadCopier<blink::CrossThreadPersistent<T>> + : public CrossThreadCopierPassThrough<blink::CrossThreadPersistent<T>> { + STATIC_ONLY(CrossThreadCopier); +}; + +template <typename T> +struct CrossThreadCopier<blink::CrossThreadWeakPersistent<T>> + : public CrossThreadCopierPassThrough<blink::CrossThreadWeakPersistent<T>> { + STATIC_ONLY(CrossThreadCopier); +}; + +} // namespace WTF + +namespace base { + +template <typename T> +struct IsWeakReceiver<blink::WeakPersistent<T>> : std::true_type {}; + +template <typename T> +struct IsWeakReceiver<blink::CrossThreadWeakPersistent<T>> : std::true_type {}; + +template <typename T> +struct BindUnwrapTraits<blink::CrossThreadWeakPersistent<T>> { + static blink::CrossThreadPersistent<T> Unwrap( + const blink::CrossThreadWeakPersistent<T>& wrapped) { + return blink::CrossThreadPersistent<T>(wrapped); + } +}; + +} // namespace base + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_PERSISTENT_H_
diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/garbage_collected.h b/third_party/blink/renderer/platform/heap/v8_wrapper/garbage_collected.h index 30a62187..a06d0e7 100644 --- a/third_party/blink/renderer/platform/heap/v8_wrapper/garbage_collected.h +++ b/third_party/blink/renderer/platform/heap/v8_wrapper/garbage_collected.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_GARBAGE_COLLECTED_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_GARBAGE_COLLECTED_H_ +#include "v8/include/cppgc/garbage-collected.h" #include "v8/include/cppgc/type-traits.h" // GC_PLUGIN_IGNORE is used to make the plugin ignore a particular class or @@ -20,6 +21,8 @@ namespace blink { +using GarbageCollectedMixin = cppgc::GarbageCollectedMixin; + template <typename T> struct IsGarbageCollectedMixin { public:
diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/heap.h b/third_party/blink/renderer/platform/heap/v8_wrapper/heap.h index 30dc9f55..c16ea2e6 100644 --- a/third_party/blink/renderer/platform/heap/v8_wrapper/heap.h +++ b/third_party/blink/renderer/platform/heap/v8_wrapper/heap.h
@@ -14,8 +14,6 @@ template <typename T> using GarbageCollected = cppgc::GarbageCollected<T>; -using GarbageCollectedMixin = cppgc::GarbageCollectedMixin; - // Default MakeGarbageCollected: Constructs an instance of T, which is a garbage // collected type. template <typename T, typename... Args>
diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/thread_state.h b/third_party/blink/renderer/platform/heap/v8_wrapper/thread_state.h index 3b3cb82..fd5d6bba 100644 --- a/third_party/blink/renderer/platform/heap/v8_wrapper/thread_state.h +++ b/third_party/blink/renderer/platform/heap/v8_wrapper/thread_state.h
@@ -70,6 +70,11 @@ return allocation_handle_; } ALWAYS_INLINE v8::CppHeap& cpp_heap() const { return cpp_heap_; } + ALWAYS_INLINE v8::Isolate* GetIsolate() const { + // TODO(1056170): Refer to cpp_heap_ once getter for v8::Isolate is + // implemented. + return nullptr; + } private: // Main-thread ThreadState avoids TLS completely by using a regular global.
diff --git a/third_party/blink/renderer/platform/weborigin/security_origin_test.cc b/third_party/blink/renderer/platform/weborigin/security_origin_test.cc index b88f8e9..ccbc3f3 100644 --- a/third_party/blink/renderer/platform/weborigin/security_origin_test.cc +++ b/third_party/blink/renderer/platform/weborigin/security_origin_test.cc
@@ -47,6 +47,7 @@ #include "third_party/blink/renderer/platform/wtf/text/string_operators.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "url/gurl.h" +#include "url/origin_abstract_tests.h" #include "url/url_util.h" namespace blink { @@ -909,24 +910,6 @@ EXPECT_TRUE(origin->IsOpaque()); } -TEST_F(SecurityOriginTest, NonStandardSchemeWithAndroidWebViewHack) { - url::ScopedSchemeRegistryForTests scoped_registry; - url::EnableNonStandardSchemesForAndroidWebView(); - - // Regression test for https://crbug.com/896059. - scoped_refptr<const SecurityOrigin> origin = - SecurityOrigin::CreateFromString("cow://"); - EXPECT_FALSE(origin->IsOpaque()); - EXPECT_EQ("cow", origin->Protocol()); - EXPECT_EQ("", origin->Host()); - EXPECT_EQ(0, origin->Port()); - - // about:blank translates into an opaque origin, even in presence of - // EnableNonStandardSchemesForAndroidWebView. - origin = SecurityOrigin::CreateFromString("about:blank"); - EXPECT_TRUE(origin->IsOpaque()); -} - TEST_F(SecurityOriginTest, OpaqueIsolatedCopy) { scoped_refptr<const SecurityOrigin> origin = SecurityOrigin::CreateUniqueOpaque(); @@ -1214,3 +1197,38 @@ } } // namespace blink + +// Apparently INSTANTIATE_TYPED_TEST_SUITE_P needs to be used in the same +// namespace as where the typed test suite was defined. +namespace url { + +class BlinkSecurityOriginTestTraits final + : public url::OriginTraitsBase<scoped_refptr<blink::SecurityOrigin>> { + public: + OriginType CreateOriginFromString(base::StringPiece s) const override { + return blink::SecurityOrigin::CreateFromString( + String(s.data(), s.length())); + } + + bool IsOpaque(const OriginType& origin) const override { + return origin->IsOpaque(); + } + + std::string GetScheme(const OriginType& origin) const override { + return origin->Protocol().Utf8(); + } + + std::string GetHost(const OriginType& origin) const override { + return origin->Host().Utf8(); + } + + uint16_t GetPort(const OriginType& origin) const override { + return origin->Port(); + } +}; + +INSTANTIATE_TYPED_TEST_SUITE_P(BlinkSecurityOrigin, + AbstractOriginTest, + BlinkSecurityOriginTestTraits); + +} // namespace url
diff --git a/third_party/blink/renderer/platform/wtf/allocator/partitions.cc b/third_party/blink/renderer/platform/wtf/allocator/partitions.cc index e8b3b486..e565020 100644 --- a/third_party/blink/renderer/platform/wtf/allocator/partitions.cc +++ b/third_party/blink/renderer/platform/wtf/allocator/partitions.cc
@@ -34,7 +34,6 @@ #include "base/allocator/partition_allocator/memory_reclaimer.h" #include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/page_allocator.h" -#include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/partition_alloc_features.h" #include "base/debug/alias.h" #include "base/no_destructor.h" @@ -49,7 +48,7 @@ const char* const Partitions::kAllocatedObjectPoolName = "partition_alloc/allocated_objects"; -#if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR +#if ALLOW_PCSCAN // Runs PCScan on WTF partitions. const base::Feature kPCScanBlinkPartitions{"PCScanBlinkPartitions", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -106,8 +105,8 @@ buffer_root_ = buffer_allocator->root(); layout_root_ = layout_allocator->root(); -#if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR - if (base::features::IsPartitionAllocPCScanEnabled() || +#if ALLOW_PCSCAN + if (base::FeatureList::IsEnabled(base::features::kPartitionAllocPCScan) || base::FeatureList::IsEnabled(kPCScanBlinkPartitions)) { #if !BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) fast_malloc_root_->EnablePCScan();
diff --git a/third_party/blink/renderer/platform/wtf/type_traits.h b/third_party/blink/renderer/platform/wtf/type_traits.h index 2425fa6..e3be874 100644 --- a/third_party/blink/renderer/platform/wtf/type_traits.h +++ b/third_party/blink/renderer/platform/wtf/type_traits.h
@@ -134,6 +134,9 @@ cppgc::IsMemberTypeV<T> || cppgc::IsWeakMemberTypeV<T>> {}; +template <typename T> +struct IsMemberType : std::integral_constant<bool, cppgc::IsMemberTypeV<T>> {}; + #else // !USE_V8_OILPAN namespace internal { @@ -226,6 +229,12 @@ WTF::IsSubclassOfTemplate<T, blink::Member>::value || WTF::IsSubclassOfTemplate<T, blink::WeakMember>::value> {}; +template <typename T> +struct IsMemberType : std::integral_constant< + bool, + WTF::IsSubclassOfTemplate<T, blink::Member>::value> { +}; + #endif // !USE_V8_OILPAN // Convenience template wrapping the IsTraceableInCollection template in
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index dcb8390..7fc9eb7af 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -2183,6 +2183,7 @@ # These tests require a physical device connected. external/wpt/webusb/usbDevice_claimInterface-manual.https.html [ Skip ] +external/wpt/webusb/usbDevice_transferIn-manual.https.html [ Skip ] wpt_internal/hid/hidDevice_collections-manual.https.html [ Skip ] external/wpt/serial/serialPort_loopback-manual.https.html [ Skip ] external/wpt/serial/serialPort_loopback_BreakError-manual.https.html [ Skip ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index ab33847..31e6d605 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1060,7 +1060,6 @@ crbug.com/1079031 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-width-003.xht [ Crash Failure Timeout ] crbug.com/829028 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-width-004.html [ Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/abspos-new-width-rebalance.html [ Crash Failure ] -crbug.com/1066616 virtual/layout_ng_block_frag/fast/multicol/border-radius-clipped-layer-second-column.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/client-rect-nested.html [ Failure ] crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/composited-layer-multiple-fragments-translated.html [ Failure Crash ] crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/composited-layer-multiple-fragments.html [ Failure Crash ] @@ -2042,9 +2041,6 @@ # Need to support 'direction: rtl' for scroll snap crbug.com/1012173 external/wpt/css/css-scroll-snap/snap-after-initial-layout/direction-rtl.html [ Failure ] -# Hit a DCHECK -crbug.com/918664 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-table-1a.html [ Failure Pass ] - # WebVTT is off because additional padding crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up.html [ Failure ] crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html [ Failure ] @@ -2471,6 +2467,8 @@ crbug.com/958381 [ Mac ] external/wpt/css/CSS2/tables/table-anonymous-objects-206.xht [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Mac10.13 ] external/wpt/x-frame-options/multiple.html [ Timeout ] +crbug.com/626703 [ Mac10.13 ] external/wpt/FileAPI/idlharness.worker.html [ Timeout ] crbug.com/626703 external/wpt/css/css-sizing/aspect-ratio/table-element-001.html [ Failure ] crbug.com/626703 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-025.html [ Failure ] crbug.com/626703 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-026.html [ Failure ] @@ -5939,9 +5937,8 @@ # Failing on Webkit Linux Leak only: crbug.com/1046784 http/tests/devtools/tracing/timeline-receive-response-event.js [ Pass Failure ] -# Sheriff 2021-01-21 -crbug.com/1164166 [ Linux ] virtual/synchronous_html_parser/external/wpt/preload/avoid-prefetching-on-text-plain.html [ Pass Failure ] # Sheriff 2021-01-08 crbug.com/1164459 [ Mac ] virtual/synchronous_html_parser/external/wpt/preload/download-resources.html [ Pass Timeout ] +crbug.com/1164568 [ Mac ] external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin-allow-popups-report-to.https.html [ Pass Failure ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index dfd763af..fb0c736f 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -58874,7 +58874,7 @@ ] ], "content-visibility-003.html": [ - "08eb3a1288b5610cdbefad23f8c02e9e50e4e0b8", + "5109c720b4bb8c91b0dd71e4356cb3d586419cd9", [ null, [ @@ -62548,6 +62548,19 @@ {} ] ], + "flex-aspect-ratio-img-column-018.html": [ + "04b12875c05b6ba2e3871271ec365bfe1d7d345f", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], "flex-aspect-ratio-img-row-001.html": [ "14fabf760ca4293abf5af9e618b2e2ed627be2b2", [ @@ -62704,6 +62717,19 @@ {} ] ], + "flex-aspect-ratio-img-row-015.html": [ + "e28829036052006620ae2d00478d12322ce3cdbc", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], "flex-base.html": [ "93401d3fe32716ca14a3f7f3be4f0fa64a7fabf2", [ @@ -84525,7 +84551,7 @@ ] ], "clip-path-descendant-text-mutated-001.html": [ - "e41dacc0b54f3f1936d23b3fb6204f394395db37", + "8753a25f1e4e56cb72d3389533ac96c633dda115", [ null, [ @@ -147565,7 +147591,7 @@ ] ], "remove-filter-repaint.html": [ - "a9af9db34eeaf10235521514f8c17ceca858924e", + "2e85f9f542a9feb19ab3512d3670cfe89914676b", [ null, [ @@ -147682,7 +147708,7 @@ ] ], "svg-mutation-drop-shadow-color.html": [ - "fe8bf7ec5fe284608a4ba329681a12c17c82437d", + "6db3beb35c593de4f92f9b9f50afa1d3a9c3d5c5", [ null, [ @@ -147695,7 +147721,7 @@ ] ], "svg-mutation-drop-shadow-offset.html": [ - "2d5a12906d89a8fcd09ffb19e310e32da42441a1", + "d67b29820cd111366e751cf2061b36470406b354", [ null, [ @@ -147708,7 +147734,7 @@ ] ], "svg-mutation-function-to-url.html": [ - "61d657bfb2b3f80884a81d7b9dac5597d02dbff3", + "cd2f61f3488d40c3456bbcd72d1bc6d8867a10e6", [ null, [ @@ -147721,7 +147747,7 @@ ] ], "svg-mutation-group-position-changed.html": [ - "5a73f6eefc04343fbe73cfc5ccfdff5b86050f87", + "c83c636d9b1b01907fc8f82a8f660b10fe610be5", [ null, [ @@ -147734,7 +147760,7 @@ ] ], "svg-mutation-group-size-changed.html": [ - "0486ec0806ba697da4ad3d7a62e6f0dcd7d1c2ff", + "755343c2ba78bc671fb7b1dba37278f1b2aa0ca9", [ null, [ @@ -147747,7 +147773,7 @@ ] ], "svg-mutation-group-transform-changed.html": [ - "f0ff16e7c8932f68c5c53955cab4fd500d445401", + "212ecf7b653fbd4e99ecf5790f8ac41225e5bdb4", [ null, [ @@ -147760,7 +147786,7 @@ ] ], "svg-mutation-object-position-changed.html": [ - "76b75fc329868cb1597dd375052653e135c8c3eb", + "2f0225439d7565394d41988637078f94fa6c2a24", [ null, [ @@ -147773,7 +147799,7 @@ ] ], "svg-mutation-object-size-changed.html": [ - "2d55387b73f91b347f5a48e12f256208e2a215b0", + "1604ba9d13b6a41c92482c850d4b692b0d73040f", [ null, [ @@ -147786,7 +147812,7 @@ ] ], "svg-mutation-object-transform-changed.html": [ - "75a82b1d964cc3131322c1e26b193b905cd1f4ef", + "21f5683a2ba12d28c2fc511ce3b55386afc9d616", [ null, [ @@ -147799,7 +147825,7 @@ ] ], "svg-mutation-single-to-multiple-001.html": [ - "13da58c03ac26078fa0ad8be0ccfc690a4717dc3", + "58129dff8f6e2de4d3485680509276f5f6d293b2", [ null, [ @@ -147812,7 +147838,7 @@ ] ], "svg-mutation-single-to-multiple-002.html": [ - "d7769a7cfd6a0986c15a40c0df8ca96a16069c7d", + "918cf7e0e95d8366224075c8c3dcd658febb982a", [ null, [ @@ -147825,7 +147851,7 @@ ] ], "svg-mutation-url-to-function.html": [ - "fb08d8409ed382324c8752f9587c8d3244632a56", + "65b3b817d503562de24a5150453dcca02a984e28", [ null, [ @@ -172473,7 +172499,7 @@ [] ], "META.yml": [ - "8f27e484996c51eb9ebbbd96902fa1f885af7be0", + "7cae5c0f90396f6e3a0bcd5f34935550f08c4b84", [] ], "OWNERS": [ @@ -196770,7 +196796,7 @@ [] ], "list-style-image-zoom-dynamic-ref.html": [ - "9c4d876c4ad8a189f83abc26059744315c66dc3c", + "09baac4663a16dbc43b6147848a2b16b39b71815", [] ], "list-style-type-string-001-ref.html": [ @@ -200154,7 +200180,7 @@ [] ], "nested-overflow-subtree-layout-ref.html": [ - "77b0de7f0ba16a35398c3a8d583c5bda32bf16af", + "003cb9b68a15dae2c4888e2d988834fdd92793e6", [] ], "support": { @@ -236906,7 +236932,7 @@ ] }, "lint.ignore": [ - "31cb00022d3002508f794a29841efd28b0639a4b", + "27ba5497065c7858248f99a063ffe57b932c0df0", [] ], "loading": { @@ -241084,11 +241110,11 @@ [] ], "focus-page-with-button.html": [ - "2bf0ddb93933a492b209b28d8767e3885350496f", + "067221965100181411b1e876c125d59822605a38", [] ], "focus-page-with-x-origin-iframe.sub.html": [ - "7c9df9dba643a8202529d9f0b154a504535d7bcb", + "9807898a3543eca03ed03432442fc9caad2b9553", [] ], "invalid.asis": [ @@ -243584,7 +243610,7 @@ [] ], "webusb-test.js": [ - "8bccfd1f724cc622619e024b95c7068b2899ff07", + "f6a793dc956a0ba9f8d23fc0023eaf98680b1fd5", [] ], "webusb-test.js.headers": [ @@ -247579,6 +247605,10 @@ [] ], "animations": { + "animate-marker-orient-from-auto-to-auto-start-reverse-expected.txt": [ + "7b490dde326183f19676284bc3207c3d00598b5f", + [] + ], "animateMotion-base-expected.txt": [ "729d384cc2270a4d343b0a4af5c07551af9f6c92", [] @@ -248536,6 +248566,10 @@ "48365c539fffe9049f04e809ddb52a32a629703a", [] ], + "SVGAnimatedEnumeration-SVGMarkerElement-expected.txt": [ + "ae149d8d347a083b30f4eb831ec4990021cc3a43", + [] + ], "SVGAnimatedRect-expected.txt": [ "cdc41ca795298f0cac130afa8ea317a1403ab290", [] @@ -248896,11 +248930,11 @@ [] ], "lint.py": [ - "38225ec958862ec793656013226cc03d469b853d", + "1872e62725993bd16ee7c57236b40dd000731e74", [] ], "rules.py": [ - "f6e23aef58ad3a97a0ba8bf5514cb802f2e0f31b", + "b389e3d8f0854cc34c84e7cc98c7096fefd2f2ee", [] ] }, @@ -248948,7 +248982,7 @@ [] ], "sourcefile.py": [ - "6e90ac05475fc656de22befc5addc3fd5f51e913", + "ce81c625bb805a329d9c1a9b764b15d98a57a26c", [] ], "testpaths.py": [ @@ -249082,7 +249116,7 @@ [] ], "runner.js": [ - "27946e139b9aa3b806a1ad245153988cf78f7442", + "1577228b2fbca0038d3cc74b93087fabf6059457", [] ], "update_manifest.py": [ @@ -259169,7 +259203,7 @@ [] ], "authentication.py": [ - "25a8eb95d11402e2aa97bc3d70e0464330cbb129", + "e61eef0696ca2145cffdfa87a02b7aa0e8817867", [] ], "defaults.py": [ @@ -259591,7 +259625,7 @@ [] ], "RTCRtpTransceiver-stop-expected.txt": [ - "85ff9f1cffcadd652996a92e672c8e618349f2a6", + "542849df0ce8e7af3fa1e76c279bb926f14f7b1b", [] ], "RTCRtpTransceiver.https-expected.txt": [ @@ -260186,7 +260220,7 @@ [] ], "send-backpressure_wsh.py": [ - "40905c31cff4c9930320205149a47ef416b7951c", + "e59070c3002e06f2566a53f091709eaa5f498e58", [] ], "set-cookie-secure_wsh.py": [ @@ -261086,7 +261120,7 @@ [] ], "usb-helpers.js": [ - "bb6745124788ba3626b2bda563693d5e1c51c936", + "8525da74b559cb776b2a91529c5e47a8c47984d3", [] ] }, @@ -315167,7 +315201,14 @@ ] ], "focus-in-focus-event-001.html": [ - "0639b7785eb3c3eacb4e4478557caf80a3f7511e", + "2f9a3dde5783f09c102b6fd74aaa7f2950cfdcd3", + [ + null, + {} + ] + ], + "focus-in-focusin-event-001.html": [ + "e18401fcf37747f96334bba996dd307f5b71d44e", [ null, {} @@ -315878,7 +315919,7 @@ ] ], "parse-not.html": [ - "e96db5a83ce021dde4a3b20de6a80374e7fd4914", + "f455059251ae99264ce928338846980357ba9ca7", [ null, {} @@ -338721,7 +338762,7 @@ ] }, "request-bad-port.any.js": [ - "afb02aea8b2ee978296607c2b2429bac6dc40bc3", + "31a08eaa929bea49b75cee971e0f9342045dcd8f", [ "fetch/api/request/request-bad-port.any.html", { @@ -398935,7 +398976,7 @@ ] ], "avoid-prefetching-on-text-plain.html": [ - "487cbbcaba75285ae6dd381fefe39b061ae6464f", + "45564e1bfaca07f2ea21bf460132c7f18ed6a24a", [ null, {} @@ -423761,7 +423802,7 @@ ] ], "animate-marker-orient-from-auto-to-auto-start-reverse.html": [ - "fedfe4a8c2818a335fe26ff5a7e6cce52abef02a", + "b7a4e68562da576fc2ea0221c51f19afaa879ad7", [ null, {} @@ -426272,7 +426313,7 @@ ] ], "SVGAnimatedEnumeration-SVGMarkerElement.html": [ - "7ac884ae3e5052d40a60521a5c6b91eb854b4e4c", + "dfc9dd248007c9e87ca8177167f4b4f1cf9f2e75", [ null, {} @@ -439265,7 +439306,7 @@ ] ], "RTCRtpTransceiver-stop.html": [ - "60f6d0c13357b56a6e24ce4d5f29067e2683f492", + "766b34d7b120f0e214ac028cd1f5b82c9c78062c", [ null, {} @@ -440200,7 +440241,7 @@ ] ], "Create-blocked-port.any.js": [ - "84728c0e5675900bb6a0457196d5aee3629a8699", + "0e8938a3d56828fd0263e6a98e2a2e9eddd31512", [ "websockets/Create-blocked-port.any.html", { @@ -443419,7 +443460,7 @@ ] ], "backpressure-receive.any.js": [ - "17c75bd51cd204f3910b757cfda1e0a9fd0f5394", + "662a6a2871b8f0c390c5ba1dfb85f742a6549186", [ "websockets/stream/tentative/backpressure-receive.any.html", {
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/META.yml b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/META.yml index 8f27e48..7cae5c0f 100644 --- a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/META.yml +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/META.yml
@@ -1,3 +1 @@ spec: https://w3c.github.io/webcrypto/ -suggested_reviewers: - - jimsch
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/out-of-flow-in-multicolumn-014-ref.html b/third_party/blink/web_tests/external/wpt/css/css-break/out-of-flow-in-multicolumn-014-ref.html new file mode 100644 index 0000000..6388a186 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-break/out-of-flow-in-multicolumn-014-ref.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<style> +div { + height: 300px; + width: 300px; + background-color: green; +} +</style> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/out-of-flow-in-multicolumn-014.html b/third_party/blink/web_tests/external/wpt/css/css-break/out-of-flow-in-multicolumn-014.html new file mode 100644 index 0000000..b6cede0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-break/out-of-flow-in-multicolumn-014.html
@@ -0,0 +1,32 @@ +<!DOCTYPE html> +<link rel="help" href="https://www.w3.org/TR/css-position-3/#abspos-breaking"> +<!-- This test requires a 300px tall multicolumn to reproduce the issue. --> +<link rel="match" href="out-of-flow-in-multicolumn-014-ref.html"> +<!-- Fragmented OOF element with block-size percentage resolution and overflow. --> +<style> + #multicol { + columns: 2; + width: 300px; + height: 300px; + column-fill: auto; + column-gap: 0px; + background-color: red; + } + .rel { + position: relative; + } + .abs { + position: absolute; + top: 0px; + width: 150px; + height: 150px; + background: green; + } +</style> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div id="multicol"> + <div style="width: 150px; height: 450px; background-color: green;"></div> + <div class="rel"> + <div class="abs"></div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-003.html b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-003.html index 08eb3a1..5109c72 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-003.html
@@ -6,8 +6,6 @@ <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> <link rel="match" href="content-visibility-003-ref.html"> <meta name="assert" content="content-visibility container is not breakable"> -<script src="/common/reftest-wait.js"></script> -<script src="resources/utils.js"></script> <style> #container {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-lists/list-style-image-zoom-dynamic-ref.html b/third_party/blink/web_tests/external/wpt/css/css-lists/list-style-image-zoom-dynamic-ref.html index 9c4d876..09baac4 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-lists/list-style-image-zoom-dynamic-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-lists/list-style-image-zoom-dynamic-ref.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html class="reftest-waitt"> +<html class="reftest-wait"> <meta charset="utf-8"> <title>CSS Reference: Image list markers with dynamic zoom</title> <link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html b/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html index e41dacc..8753a25 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html +++ b/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<html class="reftest-wait"> <title>CSS Masking: Test ancestors update as text descendants change</title> <link rel="author" title="Fredrik Söderquist" href="mailto:fs@opera.com"> <link rel="help" href="https://drafts.fxtf.org/css-masking-1/#the-clip-path">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-scroll-anchoring/nested-overflow-subtree-layout-ref.html b/third_party/blink/web_tests/external/wpt/css/css-scroll-anchoring/nested-overflow-subtree-layout-ref.html index 77b0de7f..003cb9b6 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-scroll-anchoring/nested-overflow-subtree-layout-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-scroll-anchoring/nested-overflow-subtree-layout-ref.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<html class="reftest-wait"> <head> <link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring/"> @@ -36,7 +37,7 @@ requestAnimationFrame(() => { requestAnimationFrame(() => { outer.scrollTo(0, 70); - document.documentElement.removeAttribute("class"); + takeScreenshot(); }); }); };
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/remove-filter-repaint.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/remove-filter-repaint.html index a9af9db3..2e85f9f 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/remove-filter-repaint.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/remove-filter-repaint.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<html class="reftest-wait"> <html> <head> <title>CSS Filters: Repaint a compositing layer</title>
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-color.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-color.html index fe8bf7ec..6db3beb 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-color.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-color.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing color of drop-shadow() function on an SVG element</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-offset.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-offset.html index 2d5a1290..d67b2982 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-offset.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-drop-shadow-offset.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing offset of drop-shadow() function on an SVG element</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-function-to-url.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-function-to-url.html index 61d657bf..cd2f61f 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-function-to-url.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-function-to-url.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: switching from hue-rotate() to url() on an SVG element</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#filter-functions">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-position-changed.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-position-changed.html index 5a73f6e..c83c636 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-position-changed.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-position-changed.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing the position of an SVG group with filter</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-size-changed.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-size-changed.html index 0486ec0..755343c 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-size-changed.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-size-changed.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing the size of an SVG group with filter</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-transform-changed.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-transform-changed.html index f0ff16e7..212ecf7 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-transform-changed.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-group-transform-changed.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing the transform of an SVG group with filter</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-position-changed.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-position-changed.html index 76b75fc..2f02254 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-position-changed.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-position-changed.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing the position of an SVG element with filter</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-size-changed.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-size-changed.html index 2d55387b..1604ba9 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-size-changed.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-size-changed.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing the size of an SVG element with filter</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-transform-changed.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-transform-changed.html index 75a82b1..21f5683 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-transform-changed.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-object-transform-changed.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: changing the transform of an SVG element with filter</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-001.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-001.html index 13da58c..58129df 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-001.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-001.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: extending the filter chain with an additional function on SVG element</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-002.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-002.html index d7769a7..918cf7e0 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-002.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-single-to-multiple-002.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: extending the filter chain with an additional function on SVG element</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#funcdef-filter-drop-shadow">
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-url-to-function.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-url-to-function.html index fb08d840..65b3b81 100644 --- a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-url-to-function.html +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-mutation-url-to-function.html
@@ -1,4 +1,5 @@ <!doctype html> +<html class="reftest-wait"> <title>Filter Effects: switching from url() to hue-rotate() on an SVG element</title> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#filter-functions">
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focus-event-001.html b/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focus-event-001.html index 0639b77..2f9a3dd 100644 --- a/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focus-event-001.html +++ b/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focus-event-001.html
@@ -1,20 +1,31 @@ <!DOCTYPE html> <meta charset="utf-8"> -<title>Selectors Level 4: :focus in focus event</title> +<title>Selectors Level 4: :focus, :focus-visible and :focus-within in focus event</title> <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-pseudo"> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-visible-pseudo"> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo"> <link rel="help" href="https://w3c.github.io/uievents/#event-type-focus"> <link rel="help" href="https://crbug.com/523126"> <meta name='author' title='Takayoshi Kochi' href='mailto:kochi@chromium.org'> +<meta name='author' title='Manuel Rego Casasnovas' href='mailto:rego@igalia.com'> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <input type="text"> <script> var input = document.querySelector('input'); input.addEventListener('focus', function(e) { - var focused = document.querySelector(':focus'); + var focusPseudo = document.querySelector(':focus'); + var focusVisiblePseudo = document.querySelector(':focus-visible'); + var focusWithinPseudo = document.querySelector(':focus-within'); test(() => { - assert_equals(e.target, focused, "':focus' matches event.target"); + assert_equals(e.target, focusPseudo, "':focus' matches event.target"); }, "Checks that ':focus' pseudo-class matches inside 'focus' event handler"); + test(() => { + assert_equals(e.target, focusVisiblePseudo, "':focus-visible' matches event.target"); + }, "Checks that ':focus-visible' pseudo-class matches inside 'focus' event handler"); + test(() => { + assert_equals(document.documentElement, focusWithinPseudo, "':focus-within' matches document.documentElement"); + }, "Checks that ':focus-within' pseudo-class matches inside 'focus' event handler"); }, false); input.focus(); </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focusin-event-001.html b/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focusin-event-001.html new file mode 100644 index 0000000..e18401f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/focus-in-focusin-event-001.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Selectors Level 4: :focus, :focus-visible and :focus-within in focusin event</title> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-pseudo"> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-visible-pseudo"> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo"> +<link rel="help" href="https://w3c.github.io/uievents/#event-type-focusin"> +<meta name='author' title='Manuel Rego Casasnovas' href='mailto:rego@igalia.com'> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<input type="text"> +<script> +var input = document.querySelector('input'); +input.addEventListener('focusin', function(e) { + var focusPseudo = document.querySelector(':focus'); + var focusVisiblePseudo = document.querySelector(':focus-visible'); + var focusWithinPseudo = document.querySelector(':focus-within'); + test(() => { + assert_equals(e.target, focusPseudo, "':focus' matches event.target"); + }, "Checks that ':focus' pseudo-class matches inside 'focusin' event handler"); + test(() => { + assert_equals(e.target, focusVisiblePseudo, "':focus-visible' matches event.target"); + }, "Checks that ':focus-visible' pseudo-class matches inside 'focusin' event handler"); + test(() => { + assert_equals(document.documentElement, focusWithinPseudo, "':focus-within' matches document.documentElement"); + }, "Checks that ':focus-within' pseudo-class matches inside 'focusin' event handler"); +}, false); +input.focus(); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/parsing/parse-not.html b/third_party/blink/web_tests/external/wpt/css/selectors/parsing/parse-not.html index e96db5a..f455059 100644 --- a/third_party/blink/web_tests/external/wpt/css/selectors/parsing/parse-not.html +++ b/third_party/blink/web_tests/external/wpt/css/selectors/parsing/parse-not.html
@@ -24,6 +24,8 @@ test_valid_selector(':not(:host(.a))'); test_valid_selector(':host(:not(.a))'); test_valid_selector(':not(:host(:not(.a)))'); + test_valid_selector(':not([disabled][selected])', ':not([disabled][selected])'); + test_valid_selector(':not([disabled],[selected])', ':not([disabled], [selected])'); test_invalid_selector(':not()'); test_invalid_selector(':not(:not())');
diff --git a/third_party/blink/web_tests/external/wpt/preload/avoid-prefetching-on-text-plain.html b/third_party/blink/web_tests/external/wpt/preload/avoid-prefetching-on-text-plain.html index 487cbbc..45564e1 100644 --- a/third_party/blink/web_tests/external/wpt/preload/avoid-prefetching-on-text-plain.html +++ b/third_party/blink/web_tests/external/wpt/preload/avoid-prefetching-on-text-plain.html
@@ -23,8 +23,16 @@ urls.push(entry.name); } // If preloading is working correctly, should only see the text document - // represented in the performance information. - assert_array_equals(resource_types, ['navigation']); + // represented in the performance information. A 'resource' type indicates + // that we've prefetched something. + let resource_found = false; + for (const t of resource_types) { + if (t == "resource") { + resource_found = true; + break; + } + } + assert_false(resource_found, "no resources should be present"); assert_equals(urls.length, 1); assert_equals(urls[0].endsWith("avoid-prefetching-on-text-plain-inner.html"), true); done();
diff --git a/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse-expected.txt b/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse-expected.txt new file mode 100644 index 0000000..7b490dd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Animate SVGMarkerElement orientAttr from auto to auto-start-reverse assert_equals: expected (undefined) undefined but got (number) 0 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html b/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html index fedfe4a..b7a4e68 100644 --- a/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html +++ b/third_party/blink/web_tests/external/wpt/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html
@@ -76,7 +76,7 @@ assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon); assert_equals(marker.orientAngle.baseVal.value, 0); - assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN); + assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE); assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); } @@ -94,4 +94,4 @@ runAnimationTest(t, expectedValues); }); -</script> \ No newline at end of file +</script>
diff --git a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt b/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt new file mode 100644 index 0000000..ae149d8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Use of SVGAnimatedEnumeration within SVGMarkerElement Failed to set the 'baseVal' property on 'SVGAnimatedEnumeration': The enumeration value provided is 0, which is not settable. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html b/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html index 7ac884a..dfc9dd2 100644 --- a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html +++ b/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html
@@ -90,8 +90,17 @@ markerElement.setAttribute('orient', '10deg'); + // Switch to 'auto-start-reverse' value - by modifying orientType. + markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE; + assert_equals(markerElement.orientAngle.baseVal.value, 0); + assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_UNSPECIFIED); + assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE); + assert_equals(markerElement.getAttribute('orient'), "auto-start-reverse"); + + markerElement.setAttribute('orient', '10deg'); + // Try setting invalid values. - assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 3; }); + assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 4; }); assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); assert_equals(markerElement.getAttribute('orient'), "10deg"); @@ -110,4 +119,4 @@ assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO); assert_equals(markerElement.getAttribute('orient'), "auto"); }); -</script> \ No newline at end of file +</script>
diff --git a/third_party/blink/web_tests/external/wpt/tools/lint/lint.py b/third_party/blink/web_tests/external/wpt/tools/lint/lint.py index 38225ec..1872e62 100644 --- a/third_party/blink/web_tests/external/wpt/tools/lint/lint.py +++ b/third_party/blink/web_tests/external/wpt/tools/lint/lint.py
@@ -655,6 +655,16 @@ if incorrect_path("testdriver-vendor.js", src): errors.append(rules.TestdriverVendorPath.error(path)) + script_path = None + try: + script_path = urlsplit(urljoin(source_file.url, src)).path + except ValueError: + # This happens if the contents of src isn't something that looks like a URL to Python + pass + if (script_path == "/common/reftest-wait.js" and + "reftest-wait" not in source_file.root.attrib.get("class", "").split()): + errors.append(rules.MissingReftestWait.error(path)) + return errors class ASTCheck(with_metaclass(abc.ABCMeta)):
diff --git a/third_party/blink/web_tests/external/wpt/tools/lint/rules.py b/third_party/blink/web_tests/external/wpt/tools/lint/rules.py index f6e23ae..b389e3d 100644 --- a/third_party/blink/web_tests/external/wpt/tools/lint/rules.py +++ b/third_party/blink/web_tests/external/wpt/tools/lint/rules.py
@@ -197,6 +197,14 @@ """ +class MissingReftestWait(Rule): + name = "MISSING-REFTESTWAIT" + description = "Missing `class=reftest-wait`" + to_fix = """ + ensure tests that include reftest-wait.js also use class=reftest-wait on the root element. + """ + + class MissingTestharnessReport(Rule): name = "MISSING-TESTHARNESSREPORT" description = "Missing `<script src='/resources/testharnessreport.js'>`"
diff --git a/third_party/blink/web_tests/external/wpt/tools/manifest/sourcefile.py b/third_party/blink/web_tests/external/wpt/tools/manifest/sourcefile.py index 6e90ac0..ce81c625 100644 --- a/third_party/blink/web_tests/external/wpt/tools/manifest/sourcefile.py +++ b/third_party/blink/web_tests/external/wpt/tools/manifest/sourcefile.py
@@ -167,27 +167,27 @@ def _parse_html(f): - # type: (BinaryIO) -> ElementTree.ElementTree + # type: (BinaryIO) -> ElementTree.Element doc = html5lib.parse(f, treebuilder="etree", useChardet=False) if MYPY: - return cast(ElementTree.ElementTree, doc) + return cast(ElementTree.Element, doc) return doc def _parse_xml(f): - # type: (BinaryIO) -> ElementTree.ElementTree + # type: (BinaryIO) -> ElementTree.Element try: # raises ValueError with an unsupported encoding, # ParseError when there's an undefined entity - return ElementTree.parse(f) + return ElementTree.parse(f).getroot() except (ValueError, ElementTree.ParseError): f.seek(0) - return ElementTree.parse(f, XMLParser.XMLParser()) # type: ignore + return ElementTree.parse(f, XMLParser.XMLParser()).getroot() # type: ignore class SourceFile(object): parsers = {u"html":_parse_html, u"xhtml":_parse_xml, - u"svg":_parse_xml} # type: Dict[Text, Callable[[BinaryIO], ElementTree.ElementTree]] + u"svg":_parse_xml} # type: Dict[Text, Callable[[BinaryIO], ElementTree.Element]] root_dir_non_test = {u"common"} @@ -447,7 +447,7 @@ @cached_property def root(self): - # type: () -> Optional[Union[ElementTree.Element, ElementTree.ElementTree]] + # type: () -> Optional[ElementTree.Element] """Return an ElementTree Element for the root node of the file if it contains markup, or None if it does not""" if not self.markup_type: @@ -461,12 +461,7 @@ except Exception: return None - if hasattr(tree, "getroot"): - root = tree.getroot() # type: Union[ElementTree.Element, ElementTree.ElementTree] - else: - root = tree - - return root + return tree @cached_property def timeout_nodes(self):
diff --git a/third_party/blink/web_tests/external/wpt/tools/runner/runner.js b/third_party/blink/web_tests/external/wpt/tools/runner/runner.js index 27946e1..1577228 100644 --- a/third_party/blink/web_tests/external/wpt/tools/runner/runner.js +++ b/third_party/blink/web_tests/external/wpt/tools/runner/runner.js
@@ -893,18 +893,17 @@ new ManualUI(document.getElementById("manualUI"), runner); new VisualOutput(document.getElementById("output"), runner); + window.addEventListener("message", function(e) { + if (e.data.type === "complete") + runner.on_complete(e.data.tests, e.data.status); + }); + if (options.autorun === "1") { runner.start(test_control.get_path(), test_control.get_test_types(), test_control.get_testharness_settings(), test_control.get_use_regex()); - return; } - - window.addEventListener("message", function(e) { - if (e.data.type === "complete") - runner.on_complete(e.data.tests, e.data.status); - }); } window.addEventListener("DOMContentLoaded", setup, false);
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/support/authentication.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/support/authentication.py index 25a8eb95..e61eef06 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/support/authentication.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/support/authentication.py
@@ -1,15 +1,12 @@ from six.moves.urllib.parse import urlencode -def basic_authentication(username=None, password=None, protocol="http"): - from .fixtures import server_config, url - build_url = url(server_config()) - +def basic_authentication(url, username=None, password=None, protocol="http"): query = {} - return build_url("/webdriver/tests/support/authentication.py", - query=urlencode(query), - protocol=protocol) + return url("/webdriver/tests/support/authentication.py", + query=urlencode(query), + protocol=protocol) def main(request, response):
diff --git a/third_party/blink/web_tests/external/wpt/webusb/usbDevice_transferIn-manual.https.html b/third_party/blink/web_tests/external/wpt/webusb/usbDevice_transferIn-manual.https.html new file mode 100644 index 0000000..bd3df7d5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/webusb/usbDevice_transferIn-manual.https.html
@@ -0,0 +1,142 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="resources/manual.js"></script> + </head> + <body> + <p> + This test requires a USB device implementing the USB CDC-ACM protocol + configured to loop back TX to RX. For example, this Arduino sketch could + be used: + + <pre> +void setup() { + Serial.begin(115200); + while (!Serial) { + ; + } +} + +void loop() { + if (Serial.available()) { + Serial.write(Serial.read()); + } +} + </pre> + </p> + <script> + manual_usb_test(async (t, device) => { + await device.open(); + t.add_cleanup(async () => { + if (device.opened) { + await device.close(); + } + }); + + await device.selectConfiguration(1); + + let controlInterface = undefined; + for (const iface of device.configuration.interfaces) { + const alternate = iface.alternates[0]; + if (alternate.interfaceClass == 2 && + alternate.interfaceSubclass == 2 && + alternate.interfaceProtocol == 0) { + controlInterface = iface; + break; + } + } + assert_not_equals(controlInterface, undefined, + 'No control interface found.'); + + let dataInterface = undefined; + for (const iface of device.configuration.interfaces) { + const alternate = iface.alternates[0]; + if (alternate.interfaceClass == 10 && + alternate.interfaceSubclass == 0 && + alternate.interfaceProtocol == 0) { + dataInterface = iface; + break; + } + } + assert_not_equals(dataInterface, undefined, 'No data interface found.'); + + await device.claimInterface(controlInterface.interfaceNumber); + await device.claimInterface(dataInterface.interfaceNumber); + + let inEndpoint = undefined; + for (const endpoint of dataInterface.alternate.endpoints) { + if (endpoint.type == 'bulk' && endpoint.direction == 'in') { + inEndpoint = endpoint; + break; + } + } + assert_not_equals(inEndpoint, undefined, 'No IN endpoint found.'); + + let outEndpoint = undefined; + for (const endpoint of dataInterface.alternate.endpoints) { + if (endpoint.type == 'bulk' && endpoint.direction == 'out') { + outEndpoint = endpoint; + break; + } + } + assert_not_equals(outEndpoint, undefined, 'No OUT endpoint found.'); + + // Execute a SET_CONTROL_LINE_STATE command to let the device know the + // host is ready to transmit and receive data. + await device.controlTransferOut({ + requestType: 'class', + recipient: 'interface', + request: 0x22, + value: 0x01, + index: controlInterface.interfaceNumber, + }); + + // Set up two IN transfers which should complete in order. + const transfer1 = + device.transferIn(inEndpoint.endpointNumber, inEndpoint.packetSize); + const transfer2 = + device.transferIn(inEndpoint.endpointNumber, inEndpoint.packetSize); + + // Write a single byte to the port which should be echoed to complete + // transfer1. + let result = await device.transferOut( + outEndpoint.endpointNumber, new Uint8Array(['a'.charCodeAt(0)])); + assert_equals(result.status, 'ok'); + assert_equals(result.bytesWritten, 1); + + result = await transfer1; + assert_equals(result.status, 'ok'); + assert_not_equals(result.data, null); + assert_equals(result.data.byteLength, 1); + assert_equals(result.data.getUint8(0), 'a'.charCodeAt(0)); + + // Set up a third IN transfer which will be canceled when the device is + // closed at the end of the test. + const transfer3 = promise_rejects_dom( + t, 'NetworkError', + device.transferIn(inEndpoint.endpointNumber, + inEndpoint.packetSize)); + + // Write a single byte to the port which should be echoed to complete + // transfer2. + result = await device.transferOut( + outEndpoint.endpointNumber, new Uint8Array(['b'.charCodeAt(0)])); + assert_equals(result.status, 'ok'); + assert_equals(result.bytesWritten, 1); + + result = await transfer2; + assert_equals(result.status, 'ok'); + assert_not_equals(result.data, null); + assert_equals(result.data.byteLength, 1); + assert_equals(result.data.getUint8(0), 'b'.charCodeAt(0)); + + await device.close(); + await transfer3; + }, 'Multiple IN transfers on an endpoint complete in order'); + </script> + </body> +</html>
diff --git a/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt b/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt index fc3eea8..ac65301 100644 --- a/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt +++ b/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt
@@ -12,25 +12,25 @@ PASS All correct nodes found for rect PASS All correct nodes found for rect Check area hits crossing neighbouring table cells -PASS All correct nodes found for rect -PASS All correct nodes found for rect -PASS All correct nodes found for rect -PASS All correct nodes found for rect -PASS All correct nodes found for rect +FAIL Unexpected node #0 for rect [170,165], [41,21] - TD#td22 +FAIL Unexpected node #0 for rect [240,265], [41,21] - TD#td43 +FAIL Unexpected node #0 for rect [165,170], [21,41] - TD#td22 +FAIL Unexpected node #0 for rect [265,240], [21,41] - TD#td34 +FAIL Unexpected node #0 for rect [170,170], [41,41] - TD#td22 Check area hits crossing entire table cells -PASS All correct nodes found for rect -PASS All correct nodes found for rect -PASS All correct nodes found for rect -PASS All correct nodes found for rect -PASS All correct nodes found for rect +FAIL Unexpected node #0 for rect [110,165], [181,21] - TD#td21 +FAIL Unexpected node #0 for rect [165,110], [21,181] - TD#td12 +FAIL Unexpected node #0 for rect [90,90], [121,121] - TD#td11 +FAIL Unexpected node #0 for rect [115,230], [21,131] - TD#td31 +FAIL Unexpected node #0 for rect [230,140], [131,21] - TD#td13 Check area hits on right-to-left table PASS All correct nodes found for rect PASS All correct nodes found for rect -PASS All correct nodes found for rect +FAIL Unexpected node #0 for rect [165,170], [21,41] - TD#td23 Check area hits on flipped (tb-lr) table PASS All correct nodes found for rect PASS All correct nodes found for rect -PASS All correct nodes found for rect +FAIL Unexpected node #0 for rect [110,165], [181,21] - TD#td12 PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table.html b/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table.html index e33d8c97..92db01d 100644 --- a/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table.html +++ b/third_party/blink/web_tests/fast/dom/nodesFromRect/nodesFromRect-table.html
@@ -21,6 +21,12 @@ .tblr { -webkit-writing-mode: vertical-lr; } + table td { + background: gray; + } + table:hover td { + background: rgba(0,0,0,0.1); + } </style> <script src="../../../resources/js-test.js"></script> <script src="resources/nodesFromRect.js"></script> @@ -51,7 +57,6 @@ <td id=td44> </table> </div> - <script> function runTest() { @@ -80,41 +85,37 @@ check(290, 290, 41, 41, [e.td44, e.testtable, e.sandbox]); debug('Check area hits crossing neighbouring table cells'); - check(170, 165, 41, 21, [e.td22, e.td23, e.testtable]); - check(240, 265, 41, 21, [e.td43, e.td44, e.testtable]); - check(165, 170, 21, 41, [e.td22, e.td32, e.testtable]); - check(265, 240, 21, 41, [e.td34, e.td44, e.testtable]); - check(170, 170, 41, 41, [e.td22, e.td23, e.td32, e.td33, e.testtable]); + check(170, 165, 41, 21, [e.td23, e.td22, e.testtable]); + check(240, 265, 41, 21, [e.td44, e.td43, e.testtable]); + check(165, 170, 21, 41, [e.td32, e.td22, e.testtable]); + check(265, 240, 21, 41, [e.td44, e.td34, e.testtable]); + check(170, 170, 41, 41, [e.td33, e.td32, e.td23, e.td22, e.testtable]); debug('Check area hits crossing entire table cells'); - check(110, 165, 181, 21, [e.td21, e.td22, e.td23, e.td24, e.testtable]); - check(165, 110, 21, 181, [e.td12, e.td22, e.td32, e.td42, e.testtable]); - check(90, 90, 121, 121, [e.td11, e.td12, e.td13, - e.td21, e.td22, e.td23, - e.td31, e.td32, e.td33, - e.testtable, e.sandbox]); - check(115, 230, 21, 131, [e.td31, e.td41, e.testtable, e.sandbox]); - check(230, 140, 131, 21, [e.td13, e.td14, e.td23, e.td24, e.testtable, e.sandbox]); + check(110, 165, 181, 21, [e.td24, e.td23, e.td22, e.td21, e.testtable]); + check(165, 110, 21, 181, [e.td42, e.td32, e.td22, e.td12, e.testtable]); + check(90, 90, 121, 121, [e.td33, e.td32, e.td31, + e.td23, e.td22, e.td21, + e.td13, e.td12, e.td11, + e.testtable, e.sandbox]); + check(115, 230, 21, 131, [e.td41, e.td31, e.testtable, e.sandbox]); + check(230, 140, 131, 21, [e.td24, e.td23, e.td14, e.td13, e.testtable, e.sandbox]); debug('Check area hits on right-to-left table'); e['testtable'].setAttribute('class', 'rtl'); check(265, 115, 21, 21, [e.td11]); check(165, 165, 21, 21, [e.td23]); - check(165, 170, 21, 41, [e.td23, e.td33, e.testtable]); + check(165, 170, 21, 41, [e.td33, e.td23, e.testtable]); debug('Check area hits on flipped (tb-lr) table'); e['testtable'].setAttribute('class', 'tblr'); check(265, 115, 21, 21, [e.td41]); check(115, 265, 21, 21, [e.td14]); - check(110, 165, 181, 21, [e.td12, e.td22, e.td32, e.td42, e.testtable]); - + check(110, 165, 181, 21, [e.td42, e.td32, e.td22, e.td12, e.testtable]); } runTest(); </script> - - <p id='description'></p> - <span id="console"></span> </body> </html>
diff --git a/third_party/blink/web_tests/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected.html b/third_party/blink/web_tests/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected.html new file mode 100644 index 0000000..18d06f0f --- /dev/null +++ b/third_party/blink/web_tests/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected.html
@@ -0,0 +1,19 @@ + +<!DOCTYPE html> +<meta name="color-scheme" content="light dark"> +<script src="../../resources/common.js"></script> +<script src="../../../../resources/run-after-layout-and-paint.js"></script> +<body> +<select multiple disabled autofocus> + <optgroup label="unstyled"> + <option selected>selected</option> + <option id="hoverTarget">unselected (hovered)</option + </optgroup> +</select> +<script> + runAfterLayoutAndPaint(function () { + let hoverTarget = document.getElementById('hoverTarget'); + hoverOverElement(hoverTarget); + }, true); +</script> +</body>
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..b5fb4d2 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..8313799 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..9ea6706 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png deleted file mode 100644 index 34fdb14b..0000000 --- a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/linux/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..b5fb4d2 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/mac-mac-arm11.0/compositing/overflow/nested-render-surfaces-with-rotation-expected.png similarity index 100% copy from third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png copy to third_party/blink/web_tests/platform/mac-mac-arm11.0/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/mac-mac-arm11.0/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png similarity index 100% rename from third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png rename to third_party/blink/web_tests/platform/mac-mac-arm11.0/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3dbed0b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..74b79d6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3929863 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3929863 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3dbed0b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..74b79d6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png new file mode 100644 index 0000000..f8d8258 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3929863 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3dbed0b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..74b79d6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..b402580 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3dbed0b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..74b79d6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..b402580 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png index c5c8929a..f8d8258 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..b402580 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..3dbed0b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..74b79d6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png b/third_party/blink/web_tests/platform/mac/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png index 56e4004..2af6e0a4 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/mac/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..b402580 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..1f4f9799 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..d7c0604 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..5f3df3e --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png b/third_party/blink/web_tests/platform/win/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png deleted file mode 100644 index 761616a..0000000 --- a/third_party/blink/web_tests/platform/win/virtual/layout_ng_block_frag/fast/multicol/multicol-with-child-renderLayer-for-input-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png index 35fdd92..487a936 100644 --- a/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..1f4f9799 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..d7c0604 --- /dev/null +++ b/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-hc/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win7/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..5f3df3e --- /dev/null +++ b/third_party/blink/web_tests/platform/win7/virtual/dark-color-scheme/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png b/third_party/blink/web_tests/platform/win7/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png new file mode 100644 index 0000000..1f4f9799 --- /dev/null +++ b/third_party/blink/web_tests/platform/win7/virtual/use-common-select-popup/fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected-expected.png Binary files differ
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec index b1fe70dd..1343d7c0 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec
@@ -246,7 +246,8 @@ "META": {"sizes": {"includes": [10],}}, "includes": [2090], }, - "chrome/browser/resources/media/webrtc_logs_resources.grd": { + "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/media/webrtc_logs_resources.grd": { + "META": {"sizes": {"includes": [10],}}, "includes": [2100], }, "chrome/browser/resources/net_internals/net_internals_resources.grd": {
diff --git a/tools/json_schema_compiler/feature_compiler.py b/tools/json_schema_compiler/feature_compiler.py index 1618996c..fc870d2 100644 --- a/tools/json_schema_compiler/feature_compiler.py +++ b/tools/json_schema_compiler/feature_compiler.py
@@ -390,7 +390,6 @@ # Exceptions (see the feature files). # DO NOT ADD MORE. HOSTED_APP_EXCEPTIONS = [ - '99060B01DE911EB85FD630C8BA6320C9186CA3AB', 'B44D08FD98F1523ED5837D78D0A606EA9D6206E5', '2653F6F6C39BC6EEBD36A09AFB92A19782FF7EB4', ]
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 4d9234e..3a944c31 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -144,6 +144,7 @@ 'android-angle-vk-arm-builder': 'angle_specific_android_vulkan_ndk_release_trybot', 'android-angle-vk-arm64-builder': 'angle_specific_android_vulkan_ndk_release_trybot_arm64', 'fuchsia-angle-builder': 'angle_specific_release_trybot_fuchsia', + 'ios-angle-builder': 'angle_specific_release_trybot_ios', 'linux-angle-builder': 'angle_specific_release_trybot', 'linux-angle-chromium-builder': 'gpu_tests_release_trybot', 'linux-ozone-angle-builder': 'angle_specific_ozone_linux_system_gbm_libdrm_release_trybot', @@ -345,10 +346,8 @@ 'mac-upload-perfetto': 'release_bot', 'win-annotator-rel': 'release_bot', 'win-celab-builder-rel': 'release_bot_minimal_symbols', - # TODO(bartekn): Switch back to debug_bot_paeverywhere_x86 and - # release_trybot_paeverywhere_x86. - 'win-paeverywhere-x86-fyi-dbg': 'debug_bot_x86', - 'win-paeverywhere-x86-fyi-rel': 'release_trybot_x86', + 'win-paeverywhere-x86-fyi-dbg': 'debug_bot_paeverywhere_x86', + 'win-paeverywhere-x86-fyi-rel': 'release_trybot_paeverywhere_x86', 'win-paeverywhere-x64-fyi-dbg': 'debug_bot_paeverywhere_x64', 'win-paeverywhere-x64-fyi-rel': 'release_trybot_paeverywhere_x64', 'win-pixel-builder-rel': 'release_bot', @@ -857,6 +856,7 @@ 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', 'fuchsia-angle-rel': 'gpu_fyi_tests_release_trybot_fuchsia', + 'ios-angle-try-intel': 'angle_specific_release_trybot_ios', 'linux-angle-rel': 'gpu_fyi_tests_release_trybot', 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', @@ -1520,6 +1520,10 @@ 'angle_specific_tests', 'shared_release_trybot', 'fuchsia', ], + 'angle_specific_release_trybot_ios': [ + 'angle_specific_tests', 'shared_release_trybot', 'ios', 'ios_simulator', 'ios_cpu_x64', 'xctest', + ], + 'angle_specific_release_trybot_x86': [ 'angle_specific_tests', 'shared_release_trybot', 'x86', ], @@ -1919,6 +1923,10 @@ 'debug_bot', 'fuchsia', 'compile_only', ], + 'debug_bot_paeverywhere_x86': [ + 'debug_bot', 'paeverywhere', 'x86', + ], + 'debug_bot_paeverywhere_x64': [ 'debug_bot', 'paeverywhere', 'x64', ], @@ -2564,7 +2572,11 @@ 'use_clang_coverage', 'partial_code_coverage_instrumentation', ], - 'release_trybot_paeverywhere_x64': [ + 'release_trybot_paeverywhere_x86': [ + 'release_trybot', 'paeverywhere', 'x86', + ], + + 'release_trybot_paeverywhere_x64': [ 'release_trybot', 'paeverywhere', 'x64', ], @@ -3171,8 +3183,7 @@ }, 'paeverywhere': { - # TODO(bartekn): Re-enable. - # 'gn_args': 'use_allocator="partition"', + 'gn_args': 'use_allocator="partition"', }, # Used to pass the list of files to instrument for coverage to the compile
diff --git a/tools/mb/mb_config_expectations/chromium.angle.json b/tools/mb/mb_config_expectations/chromium.angle.json index b2ea5ef4..f30b87c3 100644 --- a/tools/mb/mb_config_expectations/chromium.angle.json +++ b/tools/mb/mb_config_expectations/chromium.angle.json
@@ -89,6 +89,22 @@ "use_goma": true } }, + "ios-angle-builder": { + "gn_args": { + "build_angle_deqp_tests": true, + "build_angle_gles1_conform_tests": true, + "build_angle_trace_perf_tests": true, + "dcheck_always_on": true, + "enable_run_ios_unittests_with_xctest": true, + "is_component_build": true, + "is_debug": false, + "symbol_level": 1, + "target_cpu": "x64", + "target_environment": "simulator", + "target_os": "ios", + "use_goma": true + } + }, "linux-angle-builder": { "gn_args": { "build_angle_deqp_tests": true,
diff --git a/tools/mb/mb_config_expectations/chromium.fyi.json b/tools/mb/mb_config_expectations/chromium.fyi.json index 0d02c48..f0f86cf4 100644 --- a/tools/mb/mb_config_expectations/chromium.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.fyi.json
@@ -248,6 +248,7 @@ "symbol_level": 1, "target_cpu": "arm", "target_os": "android", + "use_allocator": "partition", "use_goma": true } }, @@ -259,6 +260,7 @@ "symbol_level": 1, "target_cpu": "arm", "target_os": "android", + "use_allocator": "partition", "use_goma": true } }, @@ -269,6 +271,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_allocator": "partition", "use_goma": true } }, @@ -280,6 +283,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_allocator": "partition", "use_goma": true } }, @@ -648,6 +652,7 @@ "is_debug": true, "symbol_level": 1, "target_cpu": "x64", + "use_allocator": "partition", "use_goma": true } }, @@ -658,6 +663,7 @@ "is_debug": false, "symbol_level": 1, "target_cpu": "x64", + "use_allocator": "partition", "use_goma": true } }, @@ -723,6 +729,7 @@ "is_debug": true, "symbol_level": 1, "target_cpu": "x64", + "use_allocator": "partition", "use_goma": true } }, @@ -733,6 +740,7 @@ "is_debug": false, "symbol_level": 1, "target_cpu": "x64", + "use_allocator": "partition", "use_goma": true } }, @@ -764,6 +772,7 @@ "is_debug": true, "symbol_level": 1, "target_cpu": "x64", + "use_allocator": "partition", "use_goma": true } }, @@ -774,6 +783,7 @@ "is_debug": false, "symbol_level": 1, "target_cpu": "x64", + "use_allocator": "partition", "use_goma": true } }, @@ -783,6 +793,7 @@ "is_debug": true, "symbol_level": 1, "target_cpu": "x86", + "use_allocator": "partition", "use_goma": true } }, @@ -793,6 +804,7 @@ "is_debug": false, "symbol_level": 1, "target_cpu": "x86", + "use_allocator": "partition", "use_goma": true } },
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.angle.json b/tools/mb/mb_config_expectations/tryserver.chromium.angle.json index fc2f09d..9f5a6096 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.angle.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.angle.json
@@ -106,6 +106,22 @@ "use_goma": true } }, + "ios-angle-try-intel": { + "gn_args": { + "build_angle_deqp_tests": true, + "build_angle_gles1_conform_tests": true, + "build_angle_trace_perf_tests": true, + "dcheck_always_on": true, + "enable_run_ios_unittests_with_xctest": true, + "is_component_build": true, + "is_debug": false, + "symbol_level": 1, + "target_cpu": "x64", + "target_environment": "simulator", + "target_os": "ios", + "use_goma": true + } + }, "linux-angle-rel": { "gn_args": { "build_angle_gles1_conform_tests": true,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 50dcd6f..809d60a 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -3878,6 +3878,9 @@ </enum> <enum name="AsyncDNSConfigParsePosix"> + <obsolete> + Removed 2021-01. + </obsolete> <int value="0" label="OK"/> <int value="1" label="RES_INIT_FAILED"/> <int value="2" label="RES_INIT_UNSET"/> @@ -3890,6 +3893,9 @@ </enum> <enum name="AsyncDNSConfigParseWin"> + <obsolete> + Removed 2021-01. + </obsolete> <int value="0" label="OK"/> <int value="1" label="READ_IPHELPER"/> <int value="2" label="READ_POLICY_SEARCHLIST"/> @@ -3906,6 +3912,9 @@ </enum> <enum name="AsyncDNSHostsParseWin"> + <obsolete> + Removed 2021-01. + </obsolete> <int value="0" label="OK"/> <int value="1" label="UNREADABLE_HOSTS_FILE"/> <int value="2" label="COMPUTER_NAME_FAILED"/> @@ -3914,6 +3923,9 @@ </enum> <enum name="AsyncDNSNameServersType"> + <obsolete> + Removed unknown date before 2021-01. + </obsolete> <summary>Type of nameservers in the DNS config.</summary> <int value="0" label="NONE">No nameservers configured.</int> <int value="1" label="GOOGLE_PUBLIC_DNS"> @@ -3933,6 +3945,9 @@ </enum> <enum name="AsyncDNSParseResult"> + <obsolete> + Removed unknown date before 2021-01. + </obsolete> <summary>Results of DnsResponse::ParseToAddressList.</summary> <int value="0" label="SUCCESS"/> <int value="1" label="MALFORMED_RESPONSE"/> @@ -3945,12 +3960,18 @@ </enum> <enum name="AsyncDNSPrefDefaultSource"> + <obsolete> + Removed unknown date before 2021-01. + </obsolete> <int value="0" label="PLATFORM"/> <int value="1" label="FIELD_TRIAL"/> <int value="2" label="HARD_CODED_DEFAULT"/> </enum> <enum name="AsyncDNSPrefSource"> + <obsolete> + Removed unknown date before 2021-01. + </obsolete> <int value="0" label="MANAGED_PREF"/> <int value="1" label="SUPERVISED_PREF"/> <int value="2" label="EXTENSION_PREF"/> @@ -3962,6 +3983,9 @@ </enum> <enum name="AsyncDNSRcode"> + <obsolete> + Removed unknown date before 2021-01. + </obsolete> <summary> https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 </summary> @@ -3974,6 +3998,9 @@ </enum> <enum name="AsyncDNSResolveStatus"> + <obsolete> + Removed unknown date before 2021-01. + </obsolete> <int value="0" label="DNS_SUCCESS">Succeeded with async DNS.</int> <int value="1" label="PROC_SUCCESS"> Succeeded with getaddrinfo after async DNS failed. @@ -3985,6 +4012,9 @@ </enum> <enum name="AsyncDNSWatchStatus"> + <obsolete> + Removed 2021-01. + </obsolete> <int value="0" label="STARTED">Started.</int> <int value="1" label="FAILED_TO_START_CONFIG"> Failed to start watching config. @@ -30789,6 +30819,9 @@ <int value="3743" label="ReadableStreamWithByteSource"/> <int value="3744" label="ReadableStreamBYOBReader"/> <int value="3745" label="EmbedElementWithoutTypeSrcChanged"/> + <int value="3746" label="SamePartyCookieAttribute"/> + <int value="3747" label="SamePartyCookieExclusionOverruledSameSite"/> + <int value="3748" label="SamePartyCookieInclusionOverruledSameSite"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -36872,6 +36905,9 @@ </enum> <enum name="HistoryUrlType"> + <obsolete> + Removed Jan 2021 as the only user has expired + </obsolete> <int value="0" label="Empty"/> <int value="1" label="Same as baseUrl"/> <int value="2" label="Different from baseUrl"/> @@ -50904,6 +50940,24 @@ <int value="9" label="WebRTC"/> </enum> +<enum name="NearbyConnectionsStatus"> + <int value="0" label="Success"/> + <int value="1" label="Error"/> + <int value="2" label="Out-of-order API call"/> + <int value="3" label="Already have active strategy"/> + <int value="4" label="Already advertising"/> + <int value="5" label="Already discovering"/> + <int value="6" label="Endpoint IO error"/> + <int value="7" label="Endpoint unknown"/> + <int value="8" label="Connection rejected"/> + <int value="9" label="Already connected to endpoint"/> + <int value="10" label="Not connected to endpoint"/> + <int value="11" label="Bluetooth error"/> + <int value="12" label="BLE error"/> + <int value="13" label="Wi-Fi LAN error"/> + <int value="14" label="Payload unknown"/> +</enum> + <enum name="NearbyShareCertificateManagerGetDecryptedPublicCertificateResult"> <int value="0" label="Success"/> <int value="1" label="No Match"/> @@ -66870,6 +66924,9 @@ <enum name="SecureChannelNearbyConnectionMedium"> <int value="0" label="Connected via Bluetooth"/> <int value="1" label="Upgraded bandwidth to WebRTC"/> + <int value="2" + label="Disconnected in under 30s without WebRTC upgrade; not provided + enough time to complete bandwidth upgrade process"/> </enum> <enum name="SecureCookieAction">
diff --git a/tools/metrics/histograms/histograms_xml/android/histograms.xml b/tools/metrics/histograms/histograms_xml/android/histograms.xml index d949677..3b549d0 100644 --- a/tools/metrics/histograms/histograms_xml/android/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/android/histograms.xml
@@ -2539,6 +2539,9 @@ <histogram name="Android.WebView.LoadDataWithBaseUrl.HistoryUrl" enum="HistoryUrlType" expires_after="M85"> + <obsolete> + Removed Jan 2021 (had already expired) + </obsolete> <owner>jamwalla@chromium.org</owner> <summary> Records whether the historyUrl parameter to loadDataWithBaseUrl is empty/ @@ -2922,7 +2925,7 @@ </histogram> <histogram name="AndroidSms.EffectivePWAInstallationSuccess" - enum="BooleanSuccess" expires_after="2021-02-02"> + enum="BooleanSuccess" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>jonmann@chromium.org</owner> <owner>better-together-dev@google.com</owner> @@ -2935,7 +2938,7 @@ </histogram> <histogram name="AndroidSms.FcmMessageDispatchFailure" - enum="AndroidSmsFcmMessageType" expires_after="2021-06-06"> + enum="AndroidSmsFcmMessageType" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -2946,7 +2949,7 @@ </histogram> <histogram name="AndroidSms.FcmMessageDispatchRetry" - enum="AndroidSmsFcmMessageType" expires_after="2021-05-16"> + enum="AndroidSmsFcmMessageType" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -2957,7 +2960,7 @@ </histogram> <histogram name="AndroidSms.FcmMessageDispatchSuccess" - enum="AndroidSmsFcmMessageType" expires_after="2021-06-06"> + enum="AndroidSmsFcmMessageType" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -2968,7 +2971,7 @@ </histogram> <histogram name="AndroidSms.MultiDeviceFeatureState" - enum="MultiDevice_FeatureState" expires_after="2021-06-06"> + enum="MultiDevice_FeatureState" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -2979,7 +2982,7 @@ </histogram> <histogram name="AndroidSms.NumAttemptsForSuccessfulInstallation" - units="attempts" expires_after="2021-05-02"> + units="attempts" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>jonmann@chromium.org</owner> <owner>better-together-dev@google.com</owner> @@ -2990,7 +2993,7 @@ </histogram> <histogram name="AndroidSms.PWAInstallationResult" - enum="WebAppInstallResultCode" expires_after="2021-04-04"> + enum="WebAppInstallResultCode" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -3001,7 +3004,7 @@ </histogram> <histogram name="AndroidSms.PWAUninstallationResult" enum="BooleanSuccess" - expires_after="2021-02-02"> + expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -3012,7 +3015,7 @@ </histogram> <histogram name="AndroidSms.ServiceWorkerLifetime" units="ms" - expires_after="2021-02-02"> + expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -3022,7 +3025,7 @@ </histogram> <histogram name="AndroidSms.ServiceWorkerMessageDispatchStatus" - enum="BooleanSuccess" expires_after="2021-02-02"> + enum="BooleanSuccess" expires_after="2022-02-02"> <owner>azeemarshad@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml b/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml index d5fdf1a..c66e24a 100644 --- a/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml
@@ -1087,6 +1087,9 @@ </histogram_suffixes> <histogram_suffixes name="AsyncDNSPref" separator="_"> + <obsolete> + All histograms removed unknown date before 2021-01. + </obsolete> <suffix name="Disabled" label=""/> <suffix name="Enabled" label=""/> <affected-histogram name="AsyncDNS.PrefDefaultSource"/> @@ -16021,6 +16024,7 @@ <affected-histogram name="SafeBrowsing.RT.IsLookupSuccessful"/> <affected-histogram name="SafeBrowsing.RT.Network.Result"/> <affected-histogram name="SafeBrowsing.RT.Network.Time"/> + <affected-histogram name="SafeBrowsing.RT.Request.Size"/> <affected-histogram name="SafeBrowsing.RT.Request.UserPopulation"/> <affected-histogram name="SafeBrowsing.RT.ThreatInfoSize"/> </histogram_suffixes>
diff --git a/tools/metrics/histograms/histograms_xml/multi_device/histograms.xml b/tools/metrics/histograms/histograms_xml/multi_device/histograms.xml index 4953a80..0ef57b8a 100644 --- a/tools/metrics/histograms/histograms_xml/multi_device/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/multi_device/histograms.xml
@@ -316,6 +316,27 @@ </summary> </histogram> +<histogram name="MultiDevice.SecureChannel.Nearby.OperationResult.{Function}" + enum="NearbyConnectionsStatus" expires_after="2022-01-01"> + <owner>khorimoto@chromium.org</owner> + <owner>better-together-dev@google.com</owner> + <summary> + Records the result of invoking Nearby Connection's {Function} API function + within SecureChannel. + + Emitted when the API call returns. + </summary> + <token key="Function"> + <variant name="AcceptConnection"/> + <variant name="DisconnectFromEndpoint"/> + <variant name="InjectEndpoint"/> + <variant name="RequestConnection"/> + <variant name="SendPayload"/> + <variant name="StartDiscovery"/> + <variant name="StopDiscovery"/> + </token> +</histogram> + <histogram name="MultiDevice.SecureChannel.Nearby.SendMessageResult" enum="BooleanSuccess" expires_after="2021-11-30"> <owner>khorimoto@chromium.org</owner>
diff --git a/tools/metrics/histograms/histograms_xml/others/histograms.xml b/tools/metrics/histograms/histograms_xml/others/histograms.xml index cd9725c..afac0ce9 100644 --- a/tools/metrics/histograms/histograms_xml/others/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/others/histograms.xml
@@ -817,6 +817,9 @@ <histogram name="AsyncDNS.ConfigChange" enum="BooleanSuccess" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -826,6 +829,9 @@ </histogram> <histogram name="AsyncDNS.ConfigNotifyInterval" units="ms" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -834,6 +840,9 @@ </histogram> <histogram name="AsyncDNS.ConfigParseDuration" units="ms" expires_after="M81"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary>Duration of time spent parsing DnsConfig.</summary> @@ -841,6 +850,9 @@ <histogram name="AsyncDNS.ConfigParsePosix" enum="AsyncDNSConfigParsePosix" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -850,6 +862,9 @@ <histogram name="AsyncDNS.ConfigParseWin" enum="AsyncDNSConfigParseWin" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -859,6 +874,9 @@ <histogram name="AsyncDNS.HostParseResult" enum="BooleanSuccess" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary>Whether DnsHosts were parsed successfully.</summary> @@ -866,6 +884,9 @@ <histogram name="AsyncDNS.HostsChange" enum="BooleanSuccess" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -875,6 +896,9 @@ </histogram> <histogram name="AsyncDNS.HostsNotifyInterval" units="ms" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -883,6 +907,9 @@ </histogram> <histogram name="AsyncDNS.HostsParseDuration" units="ms" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary>Duration of time spent parsing DnsHosts.</summary> @@ -890,6 +917,9 @@ <histogram name="AsyncDNS.HostsParseWin" enum="AsyncDNSHostsParseWin" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -898,6 +928,9 @@ </histogram> <histogram name="AsyncDNS.ServerCount" units="units" expires_after="2021-03-21"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -908,6 +941,9 @@ <histogram name="AsyncDNS.UnchangedConfigInterval" units="ms" expires_after="M77"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>pauljensen@chromium.org</owner> <owner>mef@chromium.org</owner> <summary> @@ -918,6 +954,9 @@ <histogram name="AsyncDNS.UnchangedHostsInterval" units="ms" expires_after="2021-01-31"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>ericorth@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -928,6 +967,9 @@ <histogram name="AsyncDNS.WatchStatus" enum="AsyncDNSWatchStatus" expires_after="2021-01-31"> + <obsolete> + Removed 2021-01. + </obsolete> <owner>ericorth@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/histograms_xml/safe_browsing/histograms.xml b/tools/metrics/histograms/histograms_xml/safe_browsing/histograms.xml index 231a8ef..6af3684 100644 --- a/tools/metrics/histograms/histograms_xml/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/safe_browsing/histograms.xml
@@ -1028,6 +1028,16 @@ </summary> </histogram> +<histogram name="SafeBrowsing.RT.Request.Size" units="bytes" + expires_after="2022-01-08"> + <owner>xinghuilu@chromium.org</owner> + <owner>chrome-safebrowsing-alerts@google.com</owner> + <summary> + The size of a real time URL check request in bytes. Logged on each resource + check for which a lookup request is sent to the server. + </summary> +</histogram> + <histogram name="SafeBrowsing.RT.Request.UserPopulation" enum="SafeBrowsingUserPopulation" expires_after="2021-05-11"> <owner>xinghuilu@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index febba32..ec0cd5f 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -1,16 +1,16 @@ { "trace_processor_shell": { "win": { - "hash": "7344c14ec15956c2688ff8aac4ddc645404835e9", - "remote_path": "perfetto_binaries/trace_processor_shell/win/11e6cfe60a925078976c25536c42358ef3f7666c/trace_processor_shell.exe" + "hash": "0104dfe57b4d98879c4238741f712a983facfbd5", + "remote_path": "perfetto_binaries/trace_processor_shell/win/affdce7627b1030441a19608a1bcb321190786da/trace_processor_shell.exe" }, "mac": { - "hash": "6f7e8527130f15e840fbc7a20e0d3e069c414327", - "remote_path": "perfetto_binaries/trace_processor_shell/mac/61125414310ae1df95fc378cd432071283783a81/trace_processor_shell" + "hash": "ad7587bcfdd72883c1e1b1596ddec4f81bbf7736", + "remote_path": "perfetto_binaries/trace_processor_shell/mac/35f78f4a4562f61cde3b096492628e1d47acb04e/trace_processor_shell" }, "linux": { - "hash": "fb9c4022762e5cdcfa36d7d23b457ec7f179bec2", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/61125414310ae1df95fc378cd432071283783a81/trace_processor_shell" + "hash": "4910c2bfbdf2ab1a735e227bb0d279ccdad8d311", + "remote_path": "perfetto_binaries/trace_processor_shell/linux/35f78f4a4562f61cde3b096492628e1d47acb04e/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/perf/measurements/dual_metric_measurement.py b/tools/perf/measurements/dual_metric_measurement.py index 972cce3..06ed832b6 100644 --- a/tools/perf/measurements/dual_metric_measurement.py +++ b/tools/perf/measurements/dual_metric_measurement.py
@@ -22,7 +22,9 @@ else: self._enable_tracing = False - def WillRunStory(self, platform): + # pylint: disable=arguments-differ + # pylint: disable=unused-argument + def WillRunStory(self, platform, story=None): if self._enable_tracing: self._tbm_test.WillRunStory(platform)
diff --git a/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js b/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js index 01fcc5b..884d376 100644 --- a/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js +++ b/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js
@@ -10,7 +10,9 @@ '//chrome/browser/resources/chromeos/accessibility/chromevox/testing/' + 'common.js', '//chrome/browser/resources/chromeos/accessibility/common/testing/' + - 'callback_helper.js' + 'callback_helper.js', + '//chrome/browser/resources/chromeos/accessibility/common/testing/' + + 'common.js' ]); /**
diff --git a/ui/aura/client/aura_constants.cc b/ui/aura/client/aura_constants.cc index ca98973..ac74052 100644 --- a/ui/aura/client/aura_constants.cc +++ b/ui/aura/client/aura_constants.cc
@@ -49,9 +49,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kConstrainedWindowKey, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kCreatedByUserGesture, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kDrawAttentionKey, false) -DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, - kEmbeddedWindowEnsureNotInRect, - nullptr) DEFINE_UI_CLASS_PROPERTY_KEY(FocusClient*, kFocusClientKey, nullptr) DEFINE_UI_CLASS_PROPERTY_KEY(Window*, kHostWindowKey, nullptr) DEFINE_UI_CLASS_PROPERTY_KEY(Window*, kChildModalParentKey, nullptr)
diff --git a/ui/aura/client/aura_constants.h b/ui/aura/client/aura_constants.h index bb97f9b..ac15d1b 100644 --- a/ui/aura/client/aura_constants.h +++ b/ui/aura/client/aura_constants.h
@@ -18,7 +18,7 @@ namespace mojom { enum class WindowType; } -} +} // namespace ws namespace aura { namespace client { @@ -84,12 +84,6 @@ // attention. AURA_EXPORT extern const WindowProperty<bool>* const kDrawAttentionKey; -// A property key to store a bounds in screen coordinates that an embedded -// window wants to be moved out of. This is only used in MUS to move the -// embedding top-level window at the other side. -AURA_EXPORT extern const WindowProperty<gfx::Rect*>* const - kEmbeddedWindowEnsureNotInRect; - // A property key to store the focus client on the window. AURA_EXPORT extern const WindowProperty<FocusClient*>* const kFocusClientKey;
diff --git a/ui/gl/direct_composition_surface_win.cc b/ui/gl/direct_composition_surface_win.cc index 57a0d1db..5a4ba87a 100644 --- a/ui/gl/direct_composition_surface_win.cc +++ b/ui/gl/direct_composition_surface_win.cc
@@ -41,6 +41,8 @@ bool g_decode_swap_chain_disabled = false; // Whether to force the nv12 overlay support. bool g_force_nv12_overlay_support = false; +// Whether software overlays have been disabled. +bool g_disable_sw_overlays = false; // The lock to guard g_overlay_caps_valid and g_supports_overlays. base::Lock& GetOverlayLock() { @@ -58,6 +60,12 @@ g_supports_overlays = support; } +bool SupportsSoftwareOverlays() { + return base::FeatureList::IsEnabled( + features::kDirectCompositionSoftwareOverlays) && + !g_disable_sw_overlays; +} + bool OverlayCapsValid() { base::AutoLock auto_lock(GetOverlayLock()); return g_overlay_caps_valid; @@ -252,8 +260,7 @@ base::UmaHistogramBoolean("GPU.DirectComposition.HardwareOverlaysSupported", *supports_overlays); - if (*supports_overlays || !base::FeatureList::IsEnabled( - features::kDirectCompositionSoftwareOverlays)) { + if (*supports_overlays || !SupportsSoftwareOverlays()) { return; } @@ -464,6 +471,11 @@ } // static +void DirectCompositionSurfaceWin::DisableSoftwareOverlays() { + g_disable_sw_overlays = true; +} + +// static void DirectCompositionSurfaceWin::InvalidateOverlayCaps() { SetOverlayCapsValid(false); } @@ -473,9 +485,7 @@ UpdateOverlaySupport(); if (g_overlay_format_used == DXGI_FORMAT_NV12) { return (g_nv12_overlay_support_flags & DXGI_OVERLAY_SUPPORT_FLAG_SCALING) || - (SupportsOverlays() && - base::FeatureList::IsEnabled( - features::kDirectCompositionSoftwareOverlays)); + (SupportsOverlays() && SupportsSoftwareOverlays()); } else if (g_overlay_format_used == DXGI_FORMAT_YUY2) { return !!(g_yuy2_overlay_support_flags & DXGI_OVERLAY_SUPPORT_FLAG_SCALING); } else {
diff --git a/ui/gl/direct_composition_surface_win.h b/ui/gl/direct_composition_surface_win.h index 5c53ae96..8669dd3 100644 --- a/ui/gl/direct_composition_surface_win.h +++ b/ui/gl/direct_composition_surface_win.h
@@ -62,6 +62,9 @@ // current GPU process' lifetime. static void DisableOverlays(); + // Similar to the above but disables software overlay support. + static void DisableSoftwareOverlays(); + // Indicate the overlay caps are invalid. static void InvalidateOverlayCaps();
diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn index c8492d70..725fed3 100644 --- a/ui/ozone/platform/wayland/BUILD.gn +++ b/ui/ozone/platform/wayland/BUILD.gn
@@ -369,6 +369,7 @@ testonly = true sources = [ + "common/wayland_util_unittest.cc", "gpu/wayland_overlay_manager_unittest.cc", "host/wayland_connection_unittest.cc", "host/wayland_data_device_unittest.cc",
diff --git a/ui/ozone/platform/wayland/common/wayland_util.cc b/ui/ozone/platform/wayland/common/wayland_util.cc index 042cfc8e..dbc1b51 100644 --- a/ui/ozone/platform/wayland/common/wayland_util.cc +++ b/ui/ozone/platform/wayland/common/wayland_util.cc
@@ -7,7 +7,10 @@ #include <xdg-shell-client-protocol.h> #include <xdg-shell-unstable-v6-client-protocol.h> +#include "third_party/skia/include/core/SkPath.h" +#include "third_party/skia/include/core/SkRegion.h" #include "ui/base/hit_test.h" +#include "ui/gfx/skia_util.h" #include "ui/ozone/platform/wayland/host/wayland_connection.h" #include "ui/ozone/platform/wayland/host/wayland_shm_buffer.h" #include "ui/ozone/platform/wayland/host/wayland_surface.h" @@ -276,4 +279,17 @@ 1.0 / window->buffer_scale()); } +std::vector<gfx::Rect> CreateRectsFromSkPath(const SkPath& path) { + SkRegion clip_region; + clip_region.setRect(path.getBounds().round()); + SkRegion region; + region.setPath(path, clip_region); + + std::vector<gfx::Rect> rects; + for (SkRegion::Iterator it(region); !it.done(); it.next()) + rects.push_back(gfx::SkIRectToRect(it.rect())); + + return rects; +} + } // namespace wl
diff --git a/ui/ozone/platform/wayland/common/wayland_util.h b/ui/ozone/platform/wayland/common/wayland_util.h index d755de9..e472820 100644 --- a/ui/ozone/platform/wayland/common/wayland_util.h +++ b/ui/ozone/platform/wayland/common/wayland_util.h
@@ -17,6 +17,7 @@ #include "ui/platform_window/platform_window_init_properties.h" class SkBitmap; +class SkPath; namespace ui { class WaylandConnection; @@ -87,6 +88,9 @@ gfx::Rect TranslateWindowBoundsToParentDIP(ui::WaylandWindow* window, ui::WaylandWindow* parent_window); +// Returns rectangles dictated by SkPath. +std::vector<gfx::Rect> CreateRectsFromSkPath(const SkPath& path); + } // namespace wl #endif // UI_OZONE_PLATFORM_WAYLAND_COMMON_WAYLAND_UTIL_H_
diff --git a/ui/ozone/platform/wayland/common/wayland_util_unittest.cc b/ui/ozone/platform/wayland/common/wayland_util_unittest.cc new file mode 100644 index 0000000..57a3669c --- /dev/null +++ b/ui/ozone/platform/wayland/common/wayland_util_unittest.cc
@@ -0,0 +1,71 @@ +// Copyright 2020 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 "ui/ozone/platform/wayland/common/wayland_util.h" + +#include <memory> + +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkPath.h" +#include "third_party/skia/include/core/SkRect.h" + +namespace ui { + +class WaylandUtilTest : public testing::Test {}; + +TEST_F(WaylandUtilTest, TestCreateRectsFromSkPath) { + constexpr int width = 100; + constexpr int height = 100; + + // Test1 consists of 2 rectangles from SkPath. + std::vector<gfx::Rect> expectedFor2Rects = {gfx::Rect(1, 0, 98, 1), + gfx::Rect(0, 1, 100, 99)}; + SkPath pathFor2Rects; + const SkRect rect = SkRect::MakeIWH(width, height); + constexpr SkScalar corner_radius_scalar = 2.0; + constexpr SkScalar radii[8] = {corner_radius_scalar, + corner_radius_scalar, // top-left + corner_radius_scalar, + corner_radius_scalar, // top-right + 0, + 0, // bottom-right + 0, + 0}; // bottom-left + pathFor2Rects.addRoundRect(rect, radii, SkPathDirection::kCW); + EXPECT_EQ(expectedFor2Rects, wl::CreateRectsFromSkPath(pathFor2Rects)); + + // Test2 consists of 5 rectangles from SkPath. + std::vector<gfx::Rect> expectedFor5Rects = { + gfx::Rect(3, 0, 94, 1), gfx::Rect(1, 1, 98, 2), gfx::Rect(0, 3, 100, 94), + gfx::Rect(1, 97, 98, 2), gfx::Rect(3, 99, 94, 1)}; + SkPath pathFor5Rects; + pathFor5Rects.moveTo(0, 3); + pathFor5Rects.lineTo(1, 3); + pathFor5Rects.lineTo(1, 1); + pathFor5Rects.lineTo(3, 1); + pathFor5Rects.lineTo(3, 0); + + pathFor5Rects.lineTo(width - 3, 0); + pathFor5Rects.lineTo(width - 3, 1); + pathFor5Rects.lineTo(width - 1, 1); + pathFor5Rects.lineTo(width - 1, 3); + pathFor5Rects.lineTo(width, 3); + + pathFor5Rects.lineTo(width, height - 3); + pathFor5Rects.lineTo(width - 1, height - 3); + pathFor5Rects.lineTo(width - 1, height - 1); + pathFor5Rects.lineTo(width - 3, height - 1); + pathFor5Rects.lineTo(width - 3, height); + + pathFor5Rects.lineTo(3, height); + pathFor5Rects.lineTo(3, height - 1); + pathFor5Rects.lineTo(1, height - 1); + pathFor5Rects.lineTo(1, height - 3); + pathFor5Rects.lineTo(0, height - 3); + pathFor5Rects.close(); + + EXPECT_EQ(expectedFor5Rects, wl::CreateRectsFromSkPath(pathFor5Rects)); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_surface.cc b/ui/ozone/platform/wayland/host/wayland_surface.cc index cc4d182..c162d15 100644 --- a/ui/ozone/platform/wayland/host/wayland_surface.cc +++ b/ui/ozone/platform/wayland/host/wayland_surface.cc
@@ -7,6 +7,7 @@ #include <linux-explicit-synchronization-unstable-v1-client-protocol.h> #include <viewporter-client-protocol.h> +#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/native_widget_types.h" @@ -191,18 +192,49 @@ if (!root_window_ || !root_window_->IsOpaqueWindow()) return; - wl::Object<wl_region> region( - wl_compositor_create_region(connection_->compositor())); - gfx::Rect region_dip = - gfx::ScaleToEnclosingRect(region_px, 1.f / buffer_scale_); - wl_region_add(region.get(), region_dip.x(), region_dip.y(), - region_dip.width(), region_dip.height()); - - wl_surface_set_opaque_region(surface_.get(), region.get()); + wl_surface_set_opaque_region(surface_.get(), + CreateAndAddRegion(region_px).get()); connection_->ScheduleFlush(); } +void WaylandSurface::SetInputRegion(const gfx::Rect& region_px) { + // Don't set input region when use_native_frame is enabled. + if (!root_window_ || root_window_->ShouldUseNativeFrame()) + return; + + // Sets input region for input events to allow go through and + // for the compositor to ignore the parts of the input region that fall + // outside of the surface. + wl_surface_set_input_region(surface_.get(), + CreateAndAddRegion(region_px).get()); + + connection_->ScheduleFlush(); +} + +wl::Object<wl_region> WaylandSurface::CreateAndAddRegion( + const gfx::Rect& region_px) { + DCHECK(root_window_); + + wl::Object<wl_region> region( + wl_compositor_create_region(connection_->compositor())); + + auto add_region = [&](const gfx::Rect& r) { + gfx::Rect region_dip = gfx::ScaleToEnclosingRect(r, 1.f / buffer_scale_); + wl_region_add(region.get(), region_dip.x(), region_dip.y(), + region_dip.width(), region_dip.height()); + }; + + if (root_window_->GetWindowShape().has_value()) { + std::vector<gfx::Rect> rectangles = root_window_->GetWindowShape().value(); + for (const auto& rect : rectangles) + add_region(rect); + } else { + add_region(region_px); + } + return region; +} + void WaylandSurface::SetViewportSource(const gfx::RectF& src_rect) { if (src_rect == crop_rect_) { return;
diff --git a/ui/ozone/platform/wayland/host/wayland_surface.h b/ui/ozone/platform/wayland/host/wayland_surface.h index 55ed7727..2f7284ae 100644 --- a/ui/ozone/platform/wayland/host/wayland_surface.h +++ b/ui/ozone/platform/wayland/host/wayland_surface.h
@@ -79,6 +79,13 @@ // pixels. void SetOpaqueRegion(const gfx::Rect& region_px); + // Sets the input region on this surface in physical pixels. + // The input region indicates which parts of the surface accept pointer and + // touch input events. This is expected to be called from ToplevelWindow + // whenever the region that the surface span changes or window state changes + // when custom frame is used. + void SetInputRegion(const gfx::Rect& region_px); + // Set the source rectangle of the associated wl_surface. // See: // https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/viewporter/viewporter.xml @@ -98,6 +105,8 @@ wl::Object<wl_subsurface> CreateSubsurface(WaylandSurface* parent); private: + wl::Object<wl_region> CreateAndAddRegion(const gfx::Rect& region_px); + WaylandConnection* const connection_; WaylandWindow* root_window_ = nullptr; wl::Object<wl_surface> surface_;
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc index acfc1e7..041d0f9 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
@@ -9,6 +9,7 @@ #include "base/run_loop.h" #include "base/unguessable_token.h" #include "build/chromeos_buildflags.h" +#include "third_party/skia/include/core/SkPath.h" #include "ui/base/hit_test.h" #include "ui/gfx/native_widget_types.h" #include "ui/ozone/platform/wayland/host/shell_object_factory.h" @@ -58,6 +59,10 @@ SetSizeConstraints(); TriggerStateChanges(); InitializeAuraShellSurface(); + // This could be the proper time to update window mask using + // NonClientView::GetWindowMask, since |non_client_view| is not created yet + // during the call to WaylandWindow::Initialize(). + UpdateWindowMask(); return true; } @@ -211,6 +216,8 @@ use_native_frame_ = use_native_frame; if (shell_toplevel_) SetDecorationMode(); + + UpdateWindowMask(); } bool WaylandToplevelWindow::ShouldUseNativeFrame() const { @@ -222,6 +229,11 @@ ->xdg_decoration_manager_v1(); } +base::Optional<std::vector<gfx::Rect>> WaylandToplevelWindow::GetWindowShape() + const { + return window_shape_; +} + void WaylandToplevelWindow::HandleSurfaceConfigure(int32_t width, int32_t height, bool is_maximized, @@ -409,4 +421,23 @@ } } +void WaylandToplevelWindow::UpdateWindowMask() { + // TODO(http://crbug.com/1158733): When supporting PlatformWindow::SetShape, + // update window region with the given |shape|. + WaylandWindow::UpdateWindowMask(); + root_surface()->SetInputRegion(GetBounds()); +} + +void WaylandToplevelWindow::UpdateWindowShape() { + // Create |window_shape_| using the window mask of PlatformWindowDelegate + // otherwise resets it. + base::Optional<SkPath> window_mask = delegate()->GetWindowMaskForWindowShape( + gfx::Size(GetBounds().width(), GetBounds().height())); + if (window_mask.has_value()) { + window_shape_ = wl::CreateRectsFromSkPath(window_mask.value()); + } else { + window_shape_.reset(); + } +} + } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h index eb0636a..8467b40 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h
@@ -38,7 +38,7 @@ int hittest, const gfx::Point& pointer_location_in_px) override; - // PlatformWindow + // PlatformWindow: void Show(bool inactive) override; void Hide() override; bool IsVisible() const override; @@ -55,6 +55,9 @@ void SetUseNativeFrame(bool use_native_frame) override; bool ShouldUseNativeFrame() const override; + // WaylandWindow overrides: + base::Optional<std::vector<gfx::Rect>> GetWindowShape() const override; + private: // WaylandWindow overrides: void HandleSurfaceConfigure(int32_t widht, @@ -64,6 +67,11 @@ bool is_activated) override; bool OnInitialize(PlatformWindowInitProperties properties) override; bool IsActive() const override; + // Calls UpdateWindowShape, set_input_region and set_opaque_region + // for this toplevel window. + void UpdateWindowMask() override; + // Update the window shape using the window mask of PlatformWindowDelegate. + void UpdateWindowShape() override; // WmMoveLoopHandler: bool RunMoveLoop(const gfx::Vector2d& drag_offset) override; @@ -141,6 +149,8 @@ // When use_native_frame is true, server-side decoration is set, // e.g. lacros-taskmanager. bool use_native_frame_ = false; + + base::Optional<std::vector<gfx::Rect>> window_shape_; }; } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc index f14adef..a3e55d1 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_window.cc
@@ -191,7 +191,7 @@ return; bounds_px_ = bounds_px; - root_surface_->SetOpaqueRegion(gfx::Rect(bounds_px_.size())); + UpdateWindowMask(); delegate_->OnBoundsChanged(bounds_px_); } @@ -394,6 +394,17 @@ delegate_->OnCloseRequest(); } +base::Optional<std::vector<gfx::Rect>> WaylandWindow::GetWindowShape() const { + return base::nullopt; +} + +void WaylandWindow::UpdateWindowMask() { + UpdateWindowShape(); + root_surface_->SetOpaqueRegion(bounds_px_); +} + +void WaylandWindow::UpdateWindowShape() {} + void WaylandWindow::OnDragEnter(const gfx::PointF& point, std::unique_ptr<OSExchangeData> data, int operation) {
diff --git a/ui/ozone/platform/wayland/host/wayland_window.h b/ui/ozone/platform/wayland/host/wayland_window.h index 4e0a01c..d45e107 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.h +++ b/ui/ozone/platform/wayland/host/wayland_window.h
@@ -177,6 +177,8 @@ virtual void OnDragLeave(); virtual void OnDragSessionClose(uint32_t dnd_action); + virtual base::Optional<std::vector<gfx::Rect>> GetWindowShape() const; + // Returns a root parent window within the same hierarchy. WaylandWindow* GetRootParentWindow(); @@ -211,6 +213,9 @@ void set_ui_scale(int32_t ui_scale) { ui_scale_ = ui_scale; } + // Calls set_opaque_region for this window. + virtual void UpdateWindowMask(); + private: FRIEND_TEST_ALL_PREFIXES(WaylandScreenTest, SetBufferScale); @@ -226,6 +231,8 @@ // Additional initialization of derived classes. virtual bool OnInitialize(PlatformWindowInitProperties properties) = 0; + virtual void UpdateWindowShape(); + // WaylandWindowDragController might need to take ownership of the wayland // surface whether the window that originated the DND session gets destroyed // in the middle of that session (e.g: when it is snapped into a tab strip).
diff --git a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc index aa9197b..94e31f1 100644 --- a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc +++ b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc
@@ -815,6 +815,51 @@ EXPECT_EQ(restored_bounds, gfx::Rect()); } +TEST_P(WaylandWindowTest, UpdateWindowRegion) { + wl::MockSurface* mock_surface = server_.GetObject<wl::MockSurface>( + window_->root_surface()->GetSurfaceId()); + + // Change bounds. + const gfx::Rect initial_bounds = window_->GetBounds(); + const gfx::Rect new_bounds = gfx::Rect(0, 0, initial_bounds.width() + 10, + initial_bounds.height() + 10); + EXPECT_CALL(*mock_surface, SetOpaqueRegion(_)).Times(1); + EXPECT_CALL(*mock_surface, SetInputRegion(_)).Times(1); + window_->SetBounds(new_bounds); + Sync(); + VerifyAndClearExpectations(); + EXPECT_EQ(mock_surface->opaque_region(), new_bounds); + EXPECT_EQ(mock_surface->input_region(), new_bounds); + + // Maximize. + ScopedWlArray states = InitializeWlArrayWithActivatedState(); + EXPECT_CALL(*mock_surface, SetOpaqueRegion(_)).Times(1); + EXPECT_CALL(*mock_surface, SetInputRegion(_)).Times(1); + const gfx::Rect maximized_bounds = gfx::Rect(0, 0, 1024, 768); + window_->Maximize(); + AddStateToWlArray(XDG_TOPLEVEL_STATE_MAXIMIZED, states.get()); + SendConfigureEvent(xdg_surface_, maximized_bounds.width(), + maximized_bounds.height(), 1, states.get()); + Sync(); + VerifyAndClearExpectations(); + EXPECT_EQ(mock_surface->opaque_region(), maximized_bounds); + EXPECT_EQ(mock_surface->input_region(), maximized_bounds); + + // Restore. + const gfx::Rect restored_bounds = window_->GetRestoredBoundsInPixels(); + EXPECT_CALL(*mock_surface, SetOpaqueRegion(_)).Times(1); + EXPECT_CALL(*mock_surface, SetInputRegion(_)).Times(1); + window_->Restore(); + // Reinitialize wl_array, which removes previous old states. + auto active = InitializeWlArrayWithActivatedState(); + SendConfigureEvent(xdg_surface_, 0, 0, 2, active.get()); + Sync(); + VerifyAndClearExpectations(); + + EXPECT_EQ(mock_surface->opaque_region(), restored_bounds); + EXPECT_EQ(mock_surface->input_region(), restored_bounds); +} + TEST_P(WaylandWindowTest, CanDispatchMouseEventDefault) { EXPECT_FALSE(window_->CanDispatchEvent(&test_mouse_event_)); }
diff --git a/ui/ozone/platform/wayland/test/mock_surface.cc b/ui/ozone/platform/wayland/test/mock_surface.cc index f2039e5..33b9ae34 100644 --- a/ui/ozone/platform/wayland/test/mock_surface.cc +++ b/ui/ozone/platform/wayland/test/mock_surface.cc
@@ -28,7 +28,7 @@ void SetInputRegion(wl_client* client, wl_resource* resource, wl_resource* region) { - GetUserDataAs<MockSurface>(resource)->SetInputRegion(region); + GetUserDataAs<MockSurface>(resource)->SetInputRegionImpl(region); } void Damage(wl_client* client, @@ -103,6 +103,10 @@ } void MockSurface::SetOpaqueRegionImpl(wl_resource* region) { + if (!region) { + opaque_region_ = gfx::Rect(-1, -1, 0, 0); + return; + } auto bounds = GetUserDataAs<TestRegion>(region)->getBounds(); opaque_region_ = gfx::Rect(bounds.fLeft, bounds.fTop, bounds.fRight - bounds.fLeft, @@ -111,6 +115,22 @@ SetOpaqueRegion(region); } +void MockSurface::SetInputRegionImpl(wl_resource* region) { + // It is unsafe to always treat |region| as a valid pointer. + // According to the protocol about wl_surface::set_input_region + // "A NULL wl_region cuases the input region to be set to infinite." + if (!region) { + input_region_ = gfx::Rect(-1, -1, 0, 0); + return; + } + auto bounds = GetUserDataAs<TestRegion>(region)->getBounds(); + input_region_ = + gfx::Rect(bounds.fLeft, bounds.fTop, bounds.fRight - bounds.fLeft, + bounds.fBottom - bounds.fTop); + + SetInputRegion(region); +} + void MockSurface::AttachNewBuffer(wl_resource* buffer_resource, int32_t x, int32_t y) {
diff --git a/ui/ozone/platform/wayland/test/mock_surface.h b/ui/ozone/platform/wayland/test/mock_surface.h index 0901319..fd682b8 100644 --- a/ui/ozone/platform/wayland/test/mock_surface.h +++ b/ui/ozone/platform/wayland/test/mock_surface.h
@@ -57,6 +57,7 @@ TestViewport* viewport() { return viewport_; } gfx::Rect opaque_region() const { return opaque_region_; } + gfx::Rect input_region() const { return input_region_; } void set_frame_callback(wl_resource* callback_resource) { DCHECK(!frame_callback_); @@ -69,6 +70,7 @@ bool has_role() const { return !!xdg_surface_ || !!sub_surface_; } void SetOpaqueRegionImpl(wl_resource* region); + void SetInputRegionImpl(wl_resource* region); void AttachNewBuffer(wl_resource* buffer_resource, int32_t x, int32_t y); void DestroyPrevAttachedBuffer(); void ReleaseBuffer(wl_resource* buffer); @@ -79,6 +81,7 @@ TestSubSurface* sub_surface_ = nullptr; TestViewport* viewport_ = nullptr; gfx::Rect opaque_region_ = {-1, -1, 0, 0}; + gfx::Rect input_region_ = {-1, -1, 0, 0}; wl_resource* frame_callback_ = nullptr;
diff --git a/ui/platform_window/DEPS b/ui/platform_window/DEPS index b51da65..baa2776 100644 --- a/ui/platform_window/DEPS +++ b/ui/platform_window/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+third_party/skia/include", "+ui/base", "+ui/gfx", ]
diff --git a/ui/platform_window/extensions/x11_extension_delegate.h b/ui/platform_window/extensions/x11_extension_delegate.h index 86ec59d2..381f2994 100644 --- a/ui/platform_window/extensions/x11_extension_delegate.h +++ b/ui/platform_window/extensions/x11_extension_delegate.h
@@ -12,12 +12,6 @@ using AtkKeyEventStruct = struct _AtkKeyEventStruct; #endif -class SkPath; - -namespace gfx { -class Size; -} - namespace ui { class COMPONENT_EXPORT(PLATFORM_WINDOW) X11ExtensionDelegate { @@ -30,10 +24,6 @@ // (menu) windows. virtual void OnLostMouseGrab() = 0; - // Returns a mask to be used to clip the window for the given - // size. This is used to create the non-rectangular window shape. - virtual void GetWindowMask(const gfx::Size& size, SkPath* window_mask) = 0; - #if BUILDFLAG(USE_ATK) // Notifies an ATK key event to be processed. The transient parameter will be // true if the event target is a transient window (e.g. a modal dialog)
diff --git a/ui/platform_window/platform_window_delegate.cc b/ui/platform_window/platform_window_delegate.cc index fb685b3..c93bb3e 100644 --- a/ui/platform_window/platform_window_delegate.cc +++ b/ui/platform_window/platform_window_delegate.cc
@@ -4,6 +4,7 @@ #include "ui/platform_window/platform_window_delegate.h" +#include "third_party/skia/include/core/SkPath.h" #include "ui/gfx/geometry/size.h" namespace ui { @@ -20,4 +21,9 @@ return base::nullopt; } +base::Optional<SkPath> PlatformWindowDelegate::GetWindowMaskForWindowShape( + const gfx::Size& size_in_pixels) { + return base::nullopt; +} + } // namespace ui
diff --git a/ui/platform_window/platform_window_delegate.h b/ui/platform_window/platform_window_delegate.h index 6ffdaa15..05054d1 100644 --- a/ui/platform_window/platform_window_delegate.h +++ b/ui/platform_window/platform_window_delegate.h
@@ -14,6 +14,8 @@ class Size; } // namespace gfx +class SkPath; + namespace ui { class Event; @@ -63,6 +65,11 @@ virtual base::Optional<gfx::Size> GetMinimumSizeForWindow(); virtual base::Optional<gfx::Size> GetMaximumSizeForWindow(); + // Returns a mask to be used to clip the window for the given + // size. This is used to create the non-rectangular window shape. + virtual base::Optional<SkPath> GetWindowMaskForWindowShape( + const gfx::Size& size_in_pixels); + // Called when the location of mouse pointer entered the window. This is // different from ui::ET_MOUSE_ENTERED which may not be generated when mouse // is captured either by implicitly or explicitly.
diff --git a/ui/platform_window/x11/test/x11_window_unittest.cc b/ui/platform_window/x11/test/x11_window_unittest.cc index b0950b0..945fc5b3 100644 --- a/ui/platform_window/x11/test/x11_window_unittest.cc +++ b/ui/platform_window/x11/test/x11_window_unittest.cc
@@ -73,6 +73,21 @@ } void OnActivationChanged(bool active) override {} void OnMouseEnter() override {} + base::Optional<SkPath> GetWindowMaskForWindowShape( + const gfx::Size& size_in_pixels) override { + SkPath window_mask; + int right = size_in_pixels.width(); + int bottom = size_in_pixels.height(); + + window_mask.moveTo(0, 0); + window_mask.lineTo(0, bottom); + window_mask.lineTo(right, bottom); + window_mask.lineTo(right, 10); + window_mask.lineTo(right - 10, 10); + window_mask.lineTo(right - 10, 0); + window_mask.close(); + return window_mask; + } private: gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget; @@ -90,18 +105,6 @@ ~ShapedX11ExtensionDelegate() override = default; void OnLostMouseGrab() override {} - void GetWindowMask(const gfx::Size& size, SkPath* window_mask) override { - int right = size.width(); - int bottom = size.height(); - - window_mask->moveTo(0, 0); - window_mask->lineTo(0, bottom); - window_mask->lineTo(right, bottom); - window_mask->lineTo(right, 10); - window_mask->lineTo(right - 10, 10); - window_mask->lineTo(right - 10, 0); - window_mask->close(); - } #if BUILDFLAG(USE_ATK) bool OnAtkKeyEvent(AtkKeyEventStruct* atk_key_event, bool transient) override {
diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc index a70699ea..0cfcb1c 100644 --- a/ui/platform_window/x11/x11_window.cc +++ b/ui/platform_window/x11/x11_window.cc
@@ -765,8 +765,10 @@ void X11Window::GetWindowMaskForXWindow(const gfx::Size& size, SkPath* window_mask) { - if (x11_extension_delegate_) - x11_extension_delegate_->GetWindowMask(size, window_mask); + base::Optional<SkPath> path = + platform_window_delegate_->GetWindowMaskForWindowShape(size); + if (path.has_value()) + *window_mask = path.value(); } void X11Window::DispatchHostWindowDragMovement(
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index 03db25c7..a7c7d96 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -826,6 +826,8 @@ "widget/desktop_aura/desktop_drag_drop_client_ozone.h", "widget/desktop_aura/desktop_window_tree_host_platform.cc", "widget/desktop_aura/window_move_client_platform.cc", + "widget/desktop_aura/window_shape_updater.cc", + "widget/desktop_aura/window_shape_updater.h", ] } if (use_atk) {
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc index 0bdc147..a0f75cc9 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc
@@ -339,17 +339,6 @@ non_client_window_event_filter_.reset(); } -void DesktopWindowTreeHostLinux::GetWindowMask(const gfx::Size& size, - SkPath* window_mask) { - DCHECK(window_mask); - Widget* widget = native_widget_delegate()->AsWidget(); - if (widget->non_client_view()) { - // Some frame views define a custom (non-rectangular) window mask. If - // so, use it to define the window shape. If not, fall through. - widget->non_client_view()->GetWindowMask(size, window_mask); - } -} - void DesktopWindowTreeHostLinux::OnLostMouseGrab() { dispatcher()->OnHostLostMouseGrab(); }
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h index 4b6a5a4..e033937 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h
@@ -19,8 +19,6 @@ #include "ui/views/views_export.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h" -class SkPath; - namespace aura { class ScopedWindowTargeter; } // namespace aura @@ -106,7 +104,6 @@ void DestroyNonClientEventFilter(); // X11ExtensionDelegate overrides: - void GetWindowMask(const gfx::Size& size, SkPath* window_mask) override; void OnLostMouseGrab() override; #if BUILDFLAG(USE_ATK) bool OnAtkKeyEvent(AtkKeyEventStruct* atk_key_event, bool transient) override;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc index 6a1fcf7..50d62e6 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
@@ -11,6 +11,7 @@ #include "base/bind.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" +#include "third_party/skia/include/core/SkPath.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/focus_client.h" @@ -27,6 +28,7 @@ #include "ui/views/corewm/tooltip_aura.h" #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" +#include "ui/views/widget/desktop_aura/window_shape_updater.h" #include "ui/views/widget/widget_aura_utils.h" #include "ui/views/window/native_frame_view.h" #include "ui/wm/core/window_util.h" @@ -198,7 +200,13 @@ native_widget_delegate_->OnNativeWidgetCreated(); } -void DesktopWindowTreeHostPlatform::OnWidgetInitDone() {} +void DesktopWindowTreeHostPlatform::OnWidgetInitDone() { + // WindowShape is updated from ShapeRects transformed from + // NonClientView::GetWindowMask. We can guarantee that |NonClientView| is + // created OnWidgetInitDone. + WindowShapeUpdater::CreateWindowShapeUpdater( + this, this->desktop_native_widget_aura()); +} void DesktopWindowTreeHostPlatform::OnActiveWindowChanged(bool active) {} @@ -436,6 +444,8 @@ void DesktopWindowTreeHostPlatform::SetShape( std::unique_ptr<Widget::ShapeRects> native_shape) { + // TODO(crbug.com/1158733) : When supporting PlatformWindow::SetShape, + // Calls ui::Layer::SetAlphaShape and sets |is_shape_explicitly_set_| to true. platform_window()->SetShape(std::move(native_shape), GetRootTransform()); } @@ -558,7 +568,10 @@ } bool DesktopWindowTreeHostPlatform::ShouldWindowContentsBeTransparent() const { - return platform_window()->ShouldWindowContentsBeTransparent(); + return platform_window()->ShouldWindowContentsBeTransparent() || + const_cast<DesktopWindowTreeHostPlatform*>(this) + ->GetWindowMaskForWindowShape(GetBoundsInPixels().size()) + .has_value(); } void DesktopWindowTreeHostPlatform::FrameTypeChanged() { @@ -738,6 +751,20 @@ .size(); } +base::Optional<SkPath> +DesktopWindowTreeHostPlatform::GetWindowMaskForWindowShape( + const gfx::Size& size_in_pixels) { + if (GetWidget()->non_client_view()) { + SkPath window_mask; + // Some frame views define a custom (non-rectanguar) window mask. + // If so, use it to define the window shape. If not, fall through. + GetWidget()->non_client_view()->GetWindowMask(size_in_pixels, &window_mask); + if (!window_mask.isEmpty()) + return window_mask; + } + return base::nullopt; +} + void DesktopWindowTreeHostPlatform::OnWorkspaceChanged() { OnHostWorkspaceChanged(); }
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h index 8db9bca..3eeb80848 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
@@ -42,6 +42,8 @@ aura::Window* GetContentWindow(); const aura::Window* GetContentWindow() const; + bool is_shape_explicitly_set() const { return is_shape_explicitly_set_; } + // DesktopWindowTreeHost: void Init(const Widget::InitParams& params) override; void OnNativeWidgetCreated(const Widget::InitParams& params) override; @@ -121,6 +123,8 @@ void OnActivationChanged(bool active) override; base::Optional<gfx::Size> GetMinimumSizeForWindow() override; base::Optional<gfx::Size> GetMaximumSizeForWindow() override; + base::Optional<SkPath> GetWindowMaskForWindowShape( + const gfx::Size& size_in_pixels) override; // ui::WorkspaceExtensionDelegate: void OnWorkspaceChanged() override; @@ -174,6 +178,10 @@ // Used for tab dragging in move loop requests. WindowMoveClientPlatform window_move_client_; + // ui::Layer::SetAlphaShape can be set from either SetShape or default window + // mask. When explicitly setting from SetShape, |explicitly_set_shape_:true|. + bool is_shape_explicitly_set_ = false; + base::WeakPtrFactory<DesktopWindowTreeHostPlatform> close_widget_factory_{ this};
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform_unittest.cc index 45c1da7..b228f8b 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform_unittest.cc
@@ -167,6 +167,37 @@ EXPECT_TRUE(widget->GetNativeWindow()->IsVisible()); } +// Tests that the window shape is updated from the +// |NonClientView::GetWindowMask|. +TEST_F(DesktopWindowTreeHostPlatformTest, UpdateWindowShapeFromWindowMask) { + std::unique_ptr<Widget> widget = CreateWidgetWithNativeWidget(); + widget->Show(); + + auto* host_platform = DesktopWindowTreeHostPlatform::GetHostForWidget( + widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); + ASSERT_TRUE(host_platform); + auto* content_window = + DesktopWindowTreeHostPlatform::GetContentWindowForWidget( + widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); + ASSERT_TRUE(content_window); + // alpha_shape for the layer of content window is updated from the + // |NonClientView::GetWindowMask|. + EXPECT_TRUE(host_platform + ->GetWindowMaskForWindowShape(content_window->bounds().size()) + .has_value()); + EXPECT_TRUE(content_window->layer()->alpha_shape()); + + // When fullscreen mode, alpha_shape is set to empty since there is no + // |NonClientView::GetWindowMask|. + host_platform->SetFullscreen(true); + widget->SetBounds(gfx::Rect(800, 800)); + EXPECT_FALSE( + host_platform + ->GetWindowMaskForWindowShape(content_window->bounds().size()) + .has_value()); + EXPECT_FALSE(content_window->layer()->alpha_shape()); +} + // A Widget that allows setting the min/max size for the widget. class CustomSizeWidget : public Widget { public:
diff --git a/ui/views/widget/desktop_aura/window_shape_updater.cc b/ui/views/widget/desktop_aura/window_shape_updater.cc new file mode 100644 index 0000000..225d526 --- /dev/null +++ b/ui/views/widget/desktop_aura/window_shape_updater.cc
@@ -0,0 +1,77 @@ +// Copyright 2021 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 "ui/views/widget/desktop_aura/window_shape_updater.h" + +#include "ui/gfx/skia_util.h" +#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" +#include "ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h" + +namespace { + +std::unique_ptr<ui::Layer::ShapeRects> ConvertToShapeRects(const SkPath& path) { + // Converts to ShapeRects from SkPath. + auto shape_rects = std::make_unique<ui::Layer::ShapeRects>(); + SkRegion clip_region; + clip_region.setRect(path.getBounds().round()); + SkRegion region; + region.setPath(path, clip_region); + for (SkRegion::Iterator it(region); !it.done(); it.next()) + shape_rects->push_back(gfx::SkIRectToRect(it.rect())); + return shape_rects; +} + +} // namespace + +namespace views { + +// static +WindowShapeUpdater* WindowShapeUpdater::CreateWindowShapeUpdater( + DesktopWindowTreeHostPlatform* tree_host, + DesktopNativeWidgetAura* native_widget_aura) { + return new WindowShapeUpdater(tree_host, native_widget_aura); +} + +WindowShapeUpdater::WindowShapeUpdater( + DesktopWindowTreeHostPlatform* tree_host, + DesktopNativeWidgetAura* native_widget_aura) + : tree_host_(tree_host), native_widget_aura_(native_widget_aura) { + tree_host_->GetContentWindow()->AddObserver(this); + UpdateWindowShapeFromWindowMask(tree_host_->GetContentWindow()); +} + +void WindowShapeUpdater::OnWindowBoundsChanged( + aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds, + ui::PropertyChangeReason reason) { + UpdateWindowShapeFromWindowMask(window); +} + +void WindowShapeUpdater::OnWindowDestroying(aura::Window* window) { + window->RemoveObserver(this); + delete this; +} + +void WindowShapeUpdater::UpdateWindowShapeFromWindowMask(aura::Window* window) { + // If |ui::Layer::alpha_shape_| is set explicitly from SetShape, + // we don't need to set default window mask from non_client_view. + if (tree_host_->is_shape_explicitly_set()) + return; + // WindowTransparency should be updated as well when the window shape is + // changed. When a window mask exists, transparent should be true to prevent + // compositor from filling the entire screen in AppendQuadsToFillScreen. + // Otherwise, transparent should be false. + native_widget_aura_->UpdateWindowTransparency(); + base::Optional<SkPath> path = + tree_host_->GetWindowMaskForWindowShape(window->bounds().size()); + if (path.has_value()) { + // SetAlphaShape to the layer of |content_window_| + window->layer()->SetAlphaShape(ConvertToShapeRects(path.value())); + } else { + window->layer()->SetAlphaShape(nullptr); + } +} + +} // namespace views
diff --git a/ui/views/widget/desktop_aura/window_shape_updater.h b/ui/views/widget/desktop_aura/window_shape_updater.h new file mode 100644 index 0000000..ec77362 --- /dev/null +++ b/ui/views/widget/desktop_aura/window_shape_updater.h
@@ -0,0 +1,49 @@ +// Copyright 2021 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 UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_SHAPE_UPDATER_H_ +#define UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_SHAPE_UPDATER_H_ + +#include <memory> + +#include "ui/aura/window_observer.h" +#include "ui/compositor/layer.h" + +namespace views { + +class DesktopNativeWidgetAura; +class DesktopWindowTreeHostPlatform; + +// Class to observe the window bounds changed to update window shape +// for the rounded corner of the browser frame. +class WindowShapeUpdater : public aura::WindowObserver { + public: + static WindowShapeUpdater* CreateWindowShapeUpdater( + DesktopWindowTreeHostPlatform* tree_host, + DesktopNativeWidgetAura* native_widget_aura); + + private: + WindowShapeUpdater(DesktopWindowTreeHostPlatform* tree_host, + DesktopNativeWidgetAura* native_widget_aura); + WindowShapeUpdater(const WindowShapeUpdater&) = delete; + WindowShapeUpdater& operator=(const WindowShapeUpdater&) = delete; + ~WindowShapeUpdater() override = default; + + // aura::WindowObserver: + void OnWindowBoundsChanged(aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds, + ui::PropertyChangeReason reason) override; + + void OnWindowDestroying(aura::Window* window) override; + + void UpdateWindowShapeFromWindowMask(aura::Window* window); + + DesktopWindowTreeHostPlatform* tree_host_ = nullptr; + DesktopNativeWidgetAura* native_widget_aura_ = nullptr; +}; + +} // namespace views + +#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_SHAPE_UPDATER_H_
diff --git a/ui/webui/resources/cr_components/BUILD.gn b/ui/webui/resources/cr_components/BUILD.gn index a261bcb7..7337a5e 100644 --- a/ui/webui/resources/cr_components/BUILD.gn +++ b/ui/webui/resources/cr_components/BUILD.gn
@@ -38,6 +38,7 @@ "chromeos/cellular_setup/psim_2x.png", "chromeos/cellular_setup/esim_1x.png", "chromeos/cellular_setup/esim_2x.png", + "chromeos/cellular_setup/default_esim_profile.svg", "chromeos/network/cellular_0_with_x.svg", "chromeos/network/cellular_0.svg", "chromeos/network/cellular_1.svg",
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.html index 2d24cee..d129a10 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.html
@@ -6,11 +6,43 @@ <dom-module id="confirmation-code-page"> <template> <style include="iron-flex"> + [slot='page-body'] { + margin-top: -20px; + } + + #details { + align-items: center; + color: var(--cr-primary-text-color); + display: flex; + margin-bottom: 40px; + margin-top: 60px; + } + + #profileImage { + margin-inline-end: 16px; + } + + #confirmationCode { + margin-inline-end: 16px; + } </style> <base-page> - <div slot="page-body" class="layout horizontal center-center"> - <!-- TODO(crbug.com/1093185): Create UI for confirmation code page. --> - Please enter your confirmation code for [[getProfileName_(profileProperties_)]]. + <div slot="page-body"> + <!-- TODO(crbug.com/1093185): Handle activation code case where + we don't have profileProperties_. --> + <div id="description">[[getMessage_(profileProperties_)]]</div> + <div id="details"> + <!-- TODO(crbug.com/1093185): Update with real profile image. --> + <img id="profileImage" src="default_esim_profile.svg"> + <div> + [[getProfileName_(profileProperties_)]] + </div> + </div> + <cr-input id="confirmationCode" + label="[[i18n('confirmationCodeInput')]]" + value="{{confirmationCode}}" + aria-describedby="description"> + </cr-input> </div> </base-page> </template>
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.js b/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.js index 84b91e80..edbd11ac 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.js +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/confirmation_code_page.js
@@ -21,6 +21,11 @@ observer: 'onProfileChanged_', }, + confirmationCode: { + type: String, + notify: true, + }, + /** * @type {?chromeos.cellularSetup.mojom.ESimProfileProperties} * @private @@ -46,6 +51,18 @@ * @return {string} * @private */ + getMessage_() { + const profileName = this.getProfileName_(); + if (!profileName) { + return ''; + } + return this.i18n('confirmationCodeMessage', profileName); + }, + + /** + * @return {string} + * @private + */ getProfileName_() { if (!this.profileProperties_) { return '';
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/default_esim_profile.svg b/ui/webui/resources/cr_components/chromeos/cellular_setup/default_esim_profile.svg new file mode 100644 index 0000000..058d7e0 --- /dev/null +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/default_esim_profile.svg
@@ -0,0 +1 @@ +<svg width="31" height="20" viewBox="0 0 31 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h23a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H4zm7.704 10.915h-3.55V6.18h-1.36V14h4.91v-1.085zm4.254-5.64h2.438V6.18h-6.203v1.095h2.417V14h1.348V7.275zm4.823 3.234h3.212V9.435h-3.212v-2.16h3.717V6.18h-5.076V14h5.114v-1.085H20.78v-2.406z" fill="#5F6368"/></svg> \ No newline at end of file
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.html index 79704c5..b41e8b9 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.html
@@ -39,6 +39,7 @@ show-error="{{showError_}}"> </activation-code-page> <confirmation-code-page id="confirmationCodePage" + confirmation-code="{{confirmationCode_}}" profile="[[selectedProfile_]]"> </confirmation-code-page> <final-page
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.js b/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.js index 414a91a..6796c63 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.js +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/esim_flow_ui.js
@@ -88,6 +88,13 @@ type: String, value: '', }, + + /** @private */ + confirmationCode_: { + type: String, + value: '', + observer: 'onConfirmationCodeUpdated_', + }, }, /** @@ -162,6 +169,7 @@ * response */ handleProfileInstallResponse_(response) { + // TODO(crbug.com/1093185) Handle error during confirmation code page. this.showError_ = response.result !== chromeos.cellularSetup.mojom.ProfileInstallResult.kSuccess; if (response.result === @@ -224,11 +232,11 @@ cancel: this.delegate.shouldShowCancelButton() ? cellularSetup.ButtonState.SHOWN_AND_ENABLED : cellularSetup.ButtonState.HIDDEN, - done: cellularSetup.ButtonState.SHOWN_AND_ENABLED, - next: cellularSetup.ButtonState.HIDDEN, + done: cellularSetup.ButtonState.HIDDEN, + // TODO(crbug.com/1093185) Add a "Confirm" button state. + next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED, tryAgain: cellularSetup.ButtonState.HIDDEN, skipDiscovery: cellularSetup.ButtonState.HIDDEN, - // TODO(crbug.com/1093185) Add a "Confirm" button state. }; break; case ESimUiState.PROFILE_SELECTION: @@ -285,6 +293,20 @@ } }, + /** @private */ + onConfirmationCodeUpdated_() { + // TODO(crbug.com/1093185) Change this to updating a "Confirm" button's + // state. + if (this.confirmationCode_) { + this.set( + 'buttonState.next', cellularSetup.ButtonState.SHOWN_AND_ENABLED); + } else { + this.set( + 'buttonState.next', cellularSetup.ButtonState.SHOWN_BUT_DISABLED); + } + }, + + /** SubflowBehavior override */ navigateForward() { switch (this.state_) { case ESimUiState.ACTIVATION_CODE_ENTRY: @@ -297,12 +319,25 @@ break; case ESimUiState.PROFILE_SELECTION: if (this.selectedProfile_) { + // Assume installing the profile doesn't require a confirmation + // code, send an empty string. this.selectedProfile_.installProfile('').then( this.handleProfileInstallResponse_.bind(this)); } else { this.state_ = ESimUiState.ACTIVATION_CODE_ENTRY; } break; + case ESimUiState.CONFIRMATION_CODE_ENTRY: + if (this.selectedProfile_) { + this.selectedProfile_.installProfile(this.confirmationCode_) + .then(this.handleProfileInstallResponse_.bind(this)); + } else { + this.euicc_ + .installProfileFromActivationCode( + this.activationCode_, this.confirmationCode_) + .then(this.handleProfileInstallResponse_.bind(this)); + } + break; default: assertNotReached(); break; @@ -311,6 +346,7 @@ /** * @returns {boolean} true if backward navigation was handled + * SubflowBehavior override */ attemptBackwardNavigation() { // TODO(crbug.com/1093185): Handle state when camera is used
diff --git a/ui/webui/resources/js/cr/ui/BUILD.gn b/ui/webui/resources/js/cr/ui/BUILD.gn index b0cba354..7825de6 100644 --- a/ui/webui/resources/js/cr/ui/BUILD.gn +++ b/ui/webui/resources/js/cr/ui/BUILD.gn
@@ -39,7 +39,6 @@ "array_data_model.js", "bubble_button.js", "bubble.js", - "card_slider.js", "command.js", "context_menu_handler.js", "dialogs.js", @@ -63,7 +62,6 @@ "store_client.js", "store.js", "tabs.js", - "touch_handler.js", "tree.js", ]
diff --git a/ui/wm/core/ime_util_chromeos.cc b/ui/wm/core/ime_util_chromeos.cc index 03e98076..552ea8cbd 100644 --- a/ui/wm/core/ime_util_chromeos.cc +++ b/ui/wm/core/ime_util_chromeos.cc
@@ -59,9 +59,6 @@ nullptr) void RestoreWindowBoundsOnClientFocusLost(aura::Window* window) { - window->GetRootWindow()->ClearProperty( - aura::client::kEmbeddedWindowEnsureNotInRect); - // Get restore bounds of the window gfx::Rect* vk_restore_bounds = window->GetProperty(kVirtualKeyboardRestoreBoundsKey); @@ -97,37 +94,4 @@ MoveWindowToEnsureCaretNotInRect(window, rect_in_screen); } -EnsureWindowNotInRectHelper::EnsureWindowNotInRectHelper( - aura::Window* embedding_root) - : embedding_root_(embedding_root) { - embedding_root_->AddObserver(this); -} - -EnsureWindowNotInRectHelper::~EnsureWindowNotInRectHelper() { - if (embedding_root_) - embedding_root_->RemoveObserver(this); -} - -void EnsureWindowNotInRectHelper::OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) { - DCHECK_EQ(embedding_root_, window); - - if (key != aura::client::kEmbeddedWindowEnsureNotInRect) - return; - - aura::Window* top_level = embedding_root_->GetToplevelWindow(); - gfx::Rect* rect_in_screen = embedding_root_->GetProperty( - aura::client::kEmbeddedWindowEnsureNotInRect); - if (rect_in_screen) - EnsureWindowNotInRect(top_level, *rect_in_screen); - else - RestoreWindowBoundsOnClientFocusLost(top_level); -} - -void EnsureWindowNotInRectHelper::OnWindowDestroyed(aura::Window* window) { - DCHECK_EQ(embedding_root_, window); - embedding_root_ = nullptr; -} - } // namespace wm
diff --git a/ui/wm/core/ime_util_chromeos.h b/ui/wm/core/ime_util_chromeos.h index 346820c..eb5faae 100644 --- a/ui/wm/core/ime_util_chromeos.h +++ b/ui/wm/core/ime_util_chromeos.h
@@ -6,7 +6,6 @@ #define UI_WM_CORE_IME_UTIL_CHROMEOS_H_ #include "ui/aura/window.h" -#include "ui/aura/window_observer.h" #include "ui/wm/core/wm_core_export.h" namespace gfx { @@ -20,11 +19,7 @@ WM_CORE_EXPORT extern const aura::WindowProperty<gfx::Rect*>* const kVirtualKeyboardRestoreBoundsKey; -// Moves |window| to ensure it does not intersect with |rect_in_screen| if it -// does not belong to an embedded window tree. Otherwise, sets |rect_in_screen| -// in kEmbeddedWindowEnsureNotInRect window property on the root window of the -// embedded tree so that the embedding side could forward the call to the -// relevant top level window. See also EnsureWindowNotInRectHelper. +// Moves |window| to ensure it does not intersect with |rect_in_screen|. WM_CORE_EXPORT void EnsureWindowNotInRect(aura::Window* window, const gfx::Rect& rect_in_screen); @@ -32,25 +27,6 @@ WM_CORE_EXPORT void RestoreWindowBoundsOnClientFocusLost( aura::Window* top_level_window); -// Helper to call EnsureWindowNotInRect/RestoreWindowBoundsOnClientFocusLost -// on the top-level window of an embedding root when its -// kEmbeddedWindowEnsureNotInRect window property changes. -class WM_CORE_EXPORT EnsureWindowNotInRectHelper : public aura::WindowObserver { - public: - explicit EnsureWindowNotInRectHelper(aura::Window* embedding_root); - ~EnsureWindowNotInRectHelper() override; - - private: - // aura::WindowObsever: - void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) override; - void OnWindowDestroyed(aura::Window* window) override; - - aura::Window* embedding_root_ = nullptr; - DISALLOW_COPY_AND_ASSIGN(EnsureWindowNotInRectHelper); -}; - } // namespace wm #endif // UI_WM_CORE_IME_UTIL_CHROMEOS_H_
diff --git a/ui/wm/core/ime_util_chromeos_unittest.cc b/ui/wm/core/ime_util_chromeos_unittest.cc index 3096705e..41fe2f1 100644 --- a/ui/wm/core/ime_util_chromeos_unittest.cc +++ b/ui/wm/core/ime_util_chromeos_unittest.cc
@@ -128,23 +128,4 @@ EXPECT_EQ(original_bounds, window->GetBoundsInScreen()); } -// Tests that setting/clearing kEmbeddedWindowEnsureNotInRect window property -// triggers the relevant top level to be moved/restored. -TEST_F(ImeUtilChromeosTest, EnsureWindowNotInRectHelper) { - const gfx::Rect original_bounds(10, 10, 100, 100); - aura::Window* top_level = aura::test::CreateTestWindow( - SK_ColorWHITE, 1, original_bounds, root_window()); - aura::Window* embedding_root = aura::test::CreateTestWindowWithBounds( - gfx::Rect(original_bounds.size()), top_level); - EnsureWindowNotInRectHelper helper(embedding_root); - - gfx::Rect occluded_rect(50, 50, 200, 200); - embedding_root->SetProperty(aura::client::kEmbeddedWindowEnsureNotInRect, - new gfx::Rect(occluded_rect)); - EXPECT_EQ(gfx::Rect(10, 0, 100, 100), top_level->bounds()); - - embedding_root->ClearProperty(aura::client::kEmbeddedWindowEnsureNotInRect); - EXPECT_EQ(original_bounds, top_level->bounds()); -} - } // namespace wm
diff --git a/url/BUILD.gn b/url/BUILD.gn index 9b72a07..0e3e91ee 100644 --- a/url/BUILD.gn +++ b/url/BUILD.gn
@@ -171,6 +171,20 @@ } } +source_set("url_test_support") { + testonly = true + + sources = [ "origin_abstract_tests.h" ] + + public_deps = [ + ":url", + "//base", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + ] +} + test("url_unittests") { sources = [ "gurl_unittest.cc", @@ -186,6 +200,7 @@ deps = [ ":url", + ":url_test_support", "//base", "//base/test:test_support", "//testing/gmock",
diff --git a/url/origin_abstract_tests.h b/url/origin_abstract_tests.h new file mode 100644 index 0000000..eeb8f213 --- /dev/null +++ b/url/origin_abstract_tests.h
@@ -0,0 +1,99 @@ +// Copyright 2020 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 URL_ORIGIN_ABSTRACT_TESTS_H_ +#define URL_ORIGIN_ABSTRACT_TESTS_H_ + +#include <string> +#include <type_traits> + +#include "base/strings/string_piece.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/url_util.h" + +namespace url { + +// AbstractOriginTest below abstracts away differences between url::Origin and +// blink::SecurityOrigin by parametrizing the tests with a class that has to be +// derived from OriginTraitsBase below. +template <typename TConcreteOriginType> +class OriginTraitsBase { + public: + using OriginType = TConcreteOriginType; + OriginTraitsBase() = default; + + // Constructing an origin. + virtual OriginType CreateOriginFromString(base::StringPiece s) const = 0; + + // Accessors for origin properties. + virtual bool IsOpaque(const OriginType& origin) const = 0; + virtual std::string GetScheme(const OriginType& origin) const = 0; + virtual std::string GetHost(const OriginType& origin) const = 0; + virtual uint16_t GetPort(const OriginType& origin) const = 0; + + // This type is non-copyable and non-moveable. + OriginTraitsBase(const OriginTraitsBase&) = delete; + OriginTraitsBase& operator=(const OriginTraitsBase&) = delete; +}; + +// Test suite for tests that cover both url::Origin and blink::SecurityOrigin. +template <typename TOriginTraits> +class AbstractOriginTest : public testing::Test { + static_assert( + std::is_base_of<OriginTraitsBase<typename TOriginTraits::OriginType>, + TOriginTraits>::value, + "TOriginTraits needs to expose the right members."); + + protected: + // Wrappers that allow tests to ignore presence of `origin_traits_`. + // + // Note that calling the wrappers needs to be prefixed with `this->...` to + // avoid hitting: explicit qualification required to use member 'IsOpaque' + // from dependent base class. + using OriginType = typename TOriginTraits::OriginType; + OriginType CreateOriginFromString(base::StringPiece s) const { + return origin_traits_.CreateOriginFromString(s); + } + bool IsOpaque(const OriginType& origin) const { + return origin_traits_.IsOpaque(origin); + } + std::string GetScheme(const OriginType& origin) const { + return origin_traits_.GetScheme(origin); + } + std::string GetHost(const OriginType& origin) const { + return origin_traits_.GetHost(origin); + } + uint16_t GetPort(const OriginType& origin) const { + return origin_traits_.GetPort(origin); + } + + private: + TOriginTraits origin_traits_; +}; + +TYPED_TEST_SUITE_P(AbstractOriginTest); + +TYPED_TEST_P(AbstractOriginTest, NonStandardSchemeWithAndroidWebViewHack) { + ScopedSchemeRegistryForTests scoped_registry; + EnableNonStandardSchemesForAndroidWebView(); + + // Regression test for https://crbug.com/896059. + auto origin = this->CreateOriginFromString("cow://"); + EXPECT_FALSE(this->IsOpaque(origin)); + EXPECT_EQ("cow", this->GetScheme(origin)); + EXPECT_EQ("", this->GetHost(origin)); + EXPECT_EQ(0, this->GetPort(origin)); + + // about:blank translates into an opaque origin, even in presence of + // EnableNonStandardSchemesForAndroidWebView. + origin = this->CreateOriginFromString("about:blank"); + EXPECT_TRUE(this->IsOpaque(origin)); +} + +REGISTER_TYPED_TEST_SUITE_P(AbstractOriginTest, + NonStandardSchemeWithAndroidWebViewHack); + +} // namespace url + +#endif // URL_ORIGIN_ABSTRACT_TESTS_H_
diff --git a/url/origin_unittest.cc b/url/origin_unittest.cc index c3b051e..26f9c37 100644 --- a/url/origin_unittest.cc +++ b/url/origin_unittest.cc
@@ -10,10 +10,13 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" #include "url/origin.h" +#include "url/origin_abstract_tests.h" #include "url/url_util.h" namespace url { +namespace { + void ExpectParsedUrlsEqual(const GURL& a, const GURL& b) { EXPECT_EQ(a, b); const Parsed& a_parsed = a.parsed_for_possibly_invalid_spec(); @@ -36,6 +39,8 @@ EXPECT_EQ(a_parsed.ref.len, b_parsed.ref.len); } +} // namespace + class OriginTest : public ::testing::Test { public: void SetUp() override { @@ -671,22 +676,6 @@ EXPECT_TRUE(origin.opaque()); } -TEST_F(OriginTest, NonStandardSchemeWithAndroidWebViewHack) { - EnableNonStandardSchemesForAndroidWebView(); - - // Regression test for https://crbug.com/896059. - Origin origin = Origin::Create(GURL("cow://")); - EXPECT_FALSE(origin.opaque()); - EXPECT_EQ("cow", origin.scheme()); - EXPECT_EQ("", origin.host()); - EXPECT_EQ(0, origin.port()); - - // about:blank translates into an opaque origin, even in presence of - // EnableNonStandardSchemesForAndroidWebView. - origin = Origin::Create(GURL("about:blank")); - EXPECT_TRUE(origin.opaque()); -} - TEST_F(OriginTest, CanBeDerivedFrom) { AddStandardScheme("new-standard", SchemeType::SCHEME_WITH_HOST); Origin opaque_unique_origin = Origin(); @@ -974,4 +963,31 @@ EXPECT_EQ(opaque.GetDebugString(), deserialized.value().GetDebugString()); } +class UrlOriginTestTraits final : public OriginTraitsBase<Origin> { + public: + OriginType CreateOriginFromString(base::StringPiece s) const override { + return Origin::Create(GURL(s)); + } + + bool IsOpaque(const OriginType& origin) const override { + return origin.opaque(); + } + + std::string GetScheme(const OriginType& origin) const override { + return origin.scheme(); + } + + std::string GetHost(const OriginType& origin) const override { + return origin.host(); + } + + uint16_t GetPort(const OriginType& origin) const override { + return origin.port(); + } +}; + +INSTANTIATE_TYPED_TEST_SUITE_P(UrlOrigin, + AbstractOriginTest, + UrlOriginTestTraits); + } // namespace url