| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 "failed-with-error-PERMISSION_DENIED"; | 37 "failed-with-error-PERMISSION_DENIED"; |
| 38 | 38 |
| 39 static const char kAudioVideoCallConstraints[] = "'{audio: true, video: true}'"; | 39 static const char kAudioVideoCallConstraints[] = "'{audio: true, video: true}'"; |
| 40 static const char kAudioOnlyCallConstraints[] = "'{audio: true}'"; | 40 static const char kAudioOnlyCallConstraints[] = "'{audio: true}'"; |
| 41 static const char kVideoOnlyCallConstraints[] = "'{video: true}'"; | 41 static const char kVideoOnlyCallConstraints[] = "'{video: true}'"; |
| 42 static const char kOkGotStream[] = "ok-got-stream"; | 42 static const char kOkGotStream[] = "ok-got-stream"; |
| 43 | 43 |
| 44 // Media stream infobar test for WebRTC. | 44 // Media stream infobar test for WebRTC. |
| 45 class MediaStreamInfobarTest : public InProcessBrowserTest { | 45 class MediaStreamInfobarTest : public InProcessBrowserTest { |
| 46 public: | 46 public: |
| 47 // InProcessBrowserTest: |
| 47 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 48 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 48 // This test expects to run with fake devices but real UI. | 49 // This test expects to run with fake devices but real UI. |
| 49 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 50 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
| 50 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)) | 51 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)) |
| 51 << "Since this test tests the UI we want the real UI!"; | 52 << "Since this test tests the UI we want the real UI!"; |
| 52 } | 53 } |
| 53 protected: | 54 protected: |
| 54 content::WebContents* LoadTestPageInTab() { | 55 content::WebContents* LoadTestPageInTab() { |
| 55 EXPECT_TRUE(test_server()->Start()); | 56 EXPECT_TRUE(test_server()->Start()); |
| 56 | 57 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 content::WebContents* tab_contents = LoadTestPageInTab(); | 264 content::WebContents* tab_contents = LoadTestPageInTab(); |
| 264 | 265 |
| 265 // If microphone blocking also blocked a AV call, the second call here | 266 // If microphone blocking also blocked a AV call, the second call here |
| 266 // would hang. The requester should only be granted access to the cam though. | 267 // would hang. The requester should only be granted access to the cam though. |
| 267 TestDenyWithSpecificConstraints(tab_contents, kAudioOnlyCallConstraints); | 268 TestDenyWithSpecificConstraints(tab_contents, kAudioOnlyCallConstraints); |
| 268 TestAcceptOnInfobarWithSpecificConstraints(tab_contents, | 269 TestAcceptOnInfobarWithSpecificConstraints(tab_contents, |
| 269 kAudioVideoCallConstraints); | 270 kAudioVideoCallConstraints); |
| 270 | 271 |
| 271 // TODO(phoglund): verify the requester actually only gets video tracks. | 272 // TODO(phoglund): verify the requester actually only gets video tracks. |
| 272 } | 273 } |
| OLD | NEW |