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 <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" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "base/win/windows_version.h" | 18 #include "base/win/windows_version.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat
e_api.h" | 21 #include "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat
e_api.h" |
22 #include "chrome/browser/extensions/component_loader.h" | 22 #include "chrome/browser/extensions/component_loader.h" |
23 #include "chrome/browser/extensions/extension_apitest.h" | 23 #include "chrome/browser/extensions/extension_apitest.h" |
24 #include "chrome/browser/extensions/extension_function_test_utils.h" | 24 #include "chrome/browser/extensions/extension_function_test_utils.h" |
25 #include "chrome/browser/extensions/extension_tab_util.h" | 25 #include "chrome/browser/extensions/extension_tab_util.h" |
26 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h" | 26 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h" |
27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 29 #include "chrome/common/features.h" |
29 #include "chrome/test/base/in_process_browser_test.h" | 30 #include "chrome/test/base/in_process_browser_test.h" |
30 #include "chrome/test/base/ui_test_utils.h" | 31 #include "chrome/test/base/ui_test_utils.h" |
31 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
32 #include "content/public/browser/media_device_id.h" | 33 #include "content/public/browser/media_device_id.h" |
33 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
34 #include "content/public/test/browser_test_utils.h" | 35 #include "content/public/test/browser_test_utils.h" |
35 #include "extensions/common/permissions/permission_set.h" | 36 #include "extensions/common/permissions/permission_set.h" |
36 #include "extensions/common/permissions/permissions_data.h" | 37 #include "extensions/common/permissions/permissions_data.h" |
37 #include "media/audio/audio_device_description.h" | 38 #include "media/audio/audio_device_description.h" |
38 #include "media/audio/audio_manager.h" | 39 #include "media/audio/audio_manager.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 393 |
393 class HangoutServicesBrowserTest : public AudioWaitingExtensionTest { | 394 class HangoutServicesBrowserTest : public AudioWaitingExtensionTest { |
394 public: | 395 public: |
395 void SetUp() override { | 396 void SetUp() override { |
396 // Make sure the Hangout Services component extension gets loaded. | 397 // Make sure the Hangout Services component extension gets loaded. |
397 ComponentLoader::EnableBackgroundExtensionsForTesting(); | 398 ComponentLoader::EnableBackgroundExtensionsForTesting(); |
398 AudioWaitingExtensionTest::SetUp(); | 399 AudioWaitingExtensionTest::SetUp(); |
399 } | 400 } |
400 }; | 401 }; |
401 | 402 |
402 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) | 403 #if defined(GOOGLE_CHROME_BUILD) || BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION) |
403 IN_PROC_BROWSER_TEST_F(HangoutServicesBrowserTest, | 404 IN_PROC_BROWSER_TEST_F(HangoutServicesBrowserTest, |
404 RunComponentExtensionTest) { | 405 RunComponentExtensionTest) { |
405 // This runs the end-to-end JavaScript test for the Hangout Services | 406 // This runs the end-to-end JavaScript test for the Hangout Services |
406 // component extension, which uses the webrtcAudioPrivate API among | 407 // component extension, which uses the webrtcAudioPrivate API among |
407 // others. | 408 // others. |
408 ASSERT_TRUE(StartEmbeddedTestServer()); | 409 ASSERT_TRUE(StartEmbeddedTestServer()); |
409 GURL url(embedded_test_server()->GetURL( | 410 GURL url(embedded_test_server()->GetURL( |
410 "/extensions/hangout_services_test.html")); | 411 "/extensions/hangout_services_test.html")); |
411 // The "externally connectable" extension permission doesn't seem to | 412 // The "externally connectable" extension permission doesn't seem to |
412 // like when we use 127.0.0.1 as the host, but using localhost works. | 413 // like when we use 127.0.0.1 as the host, but using localhost works. |
(...skipping 16 matching lines...) Expand all Loading... |
429 ASSERT_TRUE(content::ExecuteScript(tab, "browsertestRunAllTests();")); | 430 ASSERT_TRUE(content::ExecuteScript(tab, "browsertestRunAllTests();")); |
430 | 431 |
431 content::TitleWatcher title_watcher(tab, base::ASCIIToUTF16("success")); | 432 content::TitleWatcher title_watcher(tab, base::ASCIIToUTF16("success")); |
432 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); | 433 title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); |
433 base::string16 result = title_watcher.WaitAndGetTitle(); | 434 base::string16 result = title_watcher.WaitAndGetTitle(); |
434 EXPECT_EQ(base::ASCIIToUTF16("success"), result); | 435 EXPECT_EQ(base::ASCIIToUTF16("success"), result); |
435 | 436 |
436 g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( | 437 g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( |
437 NULL); | 438 NULL); |
438 } | 439 } |
439 #endif // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
SION) | 440 #endif // defined(GOOGLE_CHROME_BUILD) || BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXT
ENSION) |
440 | 441 |
441 } // namespace extensions | 442 } // namespace extensions |
OLD | NEW |