| 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 | 9 |
| 10 using extensions::Extension; | 10 using extensions::Extension; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 protected: | 25 protected: |
| 26 void LoadNamedExtension(const FilePath& path, | 26 void LoadNamedExtension(const FilePath& path, |
| 27 const std::string& name) { | 27 const std::string& name) { |
| 28 const Extension* extension = LoadExtension(path.AppendASCII(name)); | 28 const Extension* extension = LoadExtension(path.AppendASCII(name)); |
| 29 ASSERT_TRUE(extension); | 29 ASSERT_TRUE(extension); |
| 30 extension_name_to_ids_[name] = extension->id(); | 30 extension_name_to_ids_[name] = extension->id(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void InstallNamedExtension(const FilePath& path, | 33 void InstallNamedExtension(const FilePath& path, |
| 34 const std::string& name, | 34 const std::string& name, |
| 35 Extension::Location install_source) { | 35 Manifest::Location install_source) { |
| 36 const Extension* extension = InstallExtension(path.AppendASCII(name), 1, | 36 const Extension* extension = InstallExtension(path.AppendASCII(name), 1, |
| 37 install_source); | 37 install_source); |
| 38 ASSERT_TRUE(extension); | 38 ASSERT_TRUE(extension); |
| 39 extension_name_to_ids_[name] = extension->id(); | 39 extension_name_to_ids_[name] = extension->id(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 std::map<std::string, std::string> extension_name_to_ids_; | 42 std::map<std::string, std::string> extension_name_to_ids_; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 IN_PROC_BROWSER_TEST_F(DeveloperPrivateApiTest, Basics) { | 45 IN_PROC_BROWSER_TEST_F(DeveloperPrivateApiTest, Basics) { |
| 46 LoadExtensions(); | 46 LoadExtensions(); |
| 47 | 47 |
| 48 FilePath basedir = test_data_dir_.AppendASCII("developer"); | 48 FilePath basedir = test_data_dir_.AppendASCII("developer"); |
| 49 InstallNamedExtension(basedir, "packaged_app", Extension::INTERNAL); | 49 InstallNamedExtension(basedir, "packaged_app", Manifest::INTERNAL); |
| 50 | 50 |
| 51 InstallNamedExtension(basedir, "simple_extension", Extension::INTERNAL); | 51 InstallNamedExtension(basedir, "simple_extension", Manifest::INTERNAL); |
| 52 | 52 |
| 53 ASSERT_TRUE(RunExtensionSubtest( | 53 ASSERT_TRUE(RunExtensionSubtest( |
| 54 "developer/test", "basics.html", kFlagLoadAsComponent)); | 54 "developer/test", "basics.html", kFlagLoadAsComponent)); |
| 55 } | 55 } |
| OLD | NEW |