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

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

Issue 16290004: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « chrome/browser/search/iframe_source.cc ('k') | chrome/browser/search/instant_io_context.cc » ('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 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/iframe_source.h" 5 #include "chrome/browser/search/iframe_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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 : message_loop_(base::MessageLoop::TYPE_IO), 76 : message_loop_(base::MessageLoop::TYPE_IO),
77 ui_thread_(content::BrowserThread::UI, &message_loop_), 77 ui_thread_(content::BrowserThread::UI, &message_loop_),
78 io_thread_(content::BrowserThread::IO, &message_loop_), 78 io_thread_(content::BrowserThread::IO, &message_loop_),
79 instant_io_context_(NULL), 79 instant_io_context_(NULL),
80 response_(NULL) { 80 response_(NULL) {
81 } 81 }
82 82
83 TestIframeSource* source() { return source_.get(); } 83 TestIframeSource* source() { return source_.get(); }
84 84
85 std::string response_string() { 85 std::string response_string() {
86 if (response_) { 86 if (response_.get()) {
87 return std::string(reinterpret_cast<const char*>(response_->front()), 87 return std::string(reinterpret_cast<const char*>(response_->front()),
88 response_->size()); 88 response_->size());
89 } 89 }
90 return ""; 90 return "";
91 } 91 }
92 92
93 net::URLRequest* MockRequest( 93 net::URLRequest* MockRequest(
94 const std::string& url, 94 const std::string& url,
95 bool allocate_info, 95 bool allocate_info,
96 int render_process_id, 96 int render_process_id,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 TEST_F(IframeSourceTest, SendJSWithOrigin) { 190 TEST_F(IframeSourceTest, SendJSWithOrigin) {
191 SendJSWithOrigin(IDR_OMNIBOX_RESULT_LOADER_JS, kInstantRendererPID, 0); 191 SendJSWithOrigin(IDR_OMNIBOX_RESULT_LOADER_JS, kInstantRendererPID, 0);
192 EXPECT_FALSE(response_string().empty()); 192 EXPECT_FALSE(response_string().empty());
193 EXPECT_NE(std::string::npos, response_string().find(kInstantOrigin)); 193 EXPECT_NE(std::string::npos, response_string().find(kInstantOrigin));
194 SendJSWithOrigin(IDR_OMNIBOX_RESULT_LOADER_JS, kNonInstantRendererPID, 0); 194 SendJSWithOrigin(IDR_OMNIBOX_RESULT_LOADER_JS, kNonInstantRendererPID, 0);
195 EXPECT_FALSE(response_string().empty()); 195 EXPECT_FALSE(response_string().empty());
196 EXPECT_NE(std::string::npos, response_string().find(kNonInstantOrigin)); 196 EXPECT_NE(std::string::npos, response_string().find(kNonInstantOrigin));
197 SendJSWithOrigin(IDR_OMNIBOX_RESULT_LOADER_JS, kInvalidRendererPID, 0); 197 SendJSWithOrigin(IDR_OMNIBOX_RESULT_LOADER_JS, kInvalidRendererPID, 0);
198 EXPECT_TRUE(response_string().empty()); 198 EXPECT_TRUE(response_string().empty());
199 } 199 }
OLDNEW
« no previous file with comments | « chrome/browser/search/iframe_source.cc ('k') | chrome/browser/search/instant_io_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698