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

Side by Side Diff: content/browser/byte_stream_unittest.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/browser_thread_unittest.cc ('k') | content/browser/device_monitor_linux.h » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/byte_stream.h" 5 #include "content/browser/byte_stream.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bufferp[i]); 78 bufferp[i]);
79 if (static_cast<int>((i + consuming_seed_key_ - 1) % 79 if (static_cast<int>((i + consuming_seed_key_ - 1) %
80 (1 << sizeof(char))) != bufferp[i]) { 80 (1 << sizeof(char))) != bufferp[i]) {
81 return false; 81 return false;
82 } 82 }
83 } 83 }
84 return true; 84 return true;
85 } 85 }
86 86
87 protected: 87 protected:
88 MessageLoop message_loop_; 88 base::MessageLoop message_loop_;
89 89
90 private: 90 private:
91 int producing_seed_key_; 91 int producing_seed_key_;
92 int consuming_seed_key_; 92 int consuming_seed_key_;
93 std::deque<char*> pointer_queue_; 93 std::deque<char*> pointer_queue_;
94 std::deque<size_t> length_queue_; 94 std::deque<size_t> length_queue_;
95 }; 95 };
96 96
97 ByteStreamTest::ByteStreamTest() 97 ByteStreamTest::ByteStreamTest()
98 : producing_seed_key_(0), 98 : producing_seed_key_(0),
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 byte_stream_output->RegisterCallback( 498 byte_stream_output->RegisterCallback(
499 base::Bind(CountCallbacks, &num_callbacks)); 499 base::Bind(CountCallbacks, &num_callbacks));
500 500
501 // Immediately close the stream. 501 // Immediately close the stream.
502 byte_stream_input->Close(DOWNLOAD_INTERRUPT_REASON_NONE); 502 byte_stream_input->Close(DOWNLOAD_INTERRUPT_REASON_NONE);
503 task_runner->RunUntilIdle(); 503 task_runner->RunUntilIdle();
504 EXPECT_EQ(1, num_callbacks); 504 EXPECT_EQ(1, num_callbacks);
505 } 505 }
506 506
507 } // namespace content 507 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_thread_unittest.cc ('k') | content/browser/device_monitor_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698