OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/json/json_reader.h" | 6 #include "base/json/json_reader.h" |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "chrome/browser/media/webrtc_browsertest_base.h" | 8 #include "chrome/browser/media/webrtc_browsertest_base.h" |
9 #include "chrome/browser/media/webrtc_browsertest_common.h" | 9 #include "chrome/browser/media/webrtc_browsertest_common.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // test that labels are cleared or not depending on if access to devices has | 36 // test that labels are cleared or not depending on if access to devices has |
37 // been granted. | 37 // been granted. |
38 class WebRtcGetMediaDevicesBrowserTest | 38 class WebRtcGetMediaDevicesBrowserTest |
39 : public WebRtcTestBase, | 39 : public WebRtcTestBase, |
40 public testing::WithParamInterface<bool> { | 40 public testing::WithParamInterface<bool> { |
41 public: | 41 public: |
42 WebRtcGetMediaDevicesBrowserTest() | 42 WebRtcGetMediaDevicesBrowserTest() |
43 : has_audio_output_devices_initialized_(false), | 43 : has_audio_output_devices_initialized_(false), |
44 has_audio_output_devices_(false) {} | 44 has_audio_output_devices_(false) {} |
45 | 45 |
46 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 46 virtual void SetUpInProcessBrowserTestFixture() override { |
47 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | 47 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. |
48 } | 48 } |
49 | 49 |
50 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 50 virtual void SetUpCommandLine(CommandLine* command_line) override { |
51 // Ensure the infobar is enabled, since we expect that in this test. | 51 // Ensure the infobar is enabled, since we expect that in this test. |
52 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); | 52 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); |
53 | 53 |
54 // Always use fake devices. | 54 // Always use fake devices. |
55 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 55 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
56 } | 56 } |
57 | 57 |
58 protected: | 58 protected: |
59 // This is used for media devices and sources. | 59 // This is used for media devices and sources. |
60 struct MediaDeviceInfo { | 60 struct MediaDeviceInfo { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 EXPECT_STREQ(kSourceKindAudioInput, sources_it->kind.c_str()); | 287 EXPECT_STREQ(kSourceKindAudioInput, sources_it->kind.c_str()); |
288 } else { | 288 } else { |
289 EXPECT_STREQ(kSourceKindVideoInput, sources_it->kind.c_str()); | 289 EXPECT_STREQ(kSourceKindVideoInput, sources_it->kind.c_str()); |
290 } | 290 } |
291 EXPECT_TRUE(!devices_it->label.empty()); | 291 EXPECT_TRUE(!devices_it->label.empty()); |
292 EXPECT_STREQ(devices_it->label.c_str(), sources_it->label.c_str()); | 292 EXPECT_STREQ(devices_it->label.c_str(), sources_it->label.c_str()); |
293 ++sources_it; | 293 ++sources_it; |
294 } | 294 } |
295 EXPECT_EQ(sources.end(), sources_it); | 295 EXPECT_EQ(sources.end(), sources_it); |
296 } | 296 } |
OLD | NEW |