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

Side by Side Diff: content/browser/streams/stream_unittest.cc

Issue 759823003: Introduce StreamRegistry::NotifyReaderAbortedBeforeRegistration() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « content/browser/streams/stream_registry.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/streams/stream_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698