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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc

Issue 1198313003: Fix the browser match rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address msw@'s comments. Created 5 years, 5 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
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
index 7b0d18fe2061913819184d5e5d6e023ee451f87a..0a2465b983efb8ff8f795e266326c4e104fa4ea6 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -618,51 +618,6 @@ class ChromeLauncherControllerTest : public BrowserWithTestWindowTest {
};
#if defined(OS_CHROMEOS)
-// A browser window proxy which is able to associate an aura native window with
-// it.
-class TestBrowserWindowAura : public TestBrowserWindow {
- public:
- // |native_window| will still be owned by the caller after the constructor
- // was called.
- explicit TestBrowserWindowAura(aura::Window* native_window)
- : native_window_(native_window) {
- }
- ~TestBrowserWindowAura() override {}
-
- gfx::NativeWindow GetNativeWindow() const override {
- return native_window_.get();
- }
-
- Browser* browser() { return browser_.get(); }
-
- void CreateBrowser(const Browser::CreateParams& params) {
- Browser::CreateParams create_params = params;
- create_params.window = this;
- browser_.reset(new Browser(create_params));
- }
-
- private:
- scoped_ptr<Browser> browser_;
- scoped_ptr<aura::Window> native_window_;
-
- DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura);
-};
-
-// Creates a test browser window which has a native window.
-scoped_ptr<TestBrowserWindowAura> CreateTestBrowserWindow(
- const Browser::CreateParams& params) {
- // Create a window.
- aura::Window* window = new aura::Window(NULL);
- window->set_id(0);
- window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
- window->Init(ui::LAYER_TEXTURED);
- window->Show();
-
- scoped_ptr<TestBrowserWindowAura> browser_window(
- new TestBrowserWindowAura(window));
- browser_window->CreateBrowser(params);
- return browser_window.Pass();
-}
// Watches WebContents and blocks until it is destroyed. This is needed for
// the destruction of a V2 application.
@@ -1482,15 +1437,15 @@ TEST_F(MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest,
multi_user_util::GetUserIDFromProfile(profile());
// Create a browser window with a native window for the current user.
- scoped_ptr<BrowserWindow> browser_window(CreateTestBrowserWindow(
+ scoped_ptr<Browser> browser(chrome::CreateBrowserWithAuraTestWindowForParams(
Browser::CreateParams(profile(), chrome::HOST_DESKTOP_TYPE_ASH)));
+ BrowserWindow* browser_window = browser->window();
aura::Window* window = browser_window->GetNativeWindow();
manager->SetWindowOwner(window, current_user);
// Check that an activation of the window on its owner's desktop does not
// change the visibility to another user.
- launcher_controller_->ActivateWindowOrMinimizeIfActive(browser_window.get(),
- false);
+ launcher_controller_->ActivateWindowOrMinimizeIfActive(browser_window, false);
EXPECT_TRUE(manager->IsWindowOnDesktopOfUser(window, current_user));
// Transfer the window to another user's desktop and check that activating it
@@ -1498,8 +1453,7 @@ TEST_F(MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest,
manager->ShowWindowForUser(window,
multi_user_util::GetUserIDFromProfile(profile2));
EXPECT_FALSE(manager->IsWindowOnDesktopOfUser(window, current_user));
- launcher_controller_->ActivateWindowOrMinimizeIfActive(browser_window.get(),
- false);
+ launcher_controller_->ActivateWindowOrMinimizeIfActive(browser_window, false);
EXPECT_TRUE(manager->IsWindowOnDesktopOfUser(window, current_user));
}
#endif

Powered by Google App Engine
This is Rietveld 408576698