| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_tabstrip.h" | 16 #include "chrome/browser/ui/browser_tabstrip.h" |
| 16 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/test/base/ui_test_utils.h" | 20 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "content/public/browser/plugin_service.h" | 21 #include "content/public/browser/plugin_service.h" |
| 21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 39 protected: | 40 protected: |
| 40 enum InstallType { | 41 enum InstallType { |
| 41 INSTALL_TYPE_COMPONENT, | 42 INSTALL_TYPE_COMPONENT, |
| 42 INSTALL_TYPE_UNPACKED, | 43 INSTALL_TYPE_UNPACKED, |
| 43 INSTALL_TYPE_FROM_WEBSTORE, | 44 INSTALL_TYPE_FROM_WEBSTORE, |
| 44 INSTALL_TYPE_NON_WEBSTORE, | 45 INSTALL_TYPE_NON_WEBSTORE, |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 const Extension* InstallExtension(InstallType install_type) { | 48 const Extension* InstallExtension(InstallType install_type) { |
| 48 FilePath file_path = test_data_dir_.AppendASCII("native_client"); | 49 FilePath file_path = test_data_dir_.AppendASCII("native_client"); |
| 49 ExtensionService* service = browser()->profile()->GetExtensionService(); | 50 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 51 browser()->profile())->extension_service(); |
| 50 const Extension* extension = NULL; | 52 const Extension* extension = NULL; |
| 51 switch (install_type) { | 53 switch (install_type) { |
| 52 case INSTALL_TYPE_COMPONENT: | 54 case INSTALL_TYPE_COMPONENT: |
| 53 if (LoadExtensionAsComponent(file_path)) { | 55 if (LoadExtensionAsComponent(file_path)) { |
| 54 extension = service->GetExtensionById(kExtensionId, false); | 56 extension = service->GetExtensionById(kExtensionId, false); |
| 55 } | 57 } |
| 56 break; | 58 break; |
| 57 | 59 |
| 58 case INSTALL_TYPE_UNPACKED: | 60 case INSTALL_TYPE_UNPACKED: |
| 59 // Install the extension from a folder so it's unpacked. | 61 // Install the extension from a folder so it's unpacked. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 IN_PROC_BROWSER_TEST_F(NaClExtensionTest, UnpackedExtension) { | 148 IN_PROC_BROWSER_TEST_F(NaClExtensionTest, UnpackedExtension) { |
| 147 ASSERT_TRUE(test_server()->Start()); | 149 ASSERT_TRUE(test_server()->Start()); |
| 148 | 150 |
| 149 const Extension* extension = InstallExtension(INSTALL_TYPE_UNPACKED); | 151 const Extension* extension = InstallExtension(INSTALL_TYPE_UNPACKED); |
| 150 ASSERT_TRUE(extension); | 152 ASSERT_TRUE(extension); |
| 151 ASSERT_EQ(extension->location(), Extension::LOAD); | 153 ASSERT_EQ(extension->location(), Extension::LOAD); |
| 152 CheckPluginsCreated(extension, true); | 154 CheckPluginsCreated(extension, true); |
| 153 } | 155 } |
| 154 | 156 |
| 155 } // namespace | 157 } // namespace |
| OLD | NEW |