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

Side by Side Diff: content/browser/loader/resource_loader_unittest.cc

Issue 624073002: Add is_main_frame and parent_is_main_frame to ResourceRequestInfo::AllocateForTesting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile extensions_unittests Created 6 years, 1 month 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
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 "content/browser/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 net::DEFAULT_PRIORITY, 316 net::DEFAULT_PRIORITY,
317 NULL /* delegate */, 317 NULL /* delegate */,
318 NULL /* cookie_store */)); 318 NULL /* cookie_store */));
319 raw_ptr_to_request_ = request.get(); 319 raw_ptr_to_request_ = request.get();
320 ResourceRequestInfo::AllocateForTesting(request.get(), 320 ResourceRequestInfo::AllocateForTesting(request.get(),
321 RESOURCE_TYPE_MAIN_FRAME, 321 RESOURCE_TYPE_MAIN_FRAME,
322 &resource_context_, 322 &resource_context_,
323 kRenderProcessId, 323 kRenderProcessId,
324 kRenderViewId, 324 kRenderViewId,
325 MSG_ROUTING_NONE, 325 MSG_ROUTING_NONE,
326 false); 326 true, // is_main_frame
327 false, // parent_is_main_frame
328 false); // is_async
327 scoped_ptr<ResourceHandlerStub> resource_handler( 329 scoped_ptr<ResourceHandlerStub> resource_handler(
328 new ResourceHandlerStub(request.get())); 330 new ResourceHandlerStub(request.get()));
329 raw_ptr_resource_handler_ = resource_handler.get(); 331 raw_ptr_resource_handler_ = resource_handler.get();
330 loader_.reset(new ResourceLoader( 332 loader_.reset(new ResourceLoader(
331 request.Pass(), 333 request.Pass(),
332 WrapResourceHandler(resource_handler.Pass(), raw_ptr_to_request_), 334 WrapResourceHandler(resource_handler.Pass(), raw_ptr_to_request_),
333 this)); 335 this));
334 } 336 }
335 337
336 // ResourceLoaderDelegate: 338 // ResourceLoaderDelegate:
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); 720 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents));
719 EXPECT_EQ(test_data(), contents); 721 EXPECT_EQ(test_data(), contents);
720 722
721 // Release the loader. The file should be gone now. 723 // Release the loader. The file should be gone now.
722 ReleaseLoader(); 724 ReleaseLoader();
723 base::RunLoop().RunUntilIdle(); 725 base::RunLoop().RunUntilIdle();
724 EXPECT_FALSE(base::PathExists(temp_path())); 726 EXPECT_FALSE(base::PathExists(temp_path()));
725 } 727 }
726 728
727 } // namespace content 729 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698