Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(826)

Unified Diff: content/renderer/media/buffered_data_source_unittest.cc

Issue 306953005: Changing constructor of BufferedDataSource to accept GURL and CORSMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing inline Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/buffered_data_source.cc ('k') | content/renderer/media/webmediaplayer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/buffered_data_source_unittest.cc
diff --git a/content/renderer/media/buffered_data_source_unittest.cc b/content/renderer/media/buffered_data_source_unittest.cc
index 6cf7ef42b6e5114bc4a474c5ea5c46bbdb5447ea..37ff6f8782d1f69a2dda78cbc1283659eababdab 100644
--- a/content/renderer/media/buffered_data_source_unittest.cc
+++ b/content/renderer/media/buffered_data_source_unittest.cc
@@ -48,15 +48,20 @@ class MockBufferedDataSourceHost : public BufferedDataSourceHost {
class MockBufferedDataSource : public BufferedDataSource {
public:
MockBufferedDataSource(
+ const GURL& url,
const scoped_refptr<base::MessageLoopProxy>& message_loop,
WebLocalFrame* frame,
BufferedDataSourceHost* host)
- : BufferedDataSource(message_loop, frame, new media::MediaLog(), host,
+ : BufferedDataSource(url,
+ BufferedResourceLoader::kUnspecified,
+ message_loop,
+ frame,
+ new media::MediaLog(),
+ host,
base::Bind(&MockBufferedDataSource::set_downloading,
base::Unretained(this))),
downloading_(false),
- loading_(false) {
- }
+ loading_(false) {}
virtual ~MockBufferedDataSource() {}
MOCK_METHOD2(CreateResourceLoader, BufferedResourceLoader*(int64, int64));
@@ -107,11 +112,6 @@ class BufferedDataSourceTest : public testing::Test {
BufferedDataSourceTest()
: view_(WebView::create(NULL)), frame_(WebLocalFrame::create(&client_)) {
view_->setMainFrame(frame_);
-
- data_source_.reset(
- new MockBufferedDataSource(message_loop_.message_loop_proxy(),
- view_->mainFrame()->toWebLocalFrame(),
- &host_));
}
virtual ~BufferedDataSourceTest() {
@@ -123,17 +123,20 @@ class BufferedDataSourceTest : public testing::Test {
void Initialize(const char* url, bool expected) {
GURL gurl(url);
- response_generator_.reset(new TestResponseGenerator(gurl, kFileSize));
+ data_source_.reset(
+ new MockBufferedDataSource(gurl,
+ message_loop_.message_loop_proxy(),
+ view_->mainFrame()->toWebLocalFrame(),
+ &host_));
+ response_generator_.reset(new TestResponseGenerator(gurl, kFileSize));
ExpectCreateResourceLoader();
EXPECT_CALL(*this, OnInitialize(expected));
- data_source_->Initialize(
- gurl, BufferedResourceLoader::kUnspecified, base::Bind(
- &BufferedDataSourceTest::OnInitialize, base::Unretained(this)));
+ data_source_->Initialize(base::Bind(&BufferedDataSourceTest::OnInitialize,
+ base::Unretained(this)));
message_loop_.RunUntilIdle();
- bool is_http =
- gurl.SchemeIs(url::kHttpScheme) || gurl.SchemeIs(url::kHttpsScheme);
+ bool is_http = gurl.SchemeIsHTTPOrHTTPS();
EXPECT_EQ(data_source_->downloading(), is_http);
}
« no previous file with comments | « content/renderer/media/buffered_data_source.cc ('k') | content/renderer/media/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698