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

Side by Side Diff: content/browser/webui/url_data_manager_backend_unittest.cc

Issue 1575763002: Make `content` target build without unused data members on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_disallow_copy_assign_linux_only
Patch Set: fix unit test Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/browser/webui/url_data_manager_backend.h" 8 #include "content/browser/webui/url_data_manager_backend.h"
9 #include "content/public/test/mock_resource_context.h" 9 #include "content/public/test/mock_resource_context.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 27 matching lines...) Expand all
38 private: 38 private:
39 DISALLOW_COPY_AND_ASSIGN(CancelAfterFirstReadURLRequestDelegate); 39 DISALLOW_COPY_AND_ASSIGN(CancelAfterFirstReadURLRequestDelegate);
40 }; 40 };
41 41
42 class UrlDataManagerBackendTest : public testing::Test { 42 class UrlDataManagerBackendTest : public testing::Test {
43 public: 43 public:
44 UrlDataManagerBackendTest() { 44 UrlDataManagerBackendTest() {
45 // URLRequestJobFactory takes ownership of the passed in ProtocolHandler. 45 // URLRequestJobFactory takes ownership of the passed in ProtocolHandler.
46 url_request_job_factory_.SetProtocolHandler( 46 url_request_job_factory_.SetProtocolHandler(
47 "chrome", URLDataManagerBackend::CreateProtocolHandler( 47 "chrome", URLDataManagerBackend::CreateProtocolHandler(
48 &resource_context_, false, nullptr, nullptr)); 48 &resource_context_, false, nullptr));
49 url_request_context_.set_job_factory(&url_request_job_factory_); 49 url_request_context_.set_job_factory(&url_request_job_factory_);
50 } 50 }
51 51
52 scoped_ptr<net::URLRequest> CreateRequest(net::URLRequest::Delegate* delegate, 52 scoped_ptr<net::URLRequest> CreateRequest(net::URLRequest::Delegate* delegate,
53 const char* origin) { 53 const char* origin) {
54 scoped_ptr<net::URLRequest> request = url_request_context_.CreateRequest( 54 scoped_ptr<net::URLRequest> request = url_request_context_.CreateRequest(
55 GURL("chrome://resources/polymer/v1_0/polymer/polymer-extracted.js"), 55 GURL("chrome://resources/polymer/v1_0/polymer/polymer-extracted.js"),
56 net::HIGHEST, delegate); 56 net::HIGHEST, delegate);
57 request->SetExtraRequestHeaderByName("Origin", origin, true); 57 request->SetExtraRequestHeaderByName("Origin", origin, true);
58 return request; 58 return request;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 scoped_ptr<net::URLRequest> error_request = 124 scoped_ptr<net::URLRequest> error_request =
125 url_request_context_.CreateRequest( 125 url_request_context_.CreateRequest(
126 GURL("chrome://network-error/-123456789"), net::HIGHEST, &delegate_); 126 GURL("chrome://network-error/-123456789"), net::HIGHEST, &delegate_);
127 error_request->Start(); 127 error_request->Start();
128 base::RunLoop().Run(); 128 base::RunLoop().Run();
129 EXPECT_EQ(net::URLRequestStatus::FAILED, error_request->status().status()); 129 EXPECT_EQ(net::URLRequestStatus::FAILED, error_request->status().status());
130 EXPECT_EQ(net::ERR_INVALID_URL, error_request->status().error()); 130 EXPECT_EQ(net::ERR_INVALID_URL, error_request->status().error());
131 } 131 }
132 132
133 } // namespace content 133 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698