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

Side by Side Diff: chrome/browser/extensions/error_console/error_console_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/error_console/error_console.h" 5 #include "chrome/browser/extensions/error_console/error_console.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 virtual ~ErrorObserver() { 151 virtual ~ErrorObserver() {
152 if (error_console_) 152 if (error_console_)
153 error_console_->RemoveObserver(this); 153 error_console_->RemoveObserver(this);
154 } 154 }
155 155
156 // ErrorConsole::Observer implementation. 156 // ErrorConsole::Observer implementation.
157 void OnErrorAdded(const ExtensionError* error) override { 157 void OnErrorAdded(const ExtensionError* error) override {
158 ++errors_observed_; 158 ++errors_observed_;
159 if (errors_observed_ >= errors_expected_) { 159 if (errors_observed_ >= errors_expected_) {
160 if (waiting_) 160 if (waiting_)
161 base::MessageLoopForUI::current()->Quit(); 161 base::MessageLoopForUI::current()->QuitWhenIdle();
162 } 162 }
163 } 163 }
164 164
165 void OnErrorConsoleDestroyed() override { error_console_ = NULL; } 165 void OnErrorConsoleDestroyed() override { error_console_ = NULL; }
166 166
167 // Spin until the appropriate number of errors have been observed. 167 // Spin until the appropriate number of errors have been observed.
168 void WaitForErrors() { 168 void WaitForErrors() {
169 if (errors_observed_ < errors_expected_) { 169 if (errors_observed_ < errors_expected_) {
170 waiting_ = true; 170 waiting_ = true;
171 content::RunMessageLoop(); 171 content::RunMessageLoop();
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 const StackTrace& stack_trace = GetStackTraceFromError(errors[0]); 581 const StackTrace& stack_trace = GetStackTraceFromError(errors[0]);
582 ASSERT_EQ(1u, stack_trace.size()); 582 ASSERT_EQ(1u, stack_trace.size());
583 CheckStackFrame(stack_trace[0], 583 CheckStackFrame(stack_trace[0],
584 script_url, 584 script_url,
585 kAnonymousFunction, 585 kAnonymousFunction,
586 12u, 20u); 586 12u, 20u);
587 } 587 }
588 588
589 } // namespace extensions 589 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698