| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |