OLD | NEW |
---|---|
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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" | 8 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" | 10 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 std::vector<policy::PolicyHeaderIOHelper*> helpers = | 127 std::vector<policy::PolicyHeaderIOHelper*> helpers = |
128 policy_header_service->GetHelpersForTest(); | 128 policy_header_service->GetHelpersForTest(); |
129 for (std::vector<policy::PolicyHeaderIOHelper*>::const_iterator it = | 129 for (std::vector<policy::PolicyHeaderIOHelper*>::const_iterator it = |
130 helpers.begin(); | 130 helpers.begin(); |
131 it != helpers.end(); ++it) { | 131 it != helpers.end(); ++it) { |
132 (*it)->SetServerURLForTest(dm_url_.spec()); | 132 (*it)->SetServerURLForTest(dm_url_.spec()); |
133 (*it)->UpdateHeader(kTestPolicyHeader); | 133 (*it)->UpdateHeader(kTestPolicyHeader); |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 virtual void CleanUpOnMainThread() OVERRIDE { | 137 virtual void TearDownOnMainThread() OVERRIDE { |
138 content::ResourceDispatcherHost::Get()->SetDelegate(NULL); | 138 content::ResourceDispatcherHost::Get()->SetDelegate(NULL); |
139 dispatcher_host_delegate_.reset(); | 139 dispatcher_host_delegate_.reset(); |
140 InProcessBrowserTest::CleanUpOnMainThread(); | 140 InProcessBrowserTest::TearDownOnMainThread(); |
jam
2014/07/14 17:10:05
nit: remove
Andrew T Wilson (Slow)
2014/07/23 12:48:42
Done.
| |
141 } | 141 } |
142 | 142 |
143 protected: | 143 protected: |
144 // The fake URL for DMServer we are using. | 144 // The fake URL for DMServer we are using. |
145 GURL dm_url_; | 145 GURL dm_url_; |
146 scoped_ptr<TestDispatcherHostDelegate> dispatcher_host_delegate_; | 146 scoped_ptr<TestDispatcherHostDelegate> dispatcher_host_delegate_; |
147 | 147 |
148 private: | 148 private: |
149 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegateBrowserTest); | 149 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegateBrowserTest); |
150 }; | 150 }; |
(...skipping 29 matching lines...) Expand all Loading... | |
180 redirect_url += kServerRedirectUrl; | 180 redirect_url += kServerRedirectUrl; |
181 redirect_url += "?"; | 181 redirect_url += "?"; |
182 redirect_url += dm_url_.spec(); | 182 redirect_url += dm_url_.spec(); |
183 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( | 183 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( |
184 redirect_url)); | 184 redirect_url)); |
185 std::string value; | 185 std::string value; |
186 ASSERT_TRUE(dispatcher_host_delegate_->request_headers_.GetHeader( | 186 ASSERT_TRUE(dispatcher_host_delegate_->request_headers_.GetHeader( |
187 policy::kChromePolicyHeader, &value)); | 187 policy::kChromePolicyHeader, &value)); |
188 ASSERT_EQ(kTestPolicyHeader, value); | 188 ASSERT_EQ(kTestPolicyHeader, value); |
189 } | 189 } |
OLD | NEW |