From 0c4055044da98ab3ec9c778220f5852ba53dc2d7 Mon Sep 17 00:00:00 2001 From: "mpcomplete@google.com" Date: Thu, 29 Jan 2009 21:29:15 +0000 Subject: Re-enable the NoScript unittest. Turns out we need to broadcast the NOTIFY_USER_SCRIPTS_LOADED message even if there are no scripts. I just removed the DCHECK that expects scripts. Review URL: http://codereview.chromium.org/19475 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8913 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/user_script_master.cc | 2 -- chrome/browser/extensions/user_script_master_unittest.cc | 2 +- chrome/browser/renderer_host/browser_render_process_host.cc | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc index 86f5668..66a8d70 100644 --- a/chrome/browser/extensions/user_script_master.cc +++ b/chrome/browser/extensions/user_script_master.cc @@ -102,8 +102,6 @@ void UserScriptMaster::ScriptReloader::NotifyMaster( void UserScriptMaster::ScriptReloader::RunScan( const FilePath script_dir, const UserScriptList lone_scripts) { base::SharedMemory* shared_memory = GetNewScripts(script_dir, lone_scripts); - if (!shared_memory) - return; // No scripts to load. // Post the new scripts back to the master's message loop. master_message_loop_->PostTask(FROM_HERE, diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc index a2081ee..f0f2dc2 100644 --- a/chrome/browser/extensions/user_script_master_unittest.cc +++ b/chrome/browser/extensions/user_script_master_unittest.cc @@ -68,7 +68,7 @@ class UserScriptMasterTest : public testing::Test, }; // Test that we *don't* get spurious notifications. -TEST_F(UserScriptMasterTest, DISABLED_NoScripts) { +TEST_F(UserScriptMasterTest, NoScripts) { // Set shared_memory_ to something non-NULL, so we can check it became NULL. shared_memory_ = reinterpret_cast(1); diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index b208e89..8fc3742 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -759,7 +759,6 @@ void BrowserRenderProcessHost::Observe(NotificationType type, case NOTIFY_USER_SCRIPTS_LOADED: { base::SharedMemory* shared_memory = Details(details).ptr(); - DCHECK(shared_memory); if (shared_memory) { SendUserScriptsUpdate(shared_memory); } -- cgit v1.1