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

Side by Side Diff: media/blink/multibuffer_data_source_unittest.cc

Issue 2445993003: Make sure we get at least one progress callback (Closed)
Patch Set: fix tests Created 4 years, 1 month 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 StrictMock<MockBufferedDataSourceHost> host2; 1011 StrictMock<MockBufferedDataSourceHost> host2;
1012 MockMultibufferDataSource source2( 1012 MockMultibufferDataSource source2(
1013 GURL(kHttpUrl), UrlData::CORS_UNSPECIFIED, message_loop_.task_runner(), 1013 GURL(kHttpUrl), UrlData::CORS_UNSPECIFIED, message_loop_.task_runner(),
1014 url_index_, view_->mainFrame()->toWebLocalFrame(), &host2); 1014 url_index_, view_->mainFrame()->toWebLocalFrame(), &host2);
1015 source2.SetPreload(preload_); 1015 source2.SetPreload(preload_);
1016 1016
1017 EXPECT_CALL(*this, OnInitialize(true)); 1017 EXPECT_CALL(*this, OnInitialize(true));
1018 1018
1019 // This call would not be expected if we were not sharing data. 1019 // This call would not be expected if we were not sharing data.
1020 EXPECT_CALL(host2, SetTotalBytes(response_generator_->content_length())); 1020 EXPECT_CALL(host2, SetTotalBytes(response_generator_->content_length()));
1021 EXPECT_CALL(host2, AddBufferedByteRange(0, kDataSize * 2));
1021 source2.Initialize(base::Bind(&MultibufferDataSourceTest::OnInitialize, 1022 source2.Initialize(base::Bind(&MultibufferDataSourceTest::OnInitialize,
1022 base::Unretained(this))); 1023 base::Unretained(this)));
1023 base::RunLoop().RunUntilIdle(); 1024 base::RunLoop().RunUntilIdle();
1024 1025
1025 // Always loading after initialize. 1026 // Always loading after initialize.
1026 EXPECT_EQ(source2.downloading(), true); 1027 EXPECT_EQ(source2.downloading(), true);
1027 1028
1028 Stop(); 1029 Stop();
1029 } 1030 }
1030 1031
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 const std::string etag("\"arglebargle glop-glyf?\""); 1519 const std::string etag("\"arglebargle glop-glyf?\"");
1519 response.setHTTPHeaderField(WebString::fromUTF8("Etag"), 1520 response.setHTTPHeaderField(WebString::fromUTF8("Etag"),
1520 WebString::fromUTF8(etag)); 1521 WebString::fromUTF8(etag));
1521 Respond(response); 1522 Respond(response);
1522 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize)); 1523 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize));
1523 ReceiveData(kDataSize); 1524 ReceiveData(kDataSize);
1524 1525
1525 EXPECT_EQ(url_data()->etag(), etag); 1526 EXPECT_EQ(url_data()->etag(), etag);
1526 } 1527 }
1527 } // namespace media 1528 } // namespace media
OLDNEW
« media/blink/multibuffer_data_source.cc ('K') | « media/blink/multibuffer_data_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698