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

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

Issue 8224023: Don't show URL for pending new navigations initiated by the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflicts. Created 9 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/external_tab_container_win.cc ('k') | chrome/browser/rlz/rlz_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/oom_priority_manager.h" 5 #include "chrome/browser/oom_priority_manager.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 12
13 namespace { 13 namespace {
14 14
15 class OomPriorityManagerTest : public InProcessBrowserTest { 15 class OomPriorityManagerTest : public InProcessBrowserTest {
16 }; 16 };
17 17
18 IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) { 18 IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) {
19 using namespace ui_test_utils; 19 using namespace ui_test_utils;
20 20
21 // Get three tabs open. Load asynchronously to speed up the test. 21 // Get three tabs open. Load asynchronously to speed up the test.
22 WindowedNotificationObserver load1(content::NOTIFICATION_LOAD_STOP, 22 WindowedNotificationObserver load1(content::NOTIFICATION_LOAD_STOP,
23 NotificationService::AllSources()); 23 NotificationService::AllSources());
24 OpenURLParams open1(GURL("chrome://about"), GURL(), 24 OpenURLParams open1(GURL("chrome://about"), GURL(),
25 CURRENT_TAB, content::PAGE_TRANSITION_TYPED); 25 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
26 browser()->OpenURL(open1); 26 browser()->OpenURL(open1);
27 27
28 WindowedNotificationObserver load2(content::NOTIFICATION_LOAD_STOP, 28 WindowedNotificationObserver load2(content::NOTIFICATION_LOAD_STOP,
29 NotificationService::AllSources()); 29 NotificationService::AllSources());
30 OpenURLParams open2(GURL("chrome://credits"), GURL(), 30 OpenURLParams open2(GURL("chrome://credits"), GURL(),
31 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED); 31 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED,
32 false);
32 browser()->OpenURL(open2); 33 browser()->OpenURL(open2);
33 34
34 WindowedNotificationObserver load3(content::NOTIFICATION_LOAD_STOP, 35 WindowedNotificationObserver load3(content::NOTIFICATION_LOAD_STOP,
35 NotificationService::AllSources()); 36 NotificationService::AllSources());
36 OpenURLParams open3(GURL("chrome://terms"), GURL(), 37 OpenURLParams open3(GURL("chrome://terms"), GURL(),
37 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED); 38 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED,
39 false);
38 browser()->OpenURL(open3); 40 browser()->OpenURL(open3);
39 41
40 load1.Wait(); 42 load1.Wait();
41 load2.Wait(); 43 load2.Wait();
42 load3.Wait(); 44 load3.Wait();
43 45
44 EXPECT_EQ(3, browser()->tab_count()); 46 EXPECT_EQ(3, browser()->tab_count());
45 47
46 // Discard a tab. It should kill the first tab, since it was the oldest 48 // Discard a tab. It should kill the first tab, since it was the oldest
47 // and was not selected. 49 // and was not selected.
(...skipping 23 matching lines...) Expand all
71 WindowedNotificationObserver reload1(content::NOTIFICATION_LOAD_STOP, 73 WindowedNotificationObserver reload1(content::NOTIFICATION_LOAD_STOP,
72 NotificationService::AllSources()); 74 NotificationService::AllSources());
73 browser()->SelectNumberedTab(0); 75 browser()->SelectNumberedTab(0);
74 reload1.Wait(); 76 reload1.Wait();
75 EXPECT_FALSE(browser()->IsTabDiscarded(0)); 77 EXPECT_FALSE(browser()->IsTabDiscarded(0));
76 EXPECT_TRUE(browser()->IsTabDiscarded(1)); 78 EXPECT_TRUE(browser()->IsTabDiscarded(1));
77 EXPECT_TRUE(browser()->IsTabDiscarded(2)); 79 EXPECT_TRUE(browser()->IsTabDiscarded(2));
78 } 80 }
79 81
80 } // namespace 82 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/external_tab_container_win.cc ('k') | chrome/browser/rlz/rlz_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698