OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/test/test_simple_task_runner.h" | 6 #include "base/test/test_simple_task_runner.h" |
7 #include "content/browser/streams/stream.h" | 7 #include "content/browser/streams/stream.h" |
8 #include "content/browser/streams/stream_read_observer.h" | 8 #include "content/browser/streams/stream_read_observer.h" |
9 #include "content/browser/streams/stream_register_observer.h" | 9 #include "content/browser/streams/stream_register_observer.h" |
10 #include "content/browser/streams/stream_registry.h" | 10 #include "content/browser/streams/stream_registry.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 | 363 |
364 stream->Flush(); | 364 stream->Flush(); |
365 | 365 |
366 // Run loop to make |reader| consume the data. | 366 // Run loop to make |reader| consume the data. |
367 base::MessageLoop::current()->RunUntilIdle(); | 367 base::MessageLoop::current()->RunUntilIdle(); |
368 EXPECT_EQ(kBufferSize, reader.buffer()->capacity()); | 368 EXPECT_EQ(kBufferSize, reader.buffer()->capacity()); |
369 | 369 |
370 EXPECT_EQ(stream.get(), registry_->GetStream(url).get()); | 370 EXPECT_EQ(stream.get(), registry_->GetStream(url).get()); |
371 } | 371 } |
372 | 372 |
373 TEST_F(StreamTest, ReaderAbortedBeforeRegistration) { | |
374 TestStreamWriter writer; | |
375 | |
376 GURL url("blob://stream"); | |
377 registry_->NotifyReaderAbortedBeforeRegistration(url); | |
378 scoped_refptr<Stream> stream1(new Stream(registry_.get(), &writer, url)); | |
379 ASSERT_EQ(nullptr, registry_->GetStream(url).get()); | |
tyoshino (SeeGerritForStatus)
2014/11/26 09:29:12
please also update NULLs in this file to nullptr
horo
2014/11/26 09:54:10
Done.
| |
380 } | |
381 | |
373 } // namespace content | 382 } // namespace content |
OLD | NEW |