| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 #include "chrome/browser/net/url_request_context_getter.h" | 6 #include "chrome/browser/net/url_request_context_getter.h" |
| 7 #include "chrome/browser/profile.h" | 7 #include "chrome/browser/profile.h" |
| 8 #include "chrome/common/pref_names.h" | 8 #include "chrome/common/pref_names.h" |
| 9 #include "chrome/common/pref_service.h" | 9 #include "chrome/common/pref_service.h" |
| 10 #include "chrome/test/in_process_browser_test.h" | 10 #include "chrome/test/in_process_browser_test.h" |
| 11 #include "chrome/test/ui_test_utils.h" | 11 #include "chrome/test/ui_test_utils.h" |
| 12 #include "net/base/mock_host_resolver.h" |
| 12 | 13 |
| 13 class CookiePolicyBrowserTest : public InProcessBrowserTest { | 14 class CookiePolicyBrowserTest : public InProcessBrowserTest { |
| 14 public: | 15 public: |
| 15 CookiePolicyBrowserTest() {} | 16 CookiePolicyBrowserTest() {} |
| 16 | 17 |
| 17 private: | 18 private: |
| 18 DISALLOW_COPY_AND_ASSIGN(CookiePolicyBrowserTest); | 19 DISALLOW_COPY_AND_ASSIGN(CookiePolicyBrowserTest); |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 // Visits a page that sets a first-party cookie. | 22 // Visits a page that sets a first-party cookie. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ASSERT_EQ("", cookie); | 79 ASSERT_EQ("", cookie); |
| 79 | 80 |
| 80 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 81 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
| 81 | 82 |
| 82 ui_test_utils::NavigateToURL(browser(), | 83 ui_test_utils::NavigateToURL(browser(), |
| 83 GURL(url.spec() + redirected_url.spec())); | 84 GURL(url.spec() + redirected_url.spec())); |
| 84 | 85 |
| 85 cookie = cookie_store->GetCookies(redirected_url); | 86 cookie = cookie_store->GetCookies(redirected_url); |
| 86 EXPECT_EQ("cookie2", cookie); | 87 EXPECT_EQ("cookie2", cookie); |
| 87 } | 88 } |
| OLD | NEW |