OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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/string_util.h" | 13 #include "base/string_util.h" |
14 #include "chrome/browser/browser_thread.h" | |
15 #include "chrome/common/notification_registrar.h" | 14 #include "chrome/common/notification_registrar.h" |
16 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
17 #include "chrome/test/testing_profile.h" | 16 #include "chrome/test/testing_profile.h" |
| 17 #include "content/browser/browser_thread.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 // Test bringing up a master on a specific directory, putting a script | 20 // Test bringing up a master on a specific directory, putting a script |
21 // in there, etc. | 21 // in there, etc. |
22 | 22 |
23 class UserScriptMasterTest : public testing::Test, | 23 class UserScriptMasterTest : public testing::Test, |
24 public NotificationObserver { | 24 public NotificationObserver { |
25 public: | 25 public: |
26 UserScriptMasterTest() | 26 UserScriptMasterTest() |
27 : message_loop_(MessageLoop::TYPE_UI), | 27 : message_loop_(MessageLoop::TYPE_UI), |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 UserScriptList script_list; | 256 UserScriptList script_list; |
257 UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( | 257 UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( |
258 script_dir_, &script_list); | 258 script_dir_, &script_list); |
259 ASSERT_EQ(1U, script_list.size()); | 259 ASSERT_EQ(1U, script_list.size()); |
260 | 260 |
261 EXPECT_EQ(content, script_list[0].js_scripts()[0].GetContent().as_string()); | 261 EXPECT_EQ(content, script_list[0].js_scripts()[0].GetContent().as_string()); |
262 EXPECT_EQ("http://*.mail.google.com/*", | 262 EXPECT_EQ("http://*.mail.google.com/*", |
263 script_list[0].url_patterns()[0].GetAsString()); | 263 script_list[0].url_patterns()[0].GetAsString()); |
264 } | 264 } |
OLD | NEW |