OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/user_script_master.h" | 5 #include "chrome/browser/extensions/user_script_master.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "chrome/test/base/testing_browser_process_test.h" |
16 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
17 #include "chrome/test/testing_browser_process_test.h" | |
18 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
19 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
20 #include "content/common/notification_service.h" | 20 #include "content/common/notification_service.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { | 25 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { |
26 int schemes = URLPattern::SCHEME_ALL; | 26 int schemes = URLPattern::SCHEME_ALL; |
27 extent->AddPattern(URLPattern(schemes, pattern)); | 27 extent->AddPattern(URLPattern(schemes, pattern)); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 user_script.js_scripts().push_back(UserScript::File( | 236 user_script.js_scripts().push_back(UserScript::File( |
237 temp_dir_.path(), path.BaseName(), GURL())); | 237 temp_dir_.path(), path.BaseName(), GURL())); |
238 | 238 |
239 UserScriptList user_scripts; | 239 UserScriptList user_scripts; |
240 user_scripts.push_back(user_script); | 240 user_scripts.push_back(user_script); |
241 | 241 |
242 UserScriptMaster::ScriptReloader::LoadUserScripts(&user_scripts); | 242 UserScriptMaster::ScriptReloader::LoadUserScripts(&user_scripts); |
243 | 243 |
244 EXPECT_EQ(content, user_scripts[0].js_scripts()[0].GetContent().as_string()); | 244 EXPECT_EQ(content, user_scripts[0].js_scripts()[0].GetContent().as_string()); |
245 } | 245 } |
OLD | NEW |