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

Side by Side Diff: chrome/browser/search/suggestion_source_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
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 "chrome/browser/search/suggestion_source.h" 5 #include "chrome/browser/search/suggestion_source.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 virtual void TearDown() { 115 virtual void TearDown() {
116 source_.reset(); 116 source_.reset();
117 } 117 }
118 118
119 void SaveResponse(base::RefCountedMemory* data) { 119 void SaveResponse(base::RefCountedMemory* data) {
120 response_ = data; 120 response_ = data;
121 } 121 }
122 122
123 MessageLoop message_loop_; 123 base::MessageLoop message_loop_;
124 content::TestBrowserThread ui_thread_; 124 content::TestBrowserThread ui_thread_;
125 content::TestBrowserThread io_thread_; 125 content::TestBrowserThread io_thread_;
126 126
127 content::MockResourceContext resource_context_; 127 content::MockResourceContext resource_context_;
128 scoped_ptr<TestableSuggestionSource> source_; 128 scoped_ptr<TestableSuggestionSource> source_;
129 content::URLDataSource::GotDataCallback callback_; 129 content::URLDataSource::GotDataCallback callback_;
130 scoped_refptr<InstantIOContext> instant_io_context_; 130 scoped_refptr<InstantIOContext> instant_io_context_;
131 scoped_refptr<base::RefCountedMemory> response_; 131 scoped_refptr<base::RefCountedMemory> response_;
132 }; 132 };
133 133
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 EXPECT_FALSE(response_string().empty()); 169 EXPECT_FALSE(response_string().empty());
170 StartDataRequest("loader.js", kInstantRendererPID, 0); 170 StartDataRequest("loader.js", kInstantRendererPID, 0);
171 EXPECT_FALSE(response_string().empty()); 171 EXPECT_FALSE(response_string().empty());
172 EXPECT_NE(std::string::npos, response_string().find(kInstantOrigin)); 172 EXPECT_NE(std::string::npos, response_string().find(kInstantOrigin));
173 StartDataRequest("loader.js", kNonInstantRendererPID, 0); 173 StartDataRequest("loader.js", kNonInstantRendererPID, 0);
174 EXPECT_FALSE(response_string().empty()); 174 EXPECT_FALSE(response_string().empty());
175 EXPECT_NE(std::string::npos, response_string().find(kNonInstantOrigin)); 175 EXPECT_NE(std::string::npos, response_string().find(kNonInstantOrigin));
176 StartDataRequest("loader.js", kInvalidRendererPID, 0); 176 StartDataRequest("loader.js", kInvalidRendererPID, 0);
177 EXPECT_TRUE(response_string().empty()); 177 EXPECT_TRUE(response_string().empty());
178 } 178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698