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

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

Issue 2765563002: Move and rename Chrome's AppLauncherId to ash::AppLaunchId. (Closed)
Patch Set: Add example commment. Created 3 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_impl.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <string> 13 #include <string>
14 #include <utility> 14 #include <utility>
15 #include <vector> 15 #include <vector>
16 16
17 #include "ash/common/shelf/shelf_application_menu_model.h" 17 #include "ash/common/shelf/shelf_application_menu_model.h"
18 #include "ash/common/shelf/shelf_constants.h" 18 #include "ash/common/shelf/shelf_constants.h"
19 #include "ash/common/shelf/shelf_controller.h" 19 #include "ash/common/shelf/shelf_controller.h"
20 #include "ash/common/shelf/shelf_model.h" 20 #include "ash/common/shelf/shelf_model.h"
21 #include "ash/common/shelf/shelf_model_observer.h" 21 #include "ash/common/shelf/shelf_model_observer.h"
22 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 22 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
23 #include "ash/common/wm_shell.h" 23 #include "ash/common/wm_shell.h"
24 #include "ash/display/screen_orientation_controller_chromeos.h" 24 #include "ash/display/screen_orientation_controller_chromeos.h"
25 #include "ash/public/cpp/app_launch_id.h"
25 #include "ash/public/cpp/shelf_item.h" 26 #include "ash/public/cpp/shelf_item.h"
26 #include "ash/shell.h" 27 #include "ash/shell.h"
27 #include "ash/test/ash_test_helper.h" 28 #include "ash/test/ash_test_helper.h"
28 #include "ash/test/test_shell_delegate.h" 29 #include "ash/test/test_shell_delegate.h"
29 #include "ash/wm/window_util.h" 30 #include "ash/wm/window_util.h"
30 #include "base/command_line.h" 31 #include "base/command_line.h"
31 #include "base/compiler_specific.h" 32 #include "base/compiler_specific.h"
32 #include "base/files/file_path.h" 33 #include "base/files/file_path.h"
33 #include "base/json/json_string_value_serializer.h" 34 #include "base/json/json_string_value_serializer.h"
34 #include "base/location.h" 35 #include "base/location.h"
(...skipping 12 matching lines...) Expand all
47 #include "chrome/browser/extensions/extension_service.h" 48 #include "chrome/browser/extensions/extension_service.h"
48 #include "chrome/browser/extensions/test_extension_system.h" 49 #include "chrome/browser/extensions/test_extension_system.h"
49 #include "chrome/browser/lifetime/scoped_keep_alive.h" 50 #include "chrome/browser/lifetime/scoped_keep_alive.h"
50 #include "chrome/browser/prefs/browser_prefs.h" 51 #include "chrome/browser/prefs/browser_prefs.h"
51 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 52 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
52 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 53 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
53 #include "chrome/browser/ui/app_list/arc/arc_app_test.h" 54 #include "chrome/browser/ui/app_list/arc/arc_app_test.h"
54 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 55 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
55 #include "chrome/browser/ui/app_list/arc/arc_default_app_list.h" 56 #include "chrome/browser/ui/app_list/arc/arc_default_app_list.h"
56 #include "chrome/browser/ui/apps/chrome_app_delegate.h" 57 #include "chrome/browser/ui/apps/chrome_app_delegate.h"
57 #include "chrome/browser/ui/ash/app_launcher_id.h"
58 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" 58 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
59 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" 59 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h"
60 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" 60 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h"
61 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h" 61 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h"
62 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" 62 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
63 #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_cont roller.h" 63 #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_cont roller.h"
64 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 64 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
65 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" 65 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
66 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 66 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
67 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" 67 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 manifest, Extension::NO_FLAGS, 439 manifest, Extension::NO_FLAGS,
440 ArcSupportHost::kHostAppId, &error); 440 ArcSupportHost::kHostAppId, &error);
441 extension_service_->AddExtension(extension_chrome_.get()); 441 extension_service_->AddExtension(extension_chrome_.get());
442 } 442 }
443 443
444 // Creates a running platform V2 app (not pinned) of type |app_id|. 444 // Creates a running platform V2 app (not pinned) of type |app_id|.
445 virtual void CreateRunningV2App(const std::string& app_id) { 445 virtual void CreateRunningV2App(const std::string& app_id) {
446 DCHECK(!test_controller_); 446 DCHECK(!test_controller_);
447 ash::ShelfID id = 447 ash::ShelfID id =
448 launcher_controller_->CreateAppShortcutLauncherItemWithType( 448 launcher_controller_->CreateAppShortcutLauncherItemWithType(
449 ash::AppLauncherId(app_id), model_->item_count(), ash::TYPE_APP); 449 ash::AppLaunchId(app_id), model_->item_count(), ash::TYPE_APP);
450 DCHECK(id); 450 DCHECK(id);
451 // Change the created launcher controller into a V2 app controller. 451 // Change the created launcher controller into a V2 app controller.
452 test_controller_ = new TestV2AppLauncherItemController(app_id, 452 test_controller_ = new TestV2AppLauncherItemController(app_id,
453 launcher_controller_.get()); 453 launcher_controller_.get());
454 launcher_controller_->SetItemController(id, test_controller_); 454 launcher_controller_->SetItemController(id, test_controller_);
455 DCHECK(launcher_controller_->IsPlatformApp(id)); 455 DCHECK(launcher_controller_->IsPlatformApp(id));
456 launcher_controller_->SetItemStatus(id, ash::STATUS_RUNNING); 456 launcher_controller_->SetItemStatus(id, ash::STATUS_RUNNING);
457 } 457 }
458 458
459 // Sets the stage for a multi user test. 459 // Sets the stage for a multi user test.
(...skipping 3891 matching lines...) Expand 10 before | Expand all | Expand 10 after
4351 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4351 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4352 shelf_controller->auto_hide()); 4352 shelf_controller->auto_hide());
4353 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4353 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4354 4354
4355 PrefService* prefs = profile()->GetTestingPrefService(); 4355 PrefService* prefs = profile()->GetTestingPrefService();
4356 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4356 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4357 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4357 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4358 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4358 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4359 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4359 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4360 } 4360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698