| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 url_format.SetAsString(media::MediaFormat::kMimeType, | 601 url_format.SetAsString(media::MediaFormat::kMimeType, |
| 602 media::mime_type::kURL); | 602 media::mime_type::kURL); |
| 603 url_format.SetAsString(media::MediaFormat::kURL, url); | 603 url_format.SetAsString(media::MediaFormat::kURL, url); |
| 604 data_source_ = new MockBufferedDataSource(MessageLoop::current(), | 604 data_source_ = new MockBufferedDataSource(MessageLoop::current(), |
| 605 bridge_factory_.get()); | 605 bridge_factory_.get()); |
| 606 CHECK(data_source_); | 606 CHECK(data_source_); |
| 607 | 607 |
| 608 // There is no need to provide a message loop to data source. | 608 // There is no need to provide a message loop to data source. |
| 609 data_source_->set_host(&host_); | 609 data_source_->set_host(&host_); |
| 610 | 610 |
| 611 scoped_refptr<NiceMock<MockBufferedResourceLoader> > first_loader = | 611 scoped_refptr<NiceMock<MockBufferedResourceLoader> > first_loader( |
| 612 new NiceMock<MockBufferedResourceLoader>(); | 612 new NiceMock<MockBufferedResourceLoader>()); |
| 613 | 613 |
| 614 // Creates the mock loader to be injected. | 614 // Creates the mock loader to be injected. |
| 615 loader_ = first_loader; | 615 loader_ = first_loader; |
| 616 | 616 |
| 617 bool initialized_ok = (error == net::OK); | 617 bool initialized_ok = (error == net::OK); |
| 618 bool loaded = networkState == LOADED; | 618 bool loaded = networkState == LOADED; |
| 619 { | 619 { |
| 620 InSequence s; | 620 InSequence s; |
| 621 ExpectCreateAndStartResourceLoader(error); | 621 ExpectCreateAndStartResourceLoader(error); |
| 622 | 622 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 StopDataSource(); | 977 StopDataSource(); |
| 978 } | 978 } |
| 979 | 979 |
| 980 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { | 980 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { |
| 981 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); | 981 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); |
| 982 ReadDataSourceTimesOut(20, 10); | 982 ReadDataSourceTimesOut(20, 10); |
| 983 StopDataSource(); | 983 StopDataSource(); |
| 984 } | 984 } |
| 985 | 985 |
| 986 } // namespace webkit_glue | 986 } // namespace webkit_glue |
| OLD | NEW |