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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/extensions/convert_user_script.h" | 14 #include "chrome/browser/extensions/convert_user_script.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
| 19 using extensions::Extension; |
| 20 |
19 namespace { | 21 namespace { |
20 | 22 |
21 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { | 23 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { |
22 int schemes = URLPattern::SCHEME_ALL; | 24 int schemes = URLPattern::SCHEME_ALL; |
23 extent->AddPattern(URLPattern(schemes, pattern)); | 25 extent->AddPattern(URLPattern(schemes, pattern)); |
24 } | 26 } |
25 | 27 |
26 } | 28 } |
27 | 29 |
28 TEST(ExtensionFromUserScript, Basic) { | 30 TEST(ExtensionFromUserScript, Basic) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 EXPECT_EQ("Document Idle Test", extension->name()); | 210 EXPECT_EQ("Document Idle Test", extension->name()); |
209 EXPECT_EQ("This script tests document-idle", extension->description()); | 211 EXPECT_EQ("This script tests document-idle", extension->description()); |
210 EXPECT_EQ("kHnHKec3O/RKKo5/Iu1hKqe4wQERthL0639isNtsfiY=", | 212 EXPECT_EQ("kHnHKec3O/RKKo5/Iu1hKqe4wQERthL0639isNtsfiY=", |
211 extension->public_key()); | 213 extension->public_key()); |
212 | 214 |
213 // Validate run location. | 215 // Validate run location. |
214 ASSERT_EQ(1u, extension->content_scripts().size()); | 216 ASSERT_EQ(1u, extension->content_scripts().size()); |
215 const UserScript& script = extension->content_scripts()[0]; | 217 const UserScript& script = extension->content_scripts()[0]; |
216 EXPECT_EQ(UserScript::DOCUMENT_IDLE, script.run_location()); | 218 EXPECT_EQ(UserScript::DOCUMENT_IDLE, script.run_location()); |
217 } | 219 } |
OLD | NEW |