OLD | NEW |
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 Loading... |
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 |
OLD | NEW |