Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: chrome/browser/fast_shutdown_browsertest.cc

Issue 1378123003: Adding SSL ETS Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ets
Patch Set: Rebase. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 23 matching lines...) Expand all
34 DISALLOW_COPY_AND_ASSIGN(FastShutdown); 34 DISALLOW_COPY_AND_ASSIGN(FastShutdown);
35 }; 35 };
36 36
37 // This tests for a previous error where uninstalling an onbeforeunload handler 37 // This tests for a previous error where uninstalling an onbeforeunload handler
38 // would enable fast shutdown even if an onunload handler still existed. 38 // would enable fast shutdown even if an onunload handler still existed.
39 // Flaky on all platforms, http://crbug.com/89173 39 // Flaky on all platforms, http://crbug.com/89173
40 #if !defined(OS_CHROMEOS) // ChromeOS opens tabs instead of windows for popups. 40 #if !defined(OS_CHROMEOS) // ChromeOS opens tabs instead of windows for popups.
41 IN_PROC_BROWSER_TEST_F(FastShutdown, DISABLED_SlowTermination) { 41 IN_PROC_BROWSER_TEST_F(FastShutdown, DISABLED_SlowTermination) {
42 // Need to run these tests on http:// since we only allow cookies on that (and 42 // Need to run these tests on http:// since we only allow cookies on that (and
43 // https obviously). 43 // https obviously).
44 ASSERT_TRUE(test_server()->Start()); 44 ASSERT_TRUE(embedded_test_server()->Start());
45 // This page has an unload handler. 45 // This page has an unload handler.
46 GURL url = test_server()->GetURL("files/fast_shutdown/on_unloader.html"); 46 GURL url = embedded_test_server()->GetURL("/fast_shutdown/on_unloader.html");
47 EXPECT_EQ("", content::GetCookies(browser()->profile(), url)); 47 EXPECT_EQ("", content::GetCookies(browser()->profile(), url));
48 48
49 content::WindowedNotificationObserver window_observer( 49 content::WindowedNotificationObserver window_observer(
50 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 50 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
51 content::NotificationService::AllSources()); 51 content::NotificationService::AllSources());
52 ui_test_utils::NavigateToURLWithDisposition( 52 ui_test_utils::NavigateToURLWithDisposition(
53 browser(), url, NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_NONE); 53 browser(), url, NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_NONE);
54 window_observer.Wait(); 54 window_observer.Wait();
55 55
56 // Close the new window, removing the one and only beforeunload handler. 56 // Close the new window, removing the one and only beforeunload handler.
57 ASSERT_EQ(2u, chrome::GetTotalBrowserCount()); 57 ASSERT_EQ(2u, chrome::GetTotalBrowserCount());
58 chrome::BrowserIterator it; 58 chrome::BrowserIterator it;
59 it.Next(); 59 it.Next();
60 chrome::CloseWindow(*it); 60 chrome::CloseWindow(*it);
61 61
62 // Need to wait for the renderer process to shutdown to ensure that we got the 62 // Need to wait for the renderer process to shutdown to ensure that we got the
63 // set cookies IPC. 63 // set cookies IPC.
64 content::RenderProcessHostWatcher renderer_shutdown_observer( 64 content::RenderProcessHostWatcher renderer_shutdown_observer(
65 browser()->tab_strip_model()->GetActiveWebContents(), 65 browser()->tab_strip_model()->GetActiveWebContents(),
66 content::RenderProcessHostWatcher::WATCH_FOR_HOST_DESTRUCTION); 66 content::RenderProcessHostWatcher::WATCH_FOR_HOST_DESTRUCTION);
67 // Close the tab. This should launch the unload handler, which sets a cookie 67 // Close the tab. This should launch the unload handler, which sets a cookie
68 // that's stored to disk. 68 // that's stored to disk.
69 chrome::CloseTab(browser()); 69 chrome::CloseTab(browser());
70 renderer_shutdown_observer.Wait(); 70 renderer_shutdown_observer.Wait();
71 71
72 EXPECT_EQ("unloaded=ohyeah", content::GetCookies(browser()->profile(), url)); 72 EXPECT_EQ("unloaded=ohyeah", content::GetCookies(browser()->profile(), url));
73 } 73 }
74 #endif 74 #endif
OLDNEW
« no previous file with comments | « chrome/browser/external_extension_browsertest.cc ('k') | chrome/browser/favicon/content_favicon_driver_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698