Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 1762883002: Disable window occlusion APIs when running browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | content/public/common/content_switches.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index e569f0180976be0f65ea0738f6194f1c0d37e293..ee58eee51dfd481739685ecc33b2e410b197fc27 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -8,6 +8,7 @@
#include <string>
+#include "base/command_line.h"
#import "base/mac/mac_util.h"
#import "base/mac/scoped_sending_event.h"
#include "base/mac/sdk_forward_declarations.h"
@@ -23,6 +24,7 @@
#include "content/common/view_messages.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_view_delegate.h"
+#include "content/public/common/content_switches.h"
#include "skia/ext/skia_utils_mac.h"
#import "third_party/mozilla/NSPasteboard+Utils.h"
#include "ui/base/clipboard/custom_data_helper.h"
@@ -636,10 +638,12 @@ void WebContentsViewMac::CloseTab() {
NSNotificationCenter* notificationCenter =
[NSNotificationCenter defaultCenter];
- // Occlusion notification APIs are new in Mavericks.
- bool supportsOcclusionAPIs = base::mac::IsOSMavericksOrLater();
+ // Occlusion is highly undesirable for browser tests, since it will
+ // flakily change behavior.
Noel Gordon 2016/03/04 01:57:32 "change" - > "change test" ?
ccameron 2016/03/06 23:09:08 Done.
+ static bool isDisabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
Noel Gordon 2016/03/04 01:57:32 Is using a static safe for all test scenarios?
ccameron 2016/03/06 23:09:08 I tested single and multi-process and both worked.
+ switches::kDisableBackgroundingOccludedWindows);
- if (supportsOcclusionAPIs) {
+ if (!isDisabled) {
if (oldWindow) {
[notificationCenter
removeObserver:self
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | content/public/common/content_switches.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698