| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/content_settings/cookie_settings.h" | 8 #include "chrome/browser/content_settings/cookie_settings.h" |
| 9 #include "chrome/browser/net/url_fixer_upper.h" | 9 #include "chrome/browser/net/url_fixer_upper.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Disable cookies. | 31 // Disable cookies. |
| 32 CookieSettings::Factory::GetForProfile(browser()->profile())-> | 32 CookieSettings::Factory::GetForProfile(browser()->profile())-> |
| 33 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); | 33 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); |
| 34 | 34 |
| 35 // Load a page with cookies. | 35 // Load a page with cookies. |
| 36 ui_test_utils::NavigateToURL( | 36 ui_test_utils::NavigateToURL( |
| 37 browser(), test_server()->GetURL("files/cookie1.html")); | 37 browser(), test_server()->GetURL("files/cookie1.html")); |
| 38 | 38 |
| 39 // Click on the info link twice. | 39 // Click on the info link twice. |
| 40 TabContents* tab_contents = chrome::GetActiveTabContents(browser()); | 40 TabContents* tab_contents = chrome::GetActiveTabContents(browser()); |
| 41 browser::ShowCollectedCookiesDialog(tab_contents); | 41 chrome::ShowCollectedCookiesDialog(tab_contents); |
| 42 browser::ShowCollectedCookiesDialog(tab_contents); | 42 chrome::ShowCollectedCookiesDialog(tab_contents); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // If this crashes on Windows, use http://crbug.com/79331 | 45 // If this crashes on Windows, use http://crbug.com/79331 |
| 46 IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, NavigateAway) { | 46 IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, NavigateAway) { |
| 47 | 47 |
| 48 // Disable cookies. | 48 // Disable cookies. |
| 49 CookieSettings::Factory::GetForProfile(browser()->profile())-> | 49 CookieSettings::Factory::GetForProfile(browser()->profile())-> |
| 50 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); | 50 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); |
| 51 | 51 |
| 52 // Load a page with cookies. | 52 // Load a page with cookies. |
| 53 ui_test_utils::NavigateToURL( | 53 ui_test_utils::NavigateToURL( |
| 54 browser(), test_server()->GetURL("files/cookie1.html")); | 54 browser(), test_server()->GetURL("files/cookie1.html")); |
| 55 | 55 |
| 56 // Click on the info link. | 56 // Click on the info link. |
| 57 TabContents* tab_contents = chrome::GetActiveTabContents(browser()); | 57 TabContents* tab_contents = chrome::GetActiveTabContents(browser()); |
| 58 browser::ShowCollectedCookiesDialog(tab_contents); | 58 chrome::ShowCollectedCookiesDialog(tab_contents); |
| 59 | 59 |
| 60 // Navigate to another page. | 60 // Navigate to another page. |
| 61 ui_test_utils::NavigateToURL( | 61 ui_test_utils::NavigateToURL( |
| 62 browser(), test_server()->GetURL("files/cookie2.html")); | 62 browser(), test_server()->GetURL("files/cookie2.html")); |
| 63 } | 63 } |
| OLD | NEW |