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

Side by Side Diff: chrome/browser/media/webrtc_browsertest_base.cc

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix installation_validator_unittest Created 4 years, 6 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/media/webrtc_browsertest_base.h" 5 #include "chrome/browser/media/webrtc_browsertest_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; 117 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
118 118
119 DISALLOW_COPY_AND_ASSIGN(PermissionRequestObserver); 119 DISALLOW_COPY_AND_ASSIGN(PermissionRequestObserver);
120 }; 120 };
121 121
122 } // namespace 122 } // namespace
123 123
124 WebRtcTestBase::WebRtcTestBase(): detect_errors_in_javascript_(false) { 124 WebRtcTestBase::WebRtcTestBase(): detect_errors_in_javascript_(false) {
125 // The handler gets set for each test method, but that's fine since this 125 // The handler gets set for each test method, but that's fine since this
126 // set operation is idempotent. 126 // set operation is idempotent.
127 logging::SetLogMessageHandler(&JavascriptErrorDetectingLogHandler); 127 logging::PushLogMessageHandler(&JavascriptErrorDetectingLogHandler);
128 hit_javascript_errors_.Get() = false; 128 hit_javascript_errors_.Get() = false;
129 129
130 EnablePixelOutput(); 130 EnablePixelOutput();
131 } 131 }
132 132
133 WebRtcTestBase::~WebRtcTestBase() { 133 WebRtcTestBase::~WebRtcTestBase() {
134 logging::PopLogMessageHandler();
134 if (detect_errors_in_javascript_) { 135 if (detect_errors_in_javascript_) {
135 EXPECT_FALSE(hit_javascript_errors_.Get()) 136 EXPECT_FALSE(hit_javascript_errors_.Get())
136 << "Encountered javascript errors during test execution (Search " 137 << "Encountered javascript errors during test execution (Search "
137 << "for Uncaught or ERROR:CONSOLE in the test output)."; 138 << "for Uncaught or ERROR:CONSOLE in the test output).";
138 } 139 }
139 } 140 }
140 141
141 bool WebRtcTestBase::GetUserMediaAndAccept( 142 bool WebRtcTestBase::GetUserMediaAndAccept(
142 content::WebContents* tab_contents) const { 143 content::WebContents* tab_contents) const {
143 return GetUserMediaWithSpecificConstraintsAndAccept( 144 return GetUserMediaWithSpecificConstraintsAndAccept(
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } 478 }
478 479
479 void WebRtcTestBase::GenerateAndCloneCertificate( 480 void WebRtcTestBase::GenerateAndCloneCertificate(
480 content::WebContents* tab, const std::string& keygen_algorithm) const { 481 content::WebContents* tab, const std::string& keygen_algorithm) const {
481 std::string javascript = base::StringPrintf( 482 std::string javascript = base::StringPrintf(
482 "generateAndCloneCertificate(%s)", keygen_algorithm.c_str()); 483 "generateAndCloneCertificate(%s)", keygen_algorithm.c_str());
483 std::string response = ExecuteJavascript(javascript, tab); 484 std::string response = ExecuteJavascript(javascript, tab);
484 EXPECT_EQ("ok-generated-and-cloned", response) << "Failed to generate and " 485 EXPECT_EQ("ok-generated-and-cloned", response) << "Failed to generate and "
485 "clone certificate: " << response; 486 "clone certificate: " << response;
486 } 487 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698