| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "media/base/filters.h" | 6 #include "media/base/filters.h" |
| 7 #include "media/base/mock_callback.h" | 7 #include "media/base/mock_callback.h" |
| 8 #include "media/base/mock_filter_host.h" | 8 #include "media/base/mock_filter_host.h" |
| 9 #include "media/base/mock_filters.h" | 9 #include "media/base/mock_filters.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 16 #include "webkit/glue/media/simple_data_source.h" | 16 #include "webkit/media/simple_data_source.h" |
| 17 #include "webkit/mocks/mock_webframeclient.h" | 17 #include "webkit/mocks/mock_webframeclient.h" |
| 18 #include "webkit/mocks/mock_weburlloader.h" | 18 #include "webkit/mocks/mock_weburlloader.h" |
| 19 | 19 |
| 20 using ::testing::_; | 20 using ::testing::_; |
| 21 using ::testing::DoAll; | 21 using ::testing::DoAll; |
| 22 using ::testing::InSequence; | 22 using ::testing::InSequence; |
| 23 using ::testing::Invoke; | 23 using ::testing::Invoke; |
| 24 using ::testing::NiceMock; | 24 using ::testing::NiceMock; |
| 25 using ::testing::NotNull; | 25 using ::testing::NotNull; |
| 26 using ::testing::Return; | 26 using ::testing::Return; |
| 27 using ::testing::SetArgumentPointee; | 27 using ::testing::SetArgumentPointee; |
| 28 using ::testing::StrictMock; | 28 using ::testing::StrictMock; |
| 29 using ::testing::WithArgs; | 29 using ::testing::WithArgs; |
| 30 | 30 |
| 31 using WebKit::WebURLError; | 31 using WebKit::WebURLError; |
| 32 using WebKit::WebURLLoader; | 32 using WebKit::WebURLLoader; |
| 33 using WebKit::WebURLRequest; | 33 using WebKit::WebURLRequest; |
| 34 using WebKit::WebURLResponse; | 34 using WebKit::WebURLResponse; |
| 35 using WebKit::WebView; | 35 using WebKit::WebView; |
| 36 | 36 |
| 37 namespace webkit_glue { | 37 using webkit_glue::MockWebFrameClient; |
| 38 using webkit_glue::MockWebURLLoader; |
| 39 |
| 40 namespace webkit_media { |
| 38 | 41 |
| 39 static const int kDataSize = 1024; | 42 static const int kDataSize = 1024; |
| 40 static const char kHttpUrl[] = "http://test"; | 43 static const char kHttpUrl[] = "http://test"; |
| 41 static const char kHttpsUrl[] = "https://test"; | 44 static const char kHttpsUrl[] = "https://test"; |
| 42 static const char kFileUrl[] = "file://test"; | 45 static const char kFileUrl[] = "file://test"; |
| 43 static const char kDataUrl[] = | 46 static const char kDataUrl[] = |
| 44 "data:text/plain;base64,YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoK"; | 47 "data:text/plain;base64,YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoK"; |
| 45 static const char kDataUrlDecoded[] = "abcdefghijklmnopqrstuvwxyz"; | 48 static const char kDataUrlDecoded[] = "abcdefghijklmnopqrstuvwxyz"; |
| 46 static const char kInvalidUrl[] = "whatever://test"; | 49 static const char kInvalidUrl[] = "whatever://test"; |
| 47 static const char kHttpRedirectToSameDomainUrl1[] = "http://test/ing"; | 50 static const char kHttpRedirectToSameDomainUrl1[] = "http://test/ing"; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // Test redirect to the same domain and then to a different domain. | 277 // Test redirect to the same domain and then to a different domain. |
| 275 InitializeDataSource(kHttpUrl, | 278 InitializeDataSource(kHttpUrl, |
| 276 media::NewExpectedStatusCB(media::PIPELINE_OK)); | 279 media::NewExpectedStatusCB(media::PIPELINE_OK)); |
| 277 Redirect(kHttpRedirectToSameDomainUrl1); | 280 Redirect(kHttpRedirectToSameDomainUrl1); |
| 278 Redirect(kHttpRedirectToDifferentDomainUrl1); | 281 Redirect(kHttpRedirectToDifferentDomainUrl1); |
| 279 RequestSucceeded(false); | 282 RequestSucceeded(false); |
| 280 EXPECT_FALSE(data_source_->HasSingleOrigin()); | 283 EXPECT_FALSE(data_source_->HasSingleOrigin()); |
| 281 DestroyDataSource(); | 284 DestroyDataSource(); |
| 282 } | 285 } |
| 283 | 286 |
| 284 } // namespace webkit_glue | 287 } // namespace webkit_media |
| OLD | NEW |