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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "third_party/WebKit/public/web/WebMediaPlayer.h" | 7 #include "content/renderer/media/android/media_info_loader.h" |
8 #include "third_party/WebKit/public/web/WebView.h" | |
9 #include "third_party/WebKit/public/platform/WebURLError.h" | 8 #include "third_party/WebKit/public/platform/WebURLError.h" |
10 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 9 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
11 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 10 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 11 #include "third_party/WebKit/public/web/WebMediaPlayer.h" |
| 12 #include "third_party/WebKit/public/web/WebView.h" |
12 #include "webkit/mocks/mock_webframeclient.h" | 13 #include "webkit/mocks/mock_webframeclient.h" |
13 #include "webkit/mocks/mock_weburlloader.h" | 14 #include "webkit/mocks/mock_weburlloader.h" |
14 #include "webkit/renderer/media/media_info_loader.h" | |
15 | 15 |
16 using ::testing::_; | 16 using ::testing::_; |
17 using ::testing::InSequence; | 17 using ::testing::InSequence; |
18 using ::testing::NiceMock; | 18 using ::testing::NiceMock; |
19 | 19 |
20 using WebKit::WebString; | 20 using WebKit::WebString; |
21 using WebKit::WebURLError; | 21 using WebKit::WebURLError; |
22 using WebKit::WebURLResponse; | 22 using WebKit::WebURLResponse; |
23 using WebKit::WebView; | 23 using WebKit::WebView; |
24 | 24 |
25 using webkit_glue::MockWebFrameClient; | 25 using webkit_glue::MockWebFrameClient; |
26 using webkit_glue::MockWebURLLoader; | 26 using webkit_glue::MockWebURLLoader; |
27 | 27 |
28 namespace webkit_media { | 28 namespace content { |
29 | 29 |
30 static const char* kHttpUrl = "http://test"; | 30 static const char* kHttpUrl = "http://test"; |
31 static const char kHttpRedirectToSameDomainUrl1[] = "http://test/ing"; | 31 static const char kHttpRedirectToSameDomainUrl1[] = "http://test/ing"; |
32 static const char kHttpRedirectToSameDomainUrl2[] = "http://test/ing2"; | 32 static const char kHttpRedirectToSameDomainUrl2[] = "http://test/ing2"; |
33 static const char kHttpRedirectToDifferentDomainUrl1[] = "http://test2"; | 33 static const char kHttpRedirectToDifferentDomainUrl1[] = "http://test2"; |
34 | 34 |
35 static const int kHttpOK = 200; | 35 static const int kHttpOK = 200; |
36 static const int kHttpNotFound = 404; | 36 static const int kHttpNotFound = 404; |
37 | 37 |
38 class MediaInfoLoaderTest : public testing::Test { | 38 class MediaInfoLoaderTest : public testing::Test { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 EXPECT_TRUE(loader_->DidPassCORSAccessCheck()); | 183 EXPECT_TRUE(loader_->DidPassCORSAccessCheck()); |
184 } | 184 } |
185 | 185 |
186 TEST_F(MediaInfoLoaderTest, CORSAccessCheckFailed) { | 186 TEST_F(MediaInfoLoaderTest, CORSAccessCheckFailed) { |
187 Initialize(kHttpUrl, WebKit::WebMediaPlayer::CORSModeUseCredentials); | 187 Initialize(kHttpUrl, WebKit::WebMediaPlayer::CORSModeUseCredentials); |
188 Start(); | 188 Start(); |
189 SendResponse(kHttpNotFound, MediaInfoLoader::kFailed); | 189 SendResponse(kHttpNotFound, MediaInfoLoader::kFailed); |
190 EXPECT_FALSE(loader_->DidPassCORSAccessCheck()); | 190 EXPECT_FALSE(loader_->DidPassCORSAccessCheck()); |
191 } | 191 } |
192 | 192 |
193 } // namespace webkit_media | 193 } // namespace content |
OLD | NEW |