| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "base/ref_counted.h" | 6 #include "base/ref_counted.h" |
| 7 #include "chrome/common/chrome_paths.h" | 7 #include "chrome/common/chrome_paths.h" |
| 8 #include "chrome/test/automation/automation_proxy.h" | 8 #include "chrome/test/automation/automation_proxy.h" |
| 9 #include "chrome/test/automation/browser_proxy.h" | 9 #include "chrome/test/automation/browser_proxy.h" |
| 10 #include "chrome/test/automation/extension_proxy.h" | 10 #include "chrome/test/automation/extension_proxy.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 simple_extension_= InstallSimpleBrowserActionExtension(); | 25 simple_extension_= InstallSimpleBrowserActionExtension(); |
| 26 ASSERT_TRUE(simple_extension_.get()); | 26 ASSERT_TRUE(simple_extension_.get()); |
| 27 } | 27 } |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 // Installs a simple browser action extension from the sample_extensions | 30 // Installs a simple browser action extension from the sample_extensions |
| 31 // folder. Returns an ExtensionProxy, which could be NULL. | 31 // folder. Returns an ExtensionProxy, which could be NULL. |
| 32 scoped_refptr<ExtensionProxy> InstallSimpleBrowserActionExtension() { | 32 scoped_refptr<ExtensionProxy> InstallSimpleBrowserActionExtension() { |
| 33 return automation()->InstallExtension( | 33 return automation()->InstallExtension( |
| 34 test_data_directory_.AppendASCII("extensions").AppendASCII("uitest"). | 34 test_data_directory_.AppendASCII("extensions").AppendASCII("uitest"). |
| 35 AppendASCII("simple_browser_action.crx"), false); | 35 AppendASCII("simple_browser_action.crx")); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Installs a extension which, when clicking the browser action, renames | 38 // Installs a extension which, when clicking the browser action, renames |
| 39 // the current tab to the tab's index. Returns an ExtensionProxy, | 39 // the current tab to the tab's index. Returns an ExtensionProxy, |
| 40 // which could be NULL. | 40 // which could be NULL. |
| 41 scoped_refptr<ExtensionProxy> InstallRenameTabExtension() { | 41 scoped_refptr<ExtensionProxy> InstallRenameTabExtension() { |
| 42 return automation()->InstallExtension( | 42 return automation()->InstallExtension( |
| 43 test_data_directory_.AppendASCII("extensions").AppendASCII("uitest"). | 43 test_data_directory_.AppendASCII("extensions").AppendASCII("uitest"). |
| 44 AppendASCII("rename_tab.crx"), false); | 44 AppendASCII("rename_tab.crx")); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // The google translate extension, which is installed on test setup. | 47 // The google translate extension, which is installed on test setup. |
| 48 scoped_refptr<ExtensionProxy> simple_extension_; | 48 scoped_refptr<ExtensionProxy> simple_extension_; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyUITest); | 51 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyUITest); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 TEST_F(ExtensionProxyUITest, NoSuchExtension) { | 54 TEST_F(ExtensionProxyUITest, NoSuchExtension) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 EnsureIdMatches("aiglobglfckejlcpcbdokbkbjeemfhno")); | 169 EnsureIdMatches("aiglobglfckejlcpcbdokbkbjeemfhno")); |
| 170 ASSERT_NO_FATAL_FAILURE(simple_extension_-> | 170 ASSERT_NO_FATAL_FAILURE(simple_extension_-> |
| 171 EnsureNameMatches("Browser Action")); | 171 EnsureNameMatches("Browser Action")); |
| 172 ASSERT_NO_FATAL_FAILURE(simple_extension_-> | 172 ASSERT_NO_FATAL_FAILURE(simple_extension_-> |
| 173 EnsureVersionMatches("0.1.1")); | 173 EnsureVersionMatches("0.1.1")); |
| 174 ASSERT_NO_FATAL_FAILURE(simple_extension_-> | 174 ASSERT_NO_FATAL_FAILURE(simple_extension_-> |
| 175 EnsureBrowserActionIndexMatches(0)); | 175 EnsureBrowserActionIndexMatches(0)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace | 178 } // namespace |
| OLD | NEW |