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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } | 78 } |
79 | 79 |
80 virtual void SetUpOnMainThread() OVERRIDE { | 80 virtual void SetUpOnMainThread() override { |
81 AudioWaitingExtensionTest::SetUpOnMainThread(); | 81 AudioWaitingExtensionTest::SetUpOnMainThread(); |
82 // Needs to happen after chrome's schemes are added. | 82 // Needs to happen after chrome's schemes are added. |
83 source_url_ = GURL("chrome-extension://fakeid012345678/fakepage.html"); | 83 source_url_ = GURL("chrome-extension://fakeid012345678/fakepage.html"); |
84 } | 84 } |
85 | 85 |
86 protected: | 86 protected: |
87 std::string InvokeGetActiveSink(int tab_id) { | 87 std::string InvokeGetActiveSink(int tab_id) { |
88 base::ListValue parameters; | 88 base::ListValue parameters; |
89 parameters.AppendInteger(tab_id); | 89 parameters.AppendInteger(tab_id); |
90 std::string parameter_string; | 90 std::string parameter_string; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 service->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); | 364 service->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); |
365 | 365 |
366 // Check that the extension got the notification. | 366 // Check that the extension got the notification. |
367 std::string result = ExecuteScriptInBackgroundPage(extension->id(), | 367 std::string result = ExecuteScriptInBackgroundPage(extension->id(), |
368 "reportIfGot()"); | 368 "reportIfGot()"); |
369 EXPECT_EQ("true", result); | 369 EXPECT_EQ("true", result); |
370 } | 370 } |
371 | 371 |
372 class HangoutServicesBrowserTest : public AudioWaitingExtensionTest { | 372 class HangoutServicesBrowserTest : public AudioWaitingExtensionTest { |
373 public: | 373 public: |
374 virtual void SetUp() OVERRIDE { | 374 virtual void SetUp() override { |
375 // Make sure the Hangout Services component extension gets loaded. | 375 // Make sure the Hangout Services component extension gets loaded. |
376 ComponentLoader::EnableBackgroundExtensionsForTesting(); | 376 ComponentLoader::EnableBackgroundExtensionsForTesting(); |
377 AudioWaitingExtensionTest::SetUp(); | 377 AudioWaitingExtensionTest::SetUp(); |
378 } | 378 } |
379 }; | 379 }; |
380 | 380 |
381 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) | 381 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) |
382 IN_PROC_BROWSER_TEST_F(HangoutServicesBrowserTest, | 382 IN_PROC_BROWSER_TEST_F(HangoutServicesBrowserTest, |
383 RunComponentExtensionTest) { | 383 RunComponentExtensionTest) { |
384 // This runs the end-to-end JavaScript test for the Hangout Services | 384 // This runs the end-to-end JavaScript test for the Hangout Services |
(...skipping 25 matching lines...) Expand all Loading... |
410 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); | 410 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); |
411 base::string16 result = title_watcher.WaitAndGetTitle(); | 411 base::string16 result = title_watcher.WaitAndGetTitle(); |
412 EXPECT_EQ(base::ASCIIToUTF16("success"), result); | 412 EXPECT_EQ(base::ASCIIToUTF16("success"), result); |
413 | 413 |
414 g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( | 414 g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( |
415 NULL); | 415 NULL); |
416 } | 416 } |
417 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
SION) | 417 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
SION) |
418 | 418 |
419 } // namespace extensions | 419 } // namespace extensions |
OLD | NEW |