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

Side by Side Diff: chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_interactive_uitest.mm

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: Rebase to ToT Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h" 5 #import "chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #import <Carbon/Carbon.h> 8 #import <Carbon/Carbon.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 30 matching lines...) Expand all
41 const Extension* extension = 41 const Extension* extension =
42 LoadAndLaunchPlatformApp("minimal", "Launched"); 42 LoadAndLaunchPlatformApp("minimal", "Launched");
43 43
44 // First create an extra app window and an extra browser window. Only after 44 // First create an extra app window and an extra browser window. Only after
45 // the first call to ui_test_utils::ShowAndFocusNativeWindow(..) will the 45 // the first call to ui_test_utils::ShowAndFocusNativeWindow(..) will the
46 // windows activate, because the test binary has a default activation policy 46 // windows activate, because the test binary has a default activation policy
47 // of "prohibited". 47 // of "prohibited".
48 app1_ = GetFirstAppWindow(); 48 app1_ = GetFirstAppWindow();
49 app2_ = CreateAppWindow(browser()->profile(), extension); 49 app2_ = CreateAppWindow(browser()->profile(), extension);
50 browser1_ = browser()->window(); 50 browser1_ = browser()->window();
51 browser2_ = (new Browser(Browser::CreateParams(profile())))->window(); 51 browser2_ = (new Browser(Browser::CreateParams(profile(), true)))->window();
52 browser2_->Show(); 52 browser2_->Show();
53 53
54 // Since a pending key status change on any window could cause the test to 54 // Since a pending key status change on any window could cause the test to
55 // become flaky, watch everything closely. 55 // become flaky, watch everything closely.
56 app1_watcher_.reset([[WindowedNSNotificationObserver alloc] 56 app1_watcher_.reset([[WindowedNSNotificationObserver alloc]
57 initForNotification:NSWindowDidBecomeMainNotification 57 initForNotification:NSWindowDidBecomeMainNotification
58 object:app1_->GetNativeWindow()]); 58 object:app1_->GetNativeWindow()]);
59 app2_watcher_.reset([[WindowedNSNotificationObserver alloc] 59 app2_watcher_.reset([[WindowedNSNotificationObserver alloc]
60 initForNotification:NSWindowDidBecomeMainNotification 60 initForNotification:NSWindowDidBecomeMainNotification
61 object:app2_->GetNativeWindow()]); 61 object:app2_->GetNativeWindow()]);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Activate one of the browsers. Then cycling should go between the browsers. 125 // Activate one of the browsers. Then cycling should go between the browsers.
126 EXPECT_TRUE(ShowAndFocusNativeWindow(browser1_->GetNativeWindow())); 126 EXPECT_TRUE(ShowAndFocusNativeWindow(browser1_->GetNativeWindow()));
127 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 1, 0); 127 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 1, 0);
128 CycleWindows(); 128 CycleWindows();
129 ExpectActiveWithCounts(browser2_->GetNativeWindow(), 2, 1, 1, 1); 129 ExpectActiveWithCounts(browser2_->GetNativeWindow(), 2, 1, 1, 1);
130 CycleWindows(); 130 CycleWindows();
131 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 2, 1); 131 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 2, 1);
132 } 132 }
133 133
134 } // namespace 134 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698