OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
9 #include "ash/launcher/launcher.h" | 9 #include "ash/launcher/launcher.h" |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // old launcher gets ripped out. | 175 // old launcher gets ripped out. |
176 class LauncherPerAppAppBrowserTest : public ExtensionBrowserTest { | 176 class LauncherPerAppAppBrowserTest : public ExtensionBrowserTest { |
177 protected: | 177 protected: |
178 LauncherPerAppAppBrowserTest() | 178 LauncherPerAppAppBrowserTest() |
179 : launcher_(NULL), | 179 : launcher_(NULL), |
180 model_(NULL) { | 180 model_(NULL) { |
181 } | 181 } |
182 | 182 |
183 virtual ~LauncherPerAppAppBrowserTest() {} | 183 virtual ~LauncherPerAppAppBrowserTest() {} |
184 | 184 |
185 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
186 // TODO(skuhne): Remove this function when the drag and drop logic flag gets | |
187 // removed. | |
188 ExtensionBrowserTest::SetUpCommandLine(command_line); | |
189 command_line->AppendSwitch(ash::switches::kAshDragAndDropAppListToLauncher); | |
190 } | |
191 | |
192 virtual void RunTestOnMainThreadLoop() OVERRIDE { | 185 virtual void RunTestOnMainThreadLoop() OVERRIDE { |
193 launcher_ = ash::Launcher::ForPrimaryDisplay(); | 186 launcher_ = ash::Launcher::ForPrimaryDisplay(); |
194 model_ = | 187 model_ = |
195 ash::test::ShellTestApi(ash::Shell::GetInstance()).launcher_model(); | 188 ash::test::ShellTestApi(ash::Shell::GetInstance()).launcher_model(); |
196 return ExtensionBrowserTest::RunTestOnMainThreadLoop(); | 189 return ExtensionBrowserTest::RunTestOnMainThreadLoop(); |
197 } | 190 } |
198 | 191 |
199 size_t NumberOfDetectedLauncherBrowsers(bool show_all_tabs) { | 192 size_t NumberOfDetectedLauncherBrowsers(bool show_all_tabs) { |
200 ChromeLauncherControllerPerApp* controller = | 193 ChromeLauncherControllerPerApp* controller = |
201 static_cast<ChromeLauncherControllerPerApp*>(launcher_->delegate()); | 194 static_cast<ChromeLauncherControllerPerApp*>(launcher_->delegate()); |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 EXPECT_TRUE(ash::wm::IsWindowMinimized(window)); | 1474 EXPECT_TRUE(ash::wm::IsWindowMinimized(window)); |
1482 | 1475 |
1483 // Activate again. This doesn't create new browser. | 1476 // Activate again. This doesn't create new browser. |
1484 // It activates window. | 1477 // It activates window. |
1485 item_controller->Activate(); | 1478 item_controller->Activate(); |
1486 running_browser = chrome::GetTotalBrowserCount(); | 1479 running_browser = chrome::GetTotalBrowserCount(); |
1487 EXPECT_EQ(1u, running_browser); | 1480 EXPECT_EQ(1u, running_browser); |
1488 EXPECT_TRUE(item_controller->IsOpen()); | 1481 EXPECT_TRUE(item_controller->IsOpen()); |
1489 EXPECT_FALSE(ash::wm::IsWindowMinimized(window)); | 1482 EXPECT_FALSE(ash::wm::IsWindowMinimized(window)); |
1490 } | 1483 } |
OLD | NEW |