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

Side by Side Diff: headless/lib/headless_browser_browsertest.cc

Issue 2890133002: check whether the printing render frame host has been initialised before accepting a message in the… (Closed)
Patch Set: check whether the printing render frame host has been initialised before accepting a message in the… Created 3 years, 7 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 | « headless/lib/browser/headless_print_manager.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 EXPECT_NE(nullptr, target); 888 EXPECT_NE(nullptr, target);
889 889
890 TraceHelper helper(this, target); 890 TraceHelper helper(this, target);
891 RunAsynchronousTest(); 891 RunAsynchronousTest();
892 892
893 std::unique_ptr<base::ListValue> tracing_data = helper.TakeTracingData(); 893 std::unique_ptr<base::ListValue> tracing_data = helper.TakeTracingData();
894 EXPECT_TRUE(tracing_data); 894 EXPECT_TRUE(tracing_data);
895 EXPECT_LT(0u, tracing_data->GetSize()); 895 EXPECT_LT(0u, tracing_data->GetSize());
896 } 896 }
897 897
898 IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, WindowPrint) {
899 EXPECT_TRUE(embedded_test_server()->Start());
900
901 HeadlessBrowserContext* browser_context =
902 browser()->CreateBrowserContextBuilder().Build();
903
904 HeadlessWebContents* web_contents =
905 browser_context->CreateWebContentsBuilder()
906 .SetInitialURL(embedded_test_server()->GetURL("/hello.html"))
907 .Build();
908 EXPECT_TRUE(WaitForLoad(web_contents));
909 EXPECT_FALSE(
910 EvaluateScript(web_contents, "window.print()")->HasExceptionDetails());
911 }
912
898 } // namespace headless 913 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_print_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698