Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: chrome/browser/extensions/user_script_master_unittest.cc

Issue 8873032: Removing MessageLoop::QuitTask() from chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert 3 more problematic files Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // Updated to the script shared memory when we get notified. 85 // Updated to the script shared memory when we get notified.
86 base::SharedMemory* shared_memory_; 86 base::SharedMemory* shared_memory_;
87 }; 87 };
88 88
89 // Test that we get notified even when there are no scripts. 89 // Test that we get notified even when there are no scripts.
90 TEST_F(UserScriptMasterTest, NoScripts) { 90 TEST_F(UserScriptMasterTest, NoScripts) {
91 TestingProfile profile; 91 TestingProfile profile;
92 scoped_refptr<UserScriptMaster> master(new UserScriptMaster(&profile)); 92 scoped_refptr<UserScriptMaster> master(new UserScriptMaster(&profile));
93 master->StartLoad(); 93 master->StartLoad();
94 message_loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); 94 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
95 message_loop_.Run(); 95 message_loop_.Run();
96 96
97 ASSERT_TRUE(shared_memory_ != NULL); 97 ASSERT_TRUE(shared_memory_ != NULL);
98 } 98 }
99 99
100 TEST_F(UserScriptMasterTest, Parse1) { 100 TEST_F(UserScriptMasterTest, Parse1) {
101 const std::string text( 101 const std::string text(
102 "// This is my awesome script\n" 102 "// This is my awesome script\n"
103 "// It does stuff.\n" 103 "// It does stuff.\n"
104 "// ==UserScript== trailing garbage\n" 104 "// ==UserScript== trailing garbage\n"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 user_scripts.push_back(user_script); 245 user_scripts.push_back(user_script);
246 246
247 UserScriptMaster::ScriptReloader* script_reloader = 247 UserScriptMaster::ScriptReloader* script_reloader =
248 new UserScriptMaster::ScriptReloader(NULL); 248 new UserScriptMaster::ScriptReloader(NULL);
249 script_reloader->AddRef(); 249 script_reloader->AddRef();
250 script_reloader->LoadUserScripts(&user_scripts); 250 script_reloader->LoadUserScripts(&user_scripts);
251 script_reloader->Release(); 251 script_reloader->Release();
252 252
253 EXPECT_EQ(content, user_scripts[0].js_scripts()[0].GetContent().as_string()); 253 EXPECT_EQ(content, user_scripts[0].js_scripts()[0].GetContent().as_string());
254 } 254 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notification_manager_unittest.cc ('k') | chrome/browser/fast_shutdown_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698