| 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 "media/base/filters.h" | 5 #include "media/base/filters.h" |
| 6 #include "media/base/mock_callback.h" | 6 #include "media/base/mock_callback.h" |
| 7 #include "media/base/mock_filter_host.h" | 7 #include "media/base/mock_filter_host.h" |
| 8 #include "media/base/mock_filters.h" | 8 #include "media/base/mock_filters.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using ::testing::Return; | 25 using ::testing::Return; |
| 26 using ::testing::SetArgumentPointee; | 26 using ::testing::SetArgumentPointee; |
| 27 using ::testing::StrictMock; | 27 using ::testing::StrictMock; |
| 28 using ::testing::WithArgs; | 28 using ::testing::WithArgs; |
| 29 | 29 |
| 30 using WebKit::WebURLError; | 30 using WebKit::WebURLError; |
| 31 using WebKit::WebURLLoader; | 31 using WebKit::WebURLLoader; |
| 32 using WebKit::WebURLRequest; | 32 using WebKit::WebURLRequest; |
| 33 using WebKit::WebURLResponse; | 33 using WebKit::WebURLResponse; |
| 34 | 34 |
| 35 namespace { | 35 namespace webkit_glue { |
| 36 | 36 |
| 37 const int kDataSize = 1024; | 37 static const int kDataSize = 1024; |
| 38 const char kHttpUrl[] = "http://test"; | 38 static const char kHttpUrl[] = "http://test"; |
| 39 const char kHttpsUrl[] = "https://test"; | 39 static const char kHttpsUrl[] = "https://test"; |
| 40 const char kFileUrl[] = "file://test"; | 40 static const char kFileUrl[] = "file://test"; |
| 41 const char kDataUrl[] = | 41 static const char kDataUrl[] = |
| 42 "data:text/plain;base64,YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoK"; | 42 "data:text/plain;base64,YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoK"; |
| 43 const char kDataUrlDecoded[] = "abcdefghijklmnopqrstuvwxyz"; | 43 static const char kDataUrlDecoded[] = "abcdefghijklmnopqrstuvwxyz"; |
| 44 const char kInvalidUrl[] = "whatever://test"; | 44 static const char kInvalidUrl[] = "whatever://test"; |
| 45 const char kHttpRedirectToSameDomainUrl1[] = "http://test/ing"; | 45 static const char kHttpRedirectToSameDomainUrl1[] = "http://test/ing"; |
| 46 const char kHttpRedirectToSameDomainUrl2[] = "http://test/ing2"; | 46 static const char kHttpRedirectToSameDomainUrl2[] = "http://test/ing2"; |
| 47 const char kHttpRedirectToDifferentDomainUrl1[] = "http://test2"; | 47 static const char kHttpRedirectToDifferentDomainUrl1[] = "http://test2"; |
| 48 const char kHttpRedirectToDifferentDomainUrl2[] = "http://test2/ing"; | 48 static const char kHttpRedirectToDifferentDomainUrl2[] = "http://test2/ing"; |
| 49 | |
| 50 } // namespace | |
| 51 | |
| 52 namespace webkit_glue { | |
| 53 | 49 |
| 54 class SimpleDataSourceTest : public testing::Test { | 50 class SimpleDataSourceTest : public testing::Test { |
| 55 public: | 51 public: |
| 56 SimpleDataSourceTest() { | 52 SimpleDataSourceTest() { |
| 57 for (int i = 0; i < kDataSize; ++i) { | 53 for (int i = 0; i < kDataSize; ++i) { |
| 58 data_[i] = i; | 54 data_[i] = i; |
| 59 } | 55 } |
| 60 } | 56 } |
| 61 | 57 |
| 62 virtual ~SimpleDataSourceTest() { | 58 virtual ~SimpleDataSourceTest() { |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Test redirect to the same domain and then to a different domain. | 258 // Test redirect to the same domain and then to a different domain. |
| 263 InitializeDataSource(kHttpUrl, media::NewExpectedCallback()); | 259 InitializeDataSource(kHttpUrl, media::NewExpectedCallback()); |
| 264 Redirect(kHttpRedirectToSameDomainUrl1); | 260 Redirect(kHttpRedirectToSameDomainUrl1); |
| 265 Redirect(kHttpRedirectToDifferentDomainUrl1); | 261 Redirect(kHttpRedirectToDifferentDomainUrl1); |
| 266 RequestSucceeded(false); | 262 RequestSucceeded(false); |
| 267 EXPECT_FALSE(data_source_->HasSingleOrigin()); | 263 EXPECT_FALSE(data_source_->HasSingleOrigin()); |
| 268 DestroyDataSource(); | 264 DestroyDataSource(); |
| 269 } | 265 } |
| 270 | 266 |
| 271 } // namespace webkit_glue | 267 } // namespace webkit_glue |
| OLD | NEW |