| OLD | NEW |
| 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 Loading... |
| 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(extension); | 49 app2_ = CreateAppWindow(extension); |
| 50 browser1_ = browser()->window(); | 50 browser1_ = browser()->window(); |
| 51 browser2_ = (new Browser(Browser::CreateParams( | 51 browser2_ = (new Browser(Browser::CreateParams(profile())))->window(); |
| 52 profile(), chrome::HOST_DESKTOP_TYPE_NATIVE)))->window(); | |
| 53 browser2_->Show(); | 52 browser2_->Show(); |
| 54 | 53 |
| 55 // 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 |
| 56 // become flaky, watch everything closely. | 55 // become flaky, watch everything closely. |
| 57 app1_watcher_.reset([[WindowedNSNotificationObserver alloc] | 56 app1_watcher_.reset([[WindowedNSNotificationObserver alloc] |
| 58 initForNotification:NSWindowDidBecomeMainNotification | 57 initForNotification:NSWindowDidBecomeMainNotification |
| 59 object:app1_->GetNativeWindow()]); | 58 object:app1_->GetNativeWindow()]); |
| 60 app2_watcher_.reset([[WindowedNSNotificationObserver alloc] | 59 app2_watcher_.reset([[WindowedNSNotificationObserver alloc] |
| 61 initForNotification:NSWindowDidBecomeMainNotification | 60 initForNotification:NSWindowDidBecomeMainNotification |
| 62 object:app2_->GetNativeWindow()]); | 61 object:app2_->GetNativeWindow()]); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // 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. |
| 127 EXPECT_TRUE(ShowAndFocusNativeWindow(browser1_->GetNativeWindow())); | 126 EXPECT_TRUE(ShowAndFocusNativeWindow(browser1_->GetNativeWindow())); |
| 128 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 1, 0); | 127 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 1, 0); |
| 129 CycleWindows(); | 128 CycleWindows(); |
| 130 ExpectActiveWithCounts(browser2_->GetNativeWindow(), 2, 1, 1, 1); | 129 ExpectActiveWithCounts(browser2_->GetNativeWindow(), 2, 1, 1, 1); |
| 131 CycleWindows(); | 130 CycleWindows(); |
| 132 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 2, 1); | 131 ExpectActiveWithCounts(browser1_->GetNativeWindow(), 2, 1, 2, 1); |
| 133 } | 132 } |
| 134 | 133 |
| 135 } // namespace | 134 } // namespace |
| OLD | NEW |