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/json/json_writer.h" | 5 #include "base/json/json_writer.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool* audio_playing, | 67 bool* audio_playing, |
68 const RenderViewHost::AudioOutputControllerList& list) { | 68 const RenderViewHost::AudioOutputControllerList& list) { |
69 if (!list.empty()) | 69 if (!list.empty()) |
70 *audio_playing = true; | 70 *audio_playing = true; |
71 } | 71 } |
72 }; | 72 }; |
73 | 73 |
74 class WebrtcAudioPrivateTest : public AudioWaitingExtensionTest { | 74 class WebrtcAudioPrivateTest : public AudioWaitingExtensionTest { |
75 public: | 75 public: |
76 WebrtcAudioPrivateTest() | 76 WebrtcAudioPrivateTest() |
77 : enumeration_event_(false, false), | 77 : enumeration_event_(false, false) { |
78 source_url_("chrome-extension://fakeid012345678/fakepage.html") { | 78 } |
| 79 |
| 80 virtual void SetUpOnMainThread() OVERRIDE { |
| 81 AudioWaitingExtensionTest::SetUpOnMainThread(); |
| 82 // Needs to happen after chrome's schemes are added. |
| 83 source_url_ = GURL("chrome-extension://fakeid012345678/fakepage.html"); |
79 } | 84 } |
80 | 85 |
81 protected: | 86 protected: |
82 std::string InvokeGetActiveSink(int tab_id) { | 87 std::string InvokeGetActiveSink(int tab_id) { |
83 base::ListValue parameters; | 88 base::ListValue parameters; |
84 parameters.AppendInteger(tab_id); | 89 parameters.AppendInteger(tab_id); |
85 std::string parameter_string; | 90 std::string parameter_string; |
86 JSONWriter::Write(¶meters, ¶meter_string); | 91 JSONWriter::Write(¶meters, ¶meter_string); |
87 | 92 |
88 scoped_refptr<WebrtcAudioPrivateGetActiveSinkFunction> function = | 93 scoped_refptr<WebrtcAudioPrivateGetActiveSinkFunction> function = |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 ASSERT_TRUE(content::ExecuteScript(tab, "browsertestRunAllTests();")); | 407 ASSERT_TRUE(content::ExecuteScript(tab, "browsertestRunAllTests();")); |
403 | 408 |
404 content::TitleWatcher title_watcher(tab, base::ASCIIToUTF16("success")); | 409 content::TitleWatcher title_watcher(tab, base::ASCIIToUTF16("success")); |
405 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); | 410 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); |
406 base::string16 result = title_watcher.WaitAndGetTitle(); | 411 base::string16 result = title_watcher.WaitAndGetTitle(); |
407 EXPECT_EQ(base::ASCIIToUTF16("success"), result); | 412 EXPECT_EQ(base::ASCIIToUTF16("success"), result); |
408 } | 413 } |
409 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
SION) | 414 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
SION) |
410 | 415 |
411 } // namespace extensions | 416 } // namespace extensions |
OLD | NEW |