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

Side by Side Diff: content/renderer/media/buffered_data_source_unittest.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve a merge conflict. 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 unified diff | Download patch
OLDNEW
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/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "content/public/common/url_constants.h" 7 #include "content/public/common/url_constants.h"
8 #include "content/renderer/media/buffered_data_source.h" 8 #include "content/renderer/media/buffered_data_source.h"
9 #include "content/renderer/media/test_response_generator.h" 9 #include "content/renderer/media/test_response_generator.h"
10 #include "content/test/mock_webframeclient.h" 10 #include "content/test/mock_webframeclient.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 GURL gurl(url); 125 GURL gurl(url);
126 response_generator_.reset(new TestResponseGenerator(gurl, kFileSize)); 126 response_generator_.reset(new TestResponseGenerator(gurl, kFileSize));
127 127
128 ExpectCreateResourceLoader(); 128 ExpectCreateResourceLoader();
129 EXPECT_CALL(*this, OnInitialize(expected)); 129 EXPECT_CALL(*this, OnInitialize(expected));
130 data_source_->Initialize( 130 data_source_->Initialize(
131 gurl, BufferedResourceLoader::kUnspecified, base::Bind( 131 gurl, BufferedResourceLoader::kUnspecified, base::Bind(
132 &BufferedDataSourceTest::OnInitialize, base::Unretained(this))); 132 &BufferedDataSourceTest::OnInitialize, base::Unretained(this)));
133 message_loop_.RunUntilIdle(); 133 message_loop_.RunUntilIdle();
134 134
135 bool is_http = gurl.SchemeIs(kHttpScheme) || gurl.SchemeIs(kHttpsScheme); 135 bool is_http =
136 gurl.SchemeIs(url::kHttpScheme) || gurl.SchemeIs(url::kHttpsScheme);
136 EXPECT_EQ(data_source_->downloading(), is_http); 137 EXPECT_EQ(data_source_->downloading(), is_http);
137 } 138 }
138 139
139 // Helper to initialize tests with a valid 206 response. 140 // Helper to initialize tests with a valid 206 response.
140 void InitializeWith206Response() { 141 void InitializeWith206Response() {
141 Initialize(kHttpUrl, true); 142 Initialize(kHttpUrl, true);
142 143
143 EXPECT_CALL(host_, SetTotalBytes(response_generator_->content_length())); 144 EXPECT_CALL(host_, SetTotalBytes(response_generator_->content_length()));
144 Respond(response_generator_->Generate206(0)); 145 Respond(response_generator_->Generate206(0));
145 } 146 }
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 InitializeWithFileResponse(); 663 InitializeWithFileResponse();
663 664
664 EXPECT_FALSE(data_source_->downloading()); 665 EXPECT_FALSE(data_source_->downloading());
665 FinishLoading(); 666 FinishLoading();
666 EXPECT_FALSE(data_source_->downloading()); 667 EXPECT_FALSE(data_source_->downloading());
667 668
668 Stop(); 669 Stop();
669 } 670 }
670 671
671 } // namespace content 672 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/buffered_data_source.cc ('k') | content/renderer/media/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698