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 "ash/launcher/launcher_model.h" | 5 #include "ash/launcher/launcher_model.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/extensions/test_extension_system.h" | 12 #include "chrome/browser/extensions/test_extension_system.h" |
13 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" | 13 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/base/testing_pref_service.h" | 16 #include "chrome/test/base/testing_pref_service.h" |
17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
18 #include "content/test/test_browser_thread.h" | 18 #include "content/test/test_browser_thread.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
| 22 using extensions::Extension; |
| 23 |
22 class ChromeLauncherControllerTest : public testing::Test { | 24 class ChromeLauncherControllerTest : public testing::Test { |
23 protected: | 25 protected: |
24 ChromeLauncherControllerTest() | 26 ChromeLauncherControllerTest() |
25 : ui_thread_(content::BrowserThread::UI, &loop_), | 27 : ui_thread_(content::BrowserThread::UI, &loop_), |
26 extension_service_(NULL) { | 28 extension_service_(NULL) { |
27 DictionaryValue manifest; | 29 DictionaryValue manifest; |
28 manifest.SetString("name", "launcher controller test extension"); | 30 manifest.SetString("name", "launcher controller test extension"); |
29 manifest.SetString("version", "1"); | 31 manifest.SetString("version", "1"); |
30 manifest.SetString("description", "for testing pinned apps"); | 32 manifest.SetString("description", "for testing pinned apps"); |
31 | 33 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 148 |
147 EXPECT_TRUE(launcher_controller.IsAppPinned(extension3_->id())); | 149 EXPECT_TRUE(launcher_controller.IsAppPinned(extension3_->id())); |
148 EXPECT_TRUE(launcher_controller.IsAppPinned(extension4_->id())); | 150 EXPECT_TRUE(launcher_controller.IsAppPinned(extension4_->id())); |
149 | 151 |
150 extension_service_->UnloadExtension(extension3_->id(), | 152 extension_service_->UnloadExtension(extension3_->id(), |
151 extension_misc::UNLOAD_REASON_UNINSTALL); | 153 extension_misc::UNLOAD_REASON_UNINSTALL); |
152 | 154 |
153 EXPECT_FALSE(launcher_controller.IsAppPinned(extension3_->id())); | 155 EXPECT_FALSE(launcher_controller.IsAppPinned(extension3_->id())); |
154 EXPECT_TRUE(launcher_controller.IsAppPinned(extension4_->id())); | 156 EXPECT_TRUE(launcher_controller.IsAppPinned(extension4_->id())); |
155 } | 157 } |
OLD | NEW |