| OLD | NEW |
| 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 #import "chrome/browser/ui/app_list/app_list_service_mac.h" | 5 #import "chrome/browser/ui/app_list/app_list_service_mac.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/apps/app_shim/app_shim_handler_mac.h" | 10 #include "chrome/browser/apps/app_shim/app_shim_handler_mac.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // browser shutdown. References to browser-owned objects must be removed | 55 // browser shutdown. References to browser-owned objects must be removed |
| 56 // from the app list UI. | 56 // from the app list UI. |
| 57 AppListViewController* view_controller = GetViewController(); | 57 AppListViewController* view_controller = GetViewController(); |
| 58 // Note this first check will fail if the test doesn't ever show the | 58 // Note this first check will fail if the test doesn't ever show the |
| 59 // app list, but currently all tests in this file do. | 59 // app list, but currently all tests in this file do. |
| 60 EXPECT_TRUE(view_controller); | 60 EXPECT_TRUE(view_controller); |
| 61 EXPECT_FALSE([view_controller delegate]); | 61 EXPECT_FALSE([view_controller delegate]); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // AppShimHandler::Host overrides: | 64 // AppShimHandler::Host overrides: |
| 65 virtual void OnAppLaunchComplete(apps::AppShimLaunchResult result) override { | 65 void OnAppLaunchComplete(apps::AppShimLaunchResult result) override { |
| 66 // AppList shims are always given APP_SHIM_LAUNCH_DUPLICATE_HOST, indicating | 66 // AppList shims are always given APP_SHIM_LAUNCH_DUPLICATE_HOST, indicating |
| 67 // that the shim process should immediately close. | 67 // that the shim process should immediately close. |
| 68 EXPECT_EQ(apps::APP_SHIM_LAUNCH_DUPLICATE_HOST, result); | 68 EXPECT_EQ(apps::APP_SHIM_LAUNCH_DUPLICATE_HOST, result); |
| 69 ++launch_count_; | 69 ++launch_count_; |
| 70 } | 70 } |
| 71 virtual void OnAppClosed() override { | 71 void OnAppClosed() override { NOTREACHED(); } |
| 72 NOTREACHED(); | 72 void OnAppHide() override {} |
| 73 } | 73 void OnAppRequestUserAttention(apps::AppShimAttentionType type) override {} |
| 74 virtual void OnAppHide() override {} | 74 base::FilePath GetProfilePath() const override { |
| 75 virtual void OnAppRequestUserAttention( | |
| 76 apps::AppShimAttentionType type) override {} | |
| 77 virtual base::FilePath GetProfilePath() const override { | |
| 78 NOTREACHED(); // Currently unused in this test. | 75 NOTREACHED(); // Currently unused in this test. |
| 79 return base::FilePath(); | 76 return base::FilePath(); |
| 80 } | 77 } |
| 81 virtual std::string GetAppId() const override { | 78 std::string GetAppId() const override { return app_mode::kAppListModeId; } |
| 82 return app_mode::kAppListModeId; | |
| 83 } | |
| 84 | 79 |
| 85 int launch_count_; | 80 int launch_count_; |
| 86 | 81 |
| 87 private: | 82 private: |
| 88 DISALLOW_COPY_AND_ASSIGN(AppListServiceMacInteractiveTest); | 83 DISALLOW_COPY_AND_ASSIGN(AppListServiceMacInteractiveTest); |
| 89 }; | 84 }; |
| 90 | 85 |
| 91 } // namespace | 86 } // namespace |
| 92 | 87 |
| 93 IN_PROC_BROWSER_TEST_F(AppListServiceMacInteractiveTest, ShowAppListUsingShim) { | 88 IN_PROC_BROWSER_TEST_F(AppListServiceMacInteractiveTest, ShowAppListUsingShim) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 EXPECT_TRUE(service->IsAppListVisible()); | 120 EXPECT_TRUE(service->IsAppListVisible()); |
| 126 EXPECT_EQ(3, launch_count_); | 121 EXPECT_EQ(3, launch_count_); |
| 127 service->DismissAppList(); | 122 service->DismissAppList(); |
| 128 EXPECT_FALSE(service->IsAppListVisible()); | 123 EXPECT_FALSE(service->IsAppListVisible()); |
| 129 | 124 |
| 130 // View sticks around until shutdown. | 125 // View sticks around until shutdown. |
| 131 AppListViewController* view_controller = GetViewController(); | 126 AppListViewController* view_controller = GetViewController(); |
| 132 EXPECT_TRUE(view_controller); | 127 EXPECT_TRUE(view_controller); |
| 133 EXPECT_TRUE([view_controller delegate]); | 128 EXPECT_TRUE([view_controller delegate]); |
| 134 } | 129 } |
| OLD | NEW |