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

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

Issue 2775133002: M57: Properly clean up in PrintViewManager::RenderFrameCreated(). (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/printing/print_view_manager.h"
6 #include "chrome/browser/printing/print_preview_test.h"
7 #include "chrome/browser/ui/browser_commands.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "content/public/test/test_renderer_host.h"
10
11 namespace printing {
12
13 using PrintViewManagerTest = PrintPreviewTest;
14
15 TEST_F(PrintViewManagerTest, PrintSubFrameAndDestroy) {
16 chrome::NewTab(browser());
17 content::WebContents* web_contents =
18 browser()->tab_strip_model()->GetActiveWebContents();
19 ASSERT_TRUE(web_contents);
20
21 content::RenderFrameHost* sub_frame =
22 content::RenderFrameHostTester::For(web_contents->GetMainFrame())
23 ->AppendChild("child");
24
25 PrintViewManager* print_view_manager =
26 PrintViewManager::FromWebContents(web_contents);
27 ASSERT_TRUE(print_view_manager);
28 EXPECT_FALSE(print_view_manager->print_preview_rfh());
29
30 print_view_manager->PrintPreviewNow(sub_frame, false);
31 EXPECT_TRUE(print_view_manager->print_preview_rfh());
32
33 content::RenderFrameHostTester::For(sub_frame)->Detach();
34 EXPECT_FALSE(print_view_manager->print_preview_rfh());
35 }
36
37 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698