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 |