| 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/string_util.h" | 14 #include "base/string_util.h" | 
| 14 #include "base/memory/scoped_temp_dir.h" |  | 
| 15 #include "chrome/test/testing_profile.h" | 15 #include "chrome/test/testing_profile.h" | 
| 16 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" | 
| 17 #include "content/common/notification_registrar.h" | 17 #include "content/common/notification_registrar.h" | 
| 18 #include "content/common/notification_service.h" | 18 #include "content/common/notification_service.h" | 
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" | 
| 20 | 20 | 
| 21 // Test bringing up a master on a specific directory, putting a script | 21 // Test bringing up a master on a specific directory, putting a script | 
| 22 // in there, etc. | 22 // in there, etc. | 
| 23 | 23 | 
| 24 class UserScriptMasterTest : public testing::Test, | 24 class UserScriptMasterTest : public testing::Test, | 
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 250 | 250 | 
| 251   UserScriptList script_list; | 251   UserScriptList script_list; | 
| 252   UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( | 252   UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( | 
| 253       temp_dir_.path(), &script_list); | 253       temp_dir_.path(), &script_list); | 
| 254   ASSERT_EQ(1U, script_list.size()); | 254   ASSERT_EQ(1U, script_list.size()); | 
| 255 | 255 | 
| 256   EXPECT_EQ(content, script_list[0].js_scripts()[0].GetContent().as_string()); | 256   EXPECT_EQ(content, script_list[0].js_scripts()[0].GetContent().as_string()); | 
| 257   EXPECT_EQ("http://*.mail.google.com/*", | 257   EXPECT_EQ("http://*.mail.google.com/*", | 
| 258             script_list[0].url_patterns()[0].GetAsString()); | 258             script_list[0].url_patterns()[0].GetAsString()); | 
| 259 } | 259 } | 
| OLD | NEW | 
|---|