OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/stringprintf.h" | 5 #include "base/stringprintf.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_install_ui.h" | 7 #include "chrome/browser/extensions/extension_install_ui.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_webstore_private_api.h" | 9 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/common/chrome_notification_types.h" |
12 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/test/ui_test_utils.h" | 14 #include "chrome/test/ui_test_utils.h" |
14 #include "content/common/notification_observer.h" | 15 #include "content/common/notification_observer.h" |
15 #include "content/common/notification_registrar.h" | 16 #include "content/common/notification_registrar.h" |
16 #include "content/common/notification_service.h" | 17 #include "content/common/notification_service.h" |
17 #include "net/base/mock_host_resolver.h" | 18 #include "net/base/mock_host_resolver.h" |
18 | 19 |
19 // A base class for tests below. | 20 // A base class for tests below. |
20 class ExtensionWebstorePrivateApiTest : public ExtensionApiTest { | 21 class ExtensionWebstorePrivateApiTest : public ExtensionApiTest { |
21 public: | 22 public: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 85 } |
85 | 86 |
86 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallNoGesture) { | 87 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallNoGesture) { |
87 BeginInstallFunction::SetIgnoreUserGestureForTests(false); | 88 BeginInstallFunction::SetIgnoreUserGestureForTests(false); |
88 ASSERT_TRUE(RunInstallTest("no_user_gesture.html", "extension.crx")); | 89 ASSERT_TRUE(RunInstallTest("no_user_gesture.html", "extension.crx")); |
89 } | 90 } |
90 | 91 |
91 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, | 92 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, |
92 IncorrectManifest1) { | 93 IncorrectManifest1) { |
93 ui_test_utils::WindowedNotificationObserver observer( | 94 ui_test_utils::WindowedNotificationObserver observer( |
94 NotificationType::EXTENSION_INSTALL_ERROR, | 95 chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, |
95 NotificationService::AllSources()); | 96 NotificationService::AllSources()); |
96 ASSERT_TRUE(RunInstallTest("incorrect_manifest1.html", "extension.crx")); | 97 ASSERT_TRUE(RunInstallTest("incorrect_manifest1.html", "extension.crx")); |
97 observer.Wait(); | 98 observer.Wait(); |
98 } | 99 } |
99 | 100 |
100 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, | 101 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, |
101 IncorrectManifest2) { | 102 IncorrectManifest2) { |
102 ui_test_utils::WindowedNotificationObserver observer( | 103 ui_test_utils::WindowedNotificationObserver observer( |
103 NotificationType::EXTENSION_INSTALL_ERROR, | 104 chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, |
104 NotificationService::AllSources()); | 105 NotificationService::AllSources()); |
105 ASSERT_TRUE(RunInstallTest("incorrect_manifest2.html", "extension.crx")); | 106 ASSERT_TRUE(RunInstallTest("incorrect_manifest2.html", "extension.crx")); |
106 observer.Wait(); | 107 observer.Wait(); |
107 } | 108 } |
OLD | NEW |