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

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc

Issue 2648213004: Migrate --enable-arc and --arc-available part 1. (Closed)
Patch Set: address comments. 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/common/shelf/shelf_delegate.h" 5 #include "ash/common/shelf/shelf_delegate.h"
6 #include "ash/common/wm_shell.h" 6 #include "ash/common/wm_shell.h"
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/extensions/extension_browsertest.h" 12 #include "chrome/browser/extensions/extension_browsertest.h"
13 #include "chrome/browser/ui/app_list/app_list_service.h" 13 #include "chrome/browser/ui/app_list/app_list_service.h"
14 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 14 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
15 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 15 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
16 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 16 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
17 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 17 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
18 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" 18 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h"
19 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" 19 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
21 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" 21 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
22 #include "chromeos/chromeos_switches.h" 22 #include "components/arc/arc_util.h"
23 #include "content/public/test/browser_test_utils.h" 23 #include "content/public/test/browser_test_utils.h"
24 #include "ui/events/event_constants.h" 24 #include "ui/events/event_constants.h"
25 25
26 namespace mojo { 26 namespace mojo {
27 27
28 template <> 28 template <>
29 struct TypeConverter<arc::mojom::AppInfoPtr, arc::mojom::AppInfo> { 29 struct TypeConverter<arc::mojom::AppInfoPtr, arc::mojom::AppInfo> {
30 static arc::mojom::AppInfoPtr Convert(const arc::mojom::AppInfo& app_info) { 30 static arc::mojom::AppInfoPtr Convert(const arc::mojom::AppInfo& app_info) {
31 return app_info.Clone(); 31 return app_info.Clone();
32 } 32 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 class ArcAppLauncherBrowserTest : public ExtensionBrowserTest { 151 class ArcAppLauncherBrowserTest : public ExtensionBrowserTest {
152 public: 152 public:
153 ArcAppLauncherBrowserTest() {} 153 ArcAppLauncherBrowserTest() {}
154 ~ArcAppLauncherBrowserTest() override {} 154 ~ArcAppLauncherBrowserTest() override {}
155 155
156 protected: 156 protected:
157 // content::BrowserTestBase: 157 // content::BrowserTestBase:
158 void SetUpCommandLine(base::CommandLine* command_line) override { 158 void SetUpCommandLine(base::CommandLine* command_line) override {
159 ExtensionBrowserTest::SetUpCommandLine(command_line); 159 ExtensionBrowserTest::SetUpCommandLine(command_line);
160 command_line->AppendSwitch(chromeos::switches::kEnableArc); 160 arc::SetArcAvailableCommandLineForTesting(command_line);
161 } 161 }
162 162
163 void SetUpInProcessBrowserTestFixture() override { 163 void SetUpInProcessBrowserTestFixture() override {
164 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); 164 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture();
165 arc::ArcSessionManager::DisableUIForTesting(); 165 arc::ArcSessionManager::DisableUIForTesting();
166 } 166 }
167 167
168 void SetUpOnMainThread() override { 168 void SetUpOnMainThread() override {
169 arc::ArcSessionManager::Get()->EnableArc(); 169 arc::ArcSessionManager::Get()->EnableArc();
170 } 170 }
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 app_host()->OnTaskDestroyed(2); 541 app_host()->OnTaskDestroyed(2);
542 EXPECT_EQ(controller2, GetAppItemController(shelf_id2)); 542 EXPECT_EQ(controller2, GetAppItemController(shelf_id2));
543 // Destroy task #2, this kills shelf group 2 543 // Destroy task #2, this kills shelf group 2
544 app_host()->OnTaskDestroyed(3); 544 app_host()->OnTaskDestroyed(3);
545 EXPECT_FALSE(GetAppItemController(shelf_id2)); 545 EXPECT_FALSE(GetAppItemController(shelf_id2));
546 546
547 // Disable Arc, this removes app and as result kills shelf group 3. 547 // Disable Arc, this removes app and as result kills shelf group 3.
548 arc::ArcSessionManager::Get()->DisableArc(); 548 arc::ArcSessionManager::Get()->DisableArc();
549 EXPECT_FALSE(GetAppItemController(shelf_id3)); 549 EXPECT_FALSE(GetAppItemController(shelf_id3));
550 } 550 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_test.cc ('k') | chrome/browser/ui/extensions/app_launch_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698