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

Side by Side Diff: chrome/browser/printing/print_preview_tab_controller_browsertest.cc

Issue 10807047: Create content\public\test\test_utils.h to hold common test classes that are used by unit and brows… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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) 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/printing/print_preview_tab_controller.h" 6 #include "chrome/browser/printing/print_preview_tab_controller.h"
7 #include "chrome/browser/printing/print_view_manager.h" 7 #include "chrome/browser/printing/print_view_manager.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 TabContents* preview_tab = 112 TabContents* preview_tab =
113 tab_controller->GetOrCreatePreviewTab(initiator_tab); 113 tab_controller->GetOrCreatePreviewTab(initiator_tab);
114 114
115 // New print preview tab is created. 115 // New print preview tab is created.
116 EXPECT_EQ(1, browser()->tab_count()); 116 EXPECT_EQ(1, browser()->tab_count());
117 ASSERT_TRUE(preview_tab); 117 ASSERT_TRUE(preview_tab);
118 ASSERT_NE(initiator_tab, preview_tab); 118 ASSERT_NE(initiator_tab, preview_tab);
119 TabDestroyedObserver tab_destroyed_observer(preview_tab->web_contents()); 119 TabDestroyedObserver tab_destroyed_observer(preview_tab->web_contents());
120 120
121 // Reload the initiator tab. 121 // Reload the initiator tab.
122 ui_test_utils::WindowedNotificationObserver notification_observer( 122 content::WindowedNotificationObserver notification_observer(
123 content::NOTIFICATION_LOAD_STOP, 123 content::NOTIFICATION_LOAD_STOP,
124 content::NotificationService::AllSources()); 124 content::NotificationService::AllSources());
125 chrome::Reload(browser(), CURRENT_TAB); 125 chrome::Reload(browser(), CURRENT_TAB);
126 notification_observer.Wait(); 126 notification_observer.Wait();
127 127
128 ASSERT_TRUE(tab_destroyed_observer.tab_destroyed()); 128 ASSERT_TRUE(tab_destroyed_observer.tab_destroyed());
129 129
130 // Get the print preview tab for initiator tab. 130 // Get the print preview tab for initiator tab.
131 initiator_tab->print_view_manager()->PrintPreviewNow(); 131 initiator_tab->print_view_manager()->PrintPreviewNow();
132 TabContents* new_preview_tab = 132 TabContents* new_preview_tab =
133 tab_controller->GetOrCreatePreviewTab(initiator_tab); 133 tab_controller->GetOrCreatePreviewTab(initiator_tab);
134 134
135 EXPECT_EQ(1, browser()->tab_count()); 135 EXPECT_EQ(1, browser()->tab_count());
136 EXPECT_TRUE(new_preview_tab); 136 EXPECT_TRUE(new_preview_tab);
137 } 137 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_dialog_cloud_interative_uitest.cc ('k') | chrome/browser/profiles/profile_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698