Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc

Issue 2326623003: Make SystemMonitor report all audio device changes instead of just audio capture. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 #define MAYBE_TriggerEvent DISABLED_TriggerEvent 370 #define MAYBE_TriggerEvent DISABLED_TriggerEvent
371 #else 371 #else
372 #define MAYBE_TriggerEvent TriggerEvent 372 #define MAYBE_TriggerEvent TriggerEvent
373 #endif 373 #endif
374 374
375 IN_PROC_BROWSER_TEST_F(WebrtcAudioPrivateTest, MAYBE_TriggerEvent) { 375 IN_PROC_BROWSER_TEST_F(WebrtcAudioPrivateTest, MAYBE_TriggerEvent) {
376 WebrtcAudioPrivateEventService* service = 376 WebrtcAudioPrivateEventService* service =
377 WebrtcAudioPrivateEventService::GetFactoryInstance()->Get(profile()); 377 WebrtcAudioPrivateEventService::GetFactoryInstance()->Get(profile());
378 378
379 // Just trigger, without any extension listening. 379 // Just trigger, without any extension listening.
380 service->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); 380 service->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO);
381 381
382 // Now load our test extension and do it again. 382 // Now load our test extension and do it again.
383 const extensions::Extension* extension = LoadExtension( 383 const extensions::Extension* extension = LoadExtension(
384 test_data_dir_.AppendASCII("webrtc_audio_private_event_listener")); 384 test_data_dir_.AppendASCII("webrtc_audio_private_event_listener"));
385 service->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); 385 service->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO);
386 386
387 // Check that the extension got the notification. 387 // Check that the extension got the notification.
388 std::string result = ExecuteScriptInBackgroundPage(extension->id(), 388 std::string result = ExecuteScriptInBackgroundPage(extension->id(),
389 "reportIfGot()"); 389 "reportIfGot()");
390 EXPECT_EQ("true", result); 390 EXPECT_EQ("true", result);
391 } 391 }
392 392
393 class HangoutServicesBrowserTest : public AudioWaitingExtensionTest { 393 class HangoutServicesBrowserTest : public AudioWaitingExtensionTest {
394 public: 394 public:
395 void SetUp() override { 395 void SetUp() override {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); 432 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure"));
433 base::string16 result = title_watcher.WaitAndGetTitle(); 433 base::string16 result = title_watcher.WaitAndGetTitle();
434 EXPECT_EQ(base::ASCIIToUTF16("success"), result); 434 EXPECT_EQ(base::ASCIIToUTF16("success"), result);
435 435
436 g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( 436 g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting(
437 NULL); 437 NULL);
438 } 438 }
439 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN SION) 439 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN SION)
440 440
441 } // namespace extensions 441 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698