| 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..5d079a58b01e6d9a706a13cee21c16400e424f37 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 test behavior.
 | 
| +  static bool isDisabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
 | 
| +      switches::kDisableBackgroundingOccludedWindowsForTesting);
 | 
|  
 | 
| -  if (supportsOcclusionAPIs) {
 | 
| +  if (!isDisabled) {
 | 
|      if (oldWindow) {
 | 
|        [notificationCenter
 | 
|            removeObserver:self
 | 
| 
 |