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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc

Issue 11647017: Rename platform-independent ConstrainedWindow types to WebContentsModalDialog types (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stage changes to preserve history Created 8 years 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/ui/webui/constrained_web_dialog_ui_browsertest.cc ('k') | no next file » | 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) 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/printing/print_preview_tab_controller.h" 9 #include "chrome/browser/printing/print_preview_tab_controller.h"
10 #include "chrome/browser/printing/print_preview_test.h" 10 #include "chrome/browser/printing/print_preview_test.h"
(...skipping 20 matching lines...) Expand all
31 base::RefCountedBytes* CreateTestData() { 31 base::RefCountedBytes* CreateTestData() {
32 const unsigned char blob1[] = 32 const unsigned char blob1[] =
33 "12346102356120394751634516591348710478123649165419234519234512349134"; 33 "12346102356120394751634516591348710478123649165419234519234512349134";
34 std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1)); 34 std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1));
35 return new base::RefCountedBytes(preview_data); 35 return new base::RefCountedBytes(preview_data);
36 } 36 }
37 37
38 size_t GetConstrainedWindowCount(WebContents* tab) { 38 size_t GetConstrainedWindowCount(WebContents* tab) {
39 ConstrainedWindowTabHelper* constrained_window_tab_helper = 39 ConstrainedWindowTabHelper* constrained_window_tab_helper =
40 ConstrainedWindowTabHelper::FromWebContents(tab); 40 ConstrainedWindowTabHelper::FromWebContents(tab);
41 return constrained_window_tab_helper->constrained_window_count(); 41 return constrained_window_tab_helper->dialog_count();
42 } 42 }
43 43
44 } // namespace 44 } // namespace
45 45
46 class PrintPreviewUIUnitTest : public PrintPreviewTest { 46 class PrintPreviewUIUnitTest : public PrintPreviewTest {
47 public: 47 public:
48 PrintPreviewUIUnitTest(); 48 PrintPreviewUIUnitTest();
49 virtual ~PrintPreviewUIUnitTest(); 49 virtual ~PrintPreviewUIUnitTest();
50 50
51 protected: 51 protected:
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 PrintPreviewUI* preview_ui = static_cast<PrintPreviewUI*>( 264 PrintPreviewUI* preview_ui = static_cast<PrintPreviewUI*>(
265 preview_tab->GetWebUI()->GetController()); 265 preview_tab->GetWebUI()->GetController());
266 ASSERT_TRUE(preview_ui != NULL); 266 ASSERT_TRUE(preview_ui != NULL);
267 267
268 preview_ui->OnPrintPreviewTabClosed(); 268 preview_ui->OnPrintPreviewTabClosed();
269 269
270 EXPECT_EQ(2, browser()->tab_count()); 270 EXPECT_EQ(2, browser()->tab_count());
271 EXPECT_EQ(0U, GetConstrainedWindowCount(initiator_tab)); 271 EXPECT_EQ(0U, GetConstrainedWindowCount(initiator_tab));
272 EXPECT_EQ(1, initiator_tester->GetNumberOfFocusCalls()); 272 EXPECT_EQ(1, initiator_tester->GetNumberOfFocusCalls());
273 } 273 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698