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

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

Issue 1141283002: Replicate whether a frame is in a document or shadow tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 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 "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "media/base/media_log.h" 8 #include "media/base/media_log.h"
9 #include "media/base/mock_filters.h" 9 #include "media/base/mock_filters.h"
10 #include "media/base/test_helpers.h" 10 #include "media/base/test_helpers.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 static const int64 kFarReadPosition = 4000000; 106 static const int64 kFarReadPosition = 4000000;
107 static const int kDataSize = 1024; 107 static const int kDataSize = 1024;
108 108
109 static const char kHttpUrl[] = "http://localhost/foo.webm"; 109 static const char kHttpUrl[] = "http://localhost/foo.webm";
110 static const char kFileUrl[] = "file:///tmp/bar.webm"; 110 static const char kFileUrl[] = "file:///tmp/bar.webm";
111 111
112 class BufferedDataSourceTest : public testing::Test { 112 class BufferedDataSourceTest : public testing::Test {
113 public: 113 public:
114 BufferedDataSourceTest() 114 BufferedDataSourceTest()
115 : view_(WebView::create(NULL)), 115 : view_(WebView::create(NULL)),
116 frame_(WebLocalFrame::create(&client_)), 116 frame_(
117 WebLocalFrame::create(blink::WebTreeScopeType::Document, &client_)),
117 preload_(BufferedDataSource::AUTO) { 118 preload_(BufferedDataSource::AUTO) {
118 view_->setMainFrame(frame_); 119 view_->setMainFrame(frame_);
119 } 120 }
120 121
121 virtual ~BufferedDataSourceTest() { 122 virtual ~BufferedDataSourceTest() {
122 view_->close(); 123 view_->close();
123 frame_->close(); 124 frame_->close();
124 } 125 }
125 126
126 MOCK_METHOD1(OnInitialize, void(bool)); 127 MOCK_METHOD1(OnInitialize, void(bool));
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 // Read a bit from the beginning. 844 // Read a bit from the beginning.
844 ReadAt(0); 845 ReadAt(0);
845 EXPECT_CALL(*this, ReadCallback(kDataSize)); 846 EXPECT_CALL(*this, ReadCallback(kDataSize));
846 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1)); 847 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1));
847 ReceiveData(kDataSize); 848 ReceiveData(kDataSize);
848 849
849 EXPECT_FALSE(active_loader()); 850 EXPECT_FALSE(active_loader());
850 } 851 }
851 852
852 } // namespace media 853 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698