OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/task.h" | 6 #include "base/task.h" |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
15 #include "net/base/cookie_store.h" | 15 #include "net/base/cookie_store.h" |
16 #include "net/base/mock_host_resolver.h" | 16 #include "net/base/mock_host_resolver.h" |
17 #include "net/test/test_server.h" | 17 #include "net/test/test_server.h" |
18 #include "net/url_request/url_request_context.h" | 18 #include "net/url_request/url_request_context.h" |
19 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
20 | 20 |
| 21 using content::BrowserThread; |
| 22 |
21 namespace { | 23 namespace { |
22 | 24 |
23 class GetCookiesTask : public Task { | 25 class GetCookiesTask : public Task { |
24 public: | 26 public: |
25 GetCookiesTask(const GURL& url, | 27 GetCookiesTask(const GURL& url, |
26 net::URLRequestContextGetter* context_getter, | 28 net::URLRequestContextGetter* context_getter, |
27 base::WaitableEvent* event, | 29 base::WaitableEvent* event, |
28 std::string* cookies) | 30 std::string* cookies) |
29 : url_(url), | 31 : url_(url), |
30 context_getter_(context_getter), | 32 context_getter_(context_getter), |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 125 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
124 | 126 |
125 ui_test_utils::NavigateToURL(browser(), | 127 ui_test_utils::NavigateToURL(browser(), |
126 GURL(url.spec() + redirected_url.spec())); | 128 GURL(url.spec() + redirected_url.spec())); |
127 | 129 |
128 cookie = GetCookies(redirected_url); | 130 cookie = GetCookies(redirected_url); |
129 EXPECT_EQ("cookie2", cookie); | 131 EXPECT_EQ("cookie2", cookie); |
130 } | 132 } |
131 | 133 |
132 } // namespace | 134 } // namespace |
OLD | NEW |