OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/extensions/extension_action_runner.h" | 5 #include "chrome/browser/extensions/extension_action_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 " %s" | 156 " %s" |
157 "}", | 157 "}", |
158 name.c_str(), permissions.c_str(), scripts.c_str()); | 158 name.c_str(), permissions.c_str(), scripts.c_str()); |
159 | 159 |
160 std::unique_ptr<TestExtensionDir> dir(new TestExtensionDir); | 160 std::unique_ptr<TestExtensionDir> dir(new TestExtensionDir); |
161 dir->WriteManifest(manifest); | 161 dir->WriteManifest(manifest); |
162 dir->WriteFile(FILE_PATH_LITERAL("script.js"), | 162 dir->WriteFile(FILE_PATH_LITERAL("script.js"), |
163 injection_type == CONTENT_SCRIPT ? kContentScriptSource | 163 injection_type == CONTENT_SCRIPT ? kContentScriptSource |
164 : kBackgroundScriptSource); | 164 : kBackgroundScriptSource); |
165 | 165 |
166 const Extension* extension = LoadExtension(dir->unpacked_path()); | 166 const Extension* extension = LoadExtension(dir->UnpackedPath()); |
167 if (extension) { | 167 if (extension) { |
168 test_extension_dirs_.push_back(std::move(dir)); | 168 test_extension_dirs_.push_back(std::move(dir)); |
169 extensions_.push_back(extension); | 169 extensions_.push_back(extension); |
170 } | 170 } |
171 | 171 |
172 // If extension is NULL here, it will be caught later in the test. | 172 // If extension is NULL here, it will be caught later in the test. |
173 return extension; | 173 return extension; |
174 } | 174 } |
175 | 175 |
176 class ActiveScriptTester { | 176 class ActiveScriptTester { |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 562 |
563 ASSERT_TRUE(embedded_test_server()->Start()); | 563 ASSERT_TRUE(embedded_test_server()->Start()); |
564 ui_test_utils::NavigateToURL( | 564 ui_test_utils::NavigateToURL( |
565 browser(), embedded_test_server()->GetURL("/extensions/test_file.html")); | 565 browser(), embedded_test_server()->GetURL("/extensions/test_file.html")); |
566 | 566 |
567 for (size_t i = 0u; i < arraysize(testers); ++i) | 567 for (size_t i = 0u; i < arraysize(testers); ++i) |
568 EXPECT_TRUE(testers[i].Verify()) << kExtensionNames[i]; | 568 EXPECT_TRUE(testers[i].Verify()) << kExtensionNames[i]; |
569 } | 569 } |
570 | 570 |
571 } // namespace extensions | 571 } // namespace extensions |
OLD | NEW |