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 <algorithm> | 5 #include <algorithm> |
6 #include <cmath> | 6 #include <cmath> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "net/base/rand_callback.h" | 30 #include "net/base/rand_callback.h" |
31 #include "net/udp/udp_server_socket.h" | 31 #include "net/udp/udp_server_socket.h" |
32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
33 | 33 |
34 using media::cast::test::GetFreeLocalPort; | 34 using media::cast::test::GetFreeLocalPort; |
35 | 35 |
36 namespace extensions { | 36 namespace extensions { |
37 | 37 |
38 class CastStreamingApiTest : public ExtensionApiTest { | 38 class CastStreamingApiTest : public ExtensionApiTest { |
39 public: | 39 public: |
40 void SetUpCommandLine(CommandLine* command_line) override { | 40 void SetUpCommandLine(base::CommandLine* command_line) override { |
41 ExtensionApiTest::SetUpCommandLine(command_line); | 41 ExtensionApiTest::SetUpCommandLine(command_line); |
42 command_line->AppendSwitchASCII( | 42 command_line->AppendSwitchASCII( |
43 extensions::switches::kWhitelistedExtensionID, | 43 extensions::switches::kWhitelistedExtensionID, |
44 "ddchlicdkolnonkihahngkmmmjnjlkkf"); | 44 "ddchlicdkolnonkihahngkmmmjnjlkkf"); |
45 command_line->AppendSwitchASCII(::switches::kWindowSize, "300,300"); | 45 command_line->AppendSwitchASCII(::switches::kWindowSize, "300,300"); |
46 } | 46 } |
47 }; | 47 }; |
48 | 48 |
49 // Test running the test extension for Cast Mirroring API. | 49 // Test running the test extension for Cast Mirroring API. |
50 IN_PROC_BROWSER_TEST_F(CastStreamingApiTest, Basics) { | 50 IN_PROC_BROWSER_TEST_F(CastStreamingApiTest, Basics) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 }; | 314 }; |
315 | 315 |
316 } // namespace | 316 } // namespace |
317 | 317 |
318 class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest { | 318 class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest { |
319 void SetUp() override { | 319 void SetUp() override { |
320 EnablePixelOutput(); | 320 EnablePixelOutput(); |
321 CastStreamingApiTest::SetUp(); | 321 CastStreamingApiTest::SetUp(); |
322 } | 322 } |
323 | 323 |
324 void SetUpCommandLine(CommandLine* command_line) override { | 324 void SetUpCommandLine(base::CommandLine* command_line) override { |
325 command_line->AppendSwitchASCII(::switches::kWindowSize, "128,128"); | 325 command_line->AppendSwitchASCII(::switches::kWindowSize, "128,128"); |
326 CastStreamingApiTest::SetUpCommandLine(command_line); | 326 CastStreamingApiTest::SetUpCommandLine(command_line); |
327 } | 327 } |
328 }; | 328 }; |
329 | 329 |
330 // Tests the Cast streaming API and its basic functionality end-to-end. An | 330 // Tests the Cast streaming API and its basic functionality end-to-end. An |
331 // extension subtest is run to generate test content, capture that content, and | 331 // extension subtest is run to generate test content, capture that content, and |
332 // use the API to send it out. At the same time, this test launches an | 332 // use the API to send it out. At the same time, this test launches an |
333 // in-process Cast receiver, listening on a localhost UDP socket, to receive the | 333 // in-process Cast receiver, listening on a localhost UDP socket, to receive the |
334 // content and check whether it matches expectations. | 334 // content and check whether it matches expectations. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 385 |
386 delete receiver; | 386 delete receiver; |
387 cast_environment->Shutdown(); | 387 cast_environment->Shutdown(); |
388 } | 388 } |
389 | 389 |
390 IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, RtpStreamError) { | 390 IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, RtpStreamError) { |
391 ASSERT_TRUE(RunExtensionSubtest("cast_streaming", "rtp_stream_error.html")); | 391 ASSERT_TRUE(RunExtensionSubtest("cast_streaming", "rtp_stream_error.html")); |
392 } | 392 } |
393 | 393 |
394 } // namespace extensions | 394 } // namespace extensions |
OLD | NEW |