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

Unified Diff: chrome/browser/extensions/extension_test_message_listener.cc

Issue 3058044: Revert 54955 - Merge 54514 ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/479/src/
Patch Set: Created 10 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_test_message_listener.cc
===================================================================
--- chrome/browser/extensions/extension_test_message_listener.cc (revision 54967)
+++ chrome/browser/extensions/extension_test_message_listener.cc (working copy)
@@ -1,43 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/extension_test_message_listener.h"
-
-#include "base/logging.h"
-#include "chrome/common/notification_service.h"
-#include "chrome/common/notification_type.h"
-#include "chrome/test/ui_test_utils.h"
-
-ExtensionTestMessageListener::ExtensionTestMessageListener(
- const std::string& expected_message)
- : expected_message_(expected_message), satisfied_(false),
- waiting_(false) {
- registrar_.Add(this, NotificationType::EXTENSION_TEST_MESSAGE,
- NotificationService::AllSources());
-}
-
-ExtensionTestMessageListener::~ExtensionTestMessageListener() {}
-
-bool ExtensionTestMessageListener::WaitUntilSatisfied() {
- if (satisfied_)
- return true;
- waiting_ = true;
- ui_test_utils::RunMessageLoop();
- return satisfied_;
-}
-
-void ExtensionTestMessageListener::Observe(
- NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- const std::string& content = *Details<std::string>(details).ptr();
- if (!satisfied_ && content == expected_message_) {
- satisfied_ = true;
- registrar_.RemoveAll(); // Stop listening for more messages.
- if (waiting_) {
- waiting_ = false;
- MessageLoopForUI::current()->Quit();
- }
- }
-}
« no previous file with comments | « chrome/browser/extensions/extension_test_message_listener.h ('k') | chrome/browser/tab_contents/render_view_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698