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

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

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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
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, PageTransition::TYPED); 25 CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
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, PageTransition::TYPED); 31 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED);
32 browser()->OpenURL(open2); 32 browser()->OpenURL(open2);
33 33
34 WindowedNotificationObserver load3(content::NOTIFICATION_LOAD_STOP, 34 WindowedNotificationObserver load3(content::NOTIFICATION_LOAD_STOP,
35 NotificationService::AllSources()); 35 NotificationService::AllSources());
36 OpenURLParams open3(GURL("chrome://terms"), GURL(), 36 OpenURLParams open3(GURL("chrome://terms"), GURL(),
37 NEW_FOREGROUND_TAB, PageTransition::TYPED); 37 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED);
38 browser()->OpenURL(open3); 38 browser()->OpenURL(open3);
39 39
40 load1.Wait(); 40 load1.Wait();
41 load2.Wait(); 41 load2.Wait();
42 load3.Wait(); 42 load3.Wait();
43 43
44 EXPECT_EQ(3, browser()->tab_count()); 44 EXPECT_EQ(3, browser()->tab_count());
45 45
46 // Discard a tab. It should kill the first tab, since it was the oldest 46 // Discard a tab. It should kill the first tab, since it was the oldest
47 // and was not selected. 47 // and was not selected.
(...skipping 23 matching lines...) Expand all
71 WindowedNotificationObserver reload1(content::NOTIFICATION_LOAD_STOP, 71 WindowedNotificationObserver reload1(content::NOTIFICATION_LOAD_STOP,
72 NotificationService::AllSources()); 72 NotificationService::AllSources());
73 browser()->SelectNumberedTab(0); 73 browser()->SelectNumberedTab(0);
74 reload1.Wait(); 74 reload1.Wait();
75 EXPECT_FALSE(browser()->IsTabDiscarded(0)); 75 EXPECT_FALSE(browser()->IsTabDiscarded(0));
76 EXPECT_TRUE(browser()->IsTabDiscarded(1)); 76 EXPECT_TRUE(browser()->IsTabDiscarded(1));
77 EXPECT_TRUE(browser()->IsTabDiscarded(2)); 77 EXPECT_TRUE(browser()->IsTabDiscarded(2));
78 } 78 }
79 79
80 } // namespace 80 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/net/gaia/gaia_oauth_fetcher.cc ('k') | chrome/browser/pdf_unsupported_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698