Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / collected_cookies_browsertest.cc
blobe662b388ccc3e0af454bde239cc201d7d42c8ca1
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
3 // found in the LICENSE file.
5 #include <string>
7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/content_settings/cookie_settings.h"
9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_dialogs.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/common/net/url_fixer_upper.h"
13 #include "chrome/common/url_constants.h"
14 #include "chrome/test/base/in_process_browser_test.h"
15 #include "chrome/test/base/ui_test_utils.h"
16 #include "net/test/embedded_test_server/embedded_test_server.h"
18 typedef InProcessBrowserTest CollectedCookiesTest;
20 // If this crashes on Windows, use http://crbug.com/79331
21 IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, DoubleDisplay) {
22 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
24 // Disable cookies.
25 CookieSettings::Factory::GetForProfile(browser()->profile())->
26 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK);
28 // Load a page with cookies.
29 ui_test_utils::NavigateToURL(
30 browser(), embedded_test_server()->GetURL("/cookie1.html"));
32 // Click on the info link twice.
33 content::WebContents* web_contents =
34 browser()->tab_strip_model()->GetActiveWebContents();
35 chrome::ShowCollectedCookiesDialog(web_contents);
36 chrome::ShowCollectedCookiesDialog(web_contents);
39 // If this crashes on Windows, use http://crbug.com/79331
40 IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, NavigateAway) {
41 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
43 // Disable cookies.
44 CookieSettings::Factory::GetForProfile(browser()->profile())->
45 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK);
47 // Load a page with cookies.
48 ui_test_utils::NavigateToURL(
49 browser(), embedded_test_server()->GetURL("/cookie1.html"));
51 // Click on the info link.
52 content::WebContents* web_contents =
53 browser()->tab_strip_model()->GetActiveWebContents();
54 chrome::ShowCollectedCookiesDialog(web_contents);
56 // Navigate to another page.
57 ui_test_utils::NavigateToURL(
58 browser(), embedded_test_server()->GetURL("/cookie2.html"));