diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 12:09:19 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 12:09:19 +0000 |
commit | 98d2ab145e18daa11d471dedc5cc6e425fd9dcfd (patch) | |
tree | 0da128afd0ff7fa82de659f90657209a4212c3f5 /chrome/browser | |
parent | 4e82187e29a6ce0310013d98f49286f0ad7d8e7c (diff) | |
download | chromium_src-98d2ab145e18daa11d471dedc5cc6e425fd9dcfd.zip chromium_src-98d2ab145e18daa11d471dedc5cc6e425fd9dcfd.tar.gz chromium_src-98d2ab145e18daa11d471dedc5cc6e425fd9dcfd.tar.bz2 |
Remove traces for the WhitelistExtension test. The flakiness seems to be gone.
TBR=aa
BUG=59060
TEST=None
Review URL: http://codereview.chromium.org/3808005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
6 files changed, 3 insertions, 60 deletions
diff --git a/chrome/browser/extensions/all_urls_apitest.cc b/chrome/browser/extensions/all_urls_apitest.cc index e3d1ca1..9b56a89 100644 --- a/chrome/browser/extensions/all_urls_apitest.cc +++ b/chrome/browser/extensions/all_urls_apitest.cc @@ -21,8 +21,6 @@ typedef ExtensionApiTest AllUrlsApiTest; // problem lies and needs to check in these traces because the problem doesn't // repro locally (nor on the try bots). IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, WhitelistedExtension) { - Extension::emit_traces_for_whitelist_extension_test_ = true; - // First setup the two extensions. FilePath extension_dir1 = test_data_dir_.AppendASCII("all_urls") .AppendASCII("content_script"); diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc index 40719eb..b7bf999 100644 --- a/chrome/browser/extensions/execute_code_in_tab_function.cc +++ b/chrome/browser/extensions/execute_code_in_tab_function.cc @@ -30,8 +30,6 @@ ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() { } bool ExecuteCodeInTabFunction::RunImpl() { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** ExecuteCodeInTabFunction::RunImpl() runs\n"); DictionaryValue* script_info; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &script_info)); size_t number_of_value = script_info->size(); @@ -89,12 +87,8 @@ bool ExecuteCodeInTabFunction::RunImpl() { &host_permissions, NULL, &error_)) { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** CANNOT EXECUTE!! \n"); return false; } - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** ALLOWED to execute. \n"); if (script_info->HasKey(keys::kAllFramesKey)) { if (!script_info->GetBoolean(keys::kAllFramesKey, &all_frames_)) diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index f94145a..8642649 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -70,9 +70,6 @@ static void DispatchEvent(Profile* profile, if (profile->GetExtensionMessageService()) { profile->GetExtensionMessageService()->DispatchEventToRenderers( event_name, json_args, profile, GURL()); - } else { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** ERROR: no profile->GetExtensionMessageService()\n"); } } @@ -391,14 +388,7 @@ void ExtensionBrowserEventRouter::TabUpdated(TabContents* contents, std::string json_args; base::JSONWriter::Write(&args, false, &json_args); - // TODO(finnur): Remove once I have one failed run of this test. - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** Sending TabUpdated\n"); - DispatchEvent(contents->profile(), events::kOnTabUpdated, json_args); - } else { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** NOT SENDING TabUpdated\n"); } } @@ -408,8 +398,6 @@ void ExtensionBrowserEventRouter::Observe(NotificationType type, if (type == NotificationType::NAV_ENTRY_COMMITTED) { NavigationController* source_controller = Source<NavigationController>(source).ptr(); - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** Observe, preparing TabUpdated\n"); TabUpdated(source_controller->tab_contents(), true); } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) { // Tab was destroyed after being detached (without being re-attached). @@ -433,8 +421,6 @@ void ExtensionBrowserEventRouter::Observe(NotificationType type, void ExtensionBrowserEventRouter::TabChangedAt(TabContents* contents, int index, TabChangeType change_type) { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** TabChangedAt, preparing TabUpdated\n"); TabUpdated(contents, false); } diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc index 7e675f5..531c06b 100644 --- a/chrome/browser/extensions/extension_message_service.cc +++ b/chrome/browser/extensions/extension_message_service.cc @@ -382,42 +382,26 @@ void ExtensionMessageService::PostMessageFromRenderer( void ExtensionMessageService::DispatchEventToRenderers( const std::string& event_name, const std::string& event_args, Profile* restrict_to_profile, const GURL& event_url) { - if (Extension::emit_traces_for_whitelist_extension_test_) { - printf("***** DispatchEventToRenderers: %s(%s) for url '%s'\n", - event_name.c_str(), event_args.c_str(), event_url.spec().c_str()); - } - - if (!profile_) { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** ERROR: No profile, aborting\n"); + if (!profile_) return; - } // We don't expect to get events from a completely different profile. DCHECK(!restrict_to_profile || profile_->IsSameProfile(restrict_to_profile)); ListenerMap::iterator it = listeners_.find(event_name); - if (it == listeners_.end()) { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** WARNING: no listeners, aborting\n"); + if (it == listeners_.end()) return; - } std::set<int>& pids = it->second; // Send the event only to renderers that are listening for it. for (std::set<int>::iterator pid = pids.begin(); pid != pids.end(); ++pid) { RenderProcessHost* renderer = RenderProcessHost::FromID(*pid); - if (!renderer) { - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** ERROR: !renderer, trying next one\n"); + if (!renderer) continue; - } if (!ChildProcessSecurityPolicy::GetInstance()-> HasExtensionBindings(*pid)) { // Don't send browser-level events to unprivileged processes. - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** ERROR: unprivileged pid, try next\n"); continue; } @@ -425,8 +409,6 @@ void ExtensionMessageService::DispatchEventToRenderers( // incognito tab event sent to a normal process, or vice versa). bool cross_incognito = restrict_to_profile && renderer->profile() != restrict_to_profile; - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** --- Dispatching event! ---\n"); DispatchEvent(renderer, event_name, event_args, cross_incognito, event_url); } } diff --git a/chrome/browser/extensions/extension_test_message_listener.cc b/chrome/browser/extensions/extension_test_message_listener.cc index be23a4a..423bf3b 100644 --- a/chrome/browser/extensions/extension_test_message_listener.cc +++ b/chrome/browser/extensions/extension_test_message_listener.cc @@ -9,9 +9,6 @@ #include "chrome/common/notification_type.h" #include "chrome/test/ui_test_utils.h" -// TODO(finnur): Remove after capturing debug info. -#include "chrome/common/extensions/extension.h" - ExtensionTestMessageListener::ExtensionTestMessageListener( const std::string& expected_message, bool will_reply) @@ -47,12 +44,6 @@ void ExtensionTestMessageListener::Observe( const NotificationDetails& details) { const std::string& content = *Details<std::string>(details).ptr(); function_ = Source<ExtensionTestSendMessageFunction>(source).ptr(); - // TODO(finnur): Remove after capturing debug info. - if (Extension::emit_traces_for_whitelist_extension_test_) { - printf("-*-*- Got : %s\n", content.c_str()); - printf("-*-*- Expected: %s\n", expected_message_.c_str()); - } - if (!satisfied_ && content == expected_message_) { satisfied_ = true; registrar_.RemoveAll(); // Stop listening for more messages. diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 40e1a8e..084f13e 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -1110,18 +1110,10 @@ void NavigationController::NotifyNavigationEntryCommitted( tab_contents_->NotifyNavigationStateChanged( kInvalidateAllButShelves | extra_invalidate_flags); - // TODO(finnur): Remove once I have results from failed run of this test. - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** Sending NAV_ENTRY_COMMITTED\n"); - NotificationService::current()->Notify( NotificationType::NAV_ENTRY_COMMITTED, Source<NavigationController>(this), notification_details); - - // TODO(finnur): Remove once I have results from failed run of this test. - if (Extension::emit_traces_for_whitelist_extension_test_) - printf("***** NAV_ENTRY_COMMITTED sent\n"); } // static |