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

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

Issue 425653002: content: ResourceType cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 4 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 (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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file.h" 8 #include "base/files/file.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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 const int kRenderProcessId = 1; 312 const int kRenderProcessId = 1;
313 const int kRenderViewId = 2; 313 const int kRenderViewId = 2;
314 314
315 scoped_ptr<net::URLRequest> request( 315 scoped_ptr<net::URLRequest> request(
316 new net::URLRequest(test_url(), 316 new net::URLRequest(test_url(),
317 net::DEFAULT_PRIORITY, 317 net::DEFAULT_PRIORITY,
318 NULL, 318 NULL,
319 resource_context_.GetRequestContext())); 319 resource_context_.GetRequestContext()));
320 raw_ptr_to_request_ = request.get(); 320 raw_ptr_to_request_ = request.get();
321 ResourceRequestInfo::AllocateForTesting(request.get(), 321 ResourceRequestInfo::AllocateForTesting(request.get(),
322 ResourceType::MAIN_FRAME, 322 RESOURCE_TYPE_MAIN_FRAME,
323 &resource_context_, 323 &resource_context_,
324 kRenderProcessId, 324 kRenderProcessId,
325 kRenderViewId, 325 kRenderViewId,
326 MSG_ROUTING_NONE, 326 MSG_ROUTING_NONE,
327 false); 327 false);
328 scoped_ptr<ResourceHandlerStub> resource_handler( 328 scoped_ptr<ResourceHandlerStub> resource_handler(
329 new ResourceHandlerStub(request.get())); 329 new ResourceHandlerStub(request.get()));
330 raw_ptr_resource_handler_ = resource_handler.get(); 330 raw_ptr_resource_handler_ = resource_handler.get();
331 loader_.reset(new ResourceLoader( 331 loader_.reset(new ResourceLoader(
332 request.Pass(), 332 request.Pass(),
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); 721 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents));
722 EXPECT_EQ(test_data(), contents); 722 EXPECT_EQ(test_data(), contents);
723 723
724 // Release the loader. The file should be gone now. 724 // Release the loader. The file should be gone now.
725 ReleaseLoader(); 725 ReleaseLoader();
726 base::RunLoop().RunUntilIdle(); 726 base::RunLoop().RunUntilIdle();
727 EXPECT_FALSE(base::PathExists(temp_path())); 727 EXPECT_FALSE(base::PathExists(temp_path()));
728 } 728 }
729 729
730 } // namespace content 730 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_loader.cc ('k') | content/browser/loader/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698