OLD | NEW |
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/webrtc_browsertest_base.h" | 5 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 " minHeight: 360, maxHeight: 360}}}"; | 60 " minHeight: 360, maxHeight: 360}}}"; |
61 const char WebRtcTestBase::kAudioVideoCallConstraints720p[] = | 61 const char WebRtcTestBase::kAudioVideoCallConstraints720p[] = |
62 "{audio: true, video: {mandatory: {minWidth: 1280, maxWidth: 1280, " | 62 "{audio: true, video: {mandatory: {minWidth: 1280, maxWidth: 1280, " |
63 " minHeight: 720, maxHeight: 720}}}"; | 63 " minHeight: 720, maxHeight: 720}}}"; |
64 const char WebRtcTestBase::kUseDefaultCertKeygen[] = "null"; | 64 const char WebRtcTestBase::kUseDefaultCertKeygen[] = "null"; |
65 const char WebRtcTestBase::kUseDefaultAudioCodec[] = ""; | 65 const char WebRtcTestBase::kUseDefaultAudioCodec[] = ""; |
66 const char WebRtcTestBase::kUseDefaultVideoCodec[] = ""; | 66 const char WebRtcTestBase::kUseDefaultVideoCodec[] = ""; |
67 | 67 |
68 namespace { | 68 namespace { |
69 | 69 |
70 base::LazyInstance<bool> hit_javascript_errors_ = | 70 base::LazyInstance<bool>::DestructorAtExit hit_javascript_errors_ = |
71 LAZY_INSTANCE_INITIALIZER; | 71 LAZY_INSTANCE_INITIALIZER; |
72 | 72 |
73 // Intercepts all log messages. We always attach this handler but only look at | 73 // Intercepts all log messages. We always attach this handler but only look at |
74 // the results if the test requests so. Note that this will only work if the | 74 // the results if the test requests so. Note that this will only work if the |
75 // WebrtcTestBase-inheriting test cases do not run in parallel (if they did they | 75 // WebrtcTestBase-inheriting test cases do not run in parallel (if they did they |
76 // would race to look at the log, which is global to all tests). | 76 // would race to look at the log, which is global to all tests). |
77 bool JavascriptErrorDetectingLogHandler(int severity, | 77 bool JavascriptErrorDetectingLogHandler(int severity, |
78 const char* file, | 78 const char* file, |
79 int line, | 79 int line, |
80 size_t message_start, | 80 size_t message_start, |
81 const std::string& str) { | 81 const std::string& str) { |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 void WebRtcTestBase::SetDefaultVideoCodec( | 552 void WebRtcTestBase::SetDefaultVideoCodec( |
553 content::WebContents* tab, | 553 content::WebContents* tab, |
554 const std::string& video_codec) const { | 554 const std::string& video_codec) const { |
555 EXPECT_EQ("ok", ExecuteJavascript( | 555 EXPECT_EQ("ok", ExecuteJavascript( |
556 "setDefaultVideoCodec('" + video_codec + "')", tab)); | 556 "setDefaultVideoCodec('" + video_codec + "')", tab)); |
557 } | 557 } |
558 | 558 |
559 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { | 559 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { |
560 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); | 560 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); |
561 } | 561 } |
OLD | NEW |