| 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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "content/public/test/browser_test.h" | 9 #include "content/public/test/browser_test.h" |
| 10 #include "headless/public/domains/page.h" | 10 #include "headless/public/domains/page.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 EXPECT_TRUE(WaitForLoad(web_contents)); | 152 EXPECT_TRUE(WaitForLoad(web_contents)); |
| 153 | 153 |
| 154 std::string inner_html; | 154 std::string inner_html; |
| 155 EXPECT_TRUE(EvaluateScript(web_contents, "document.body.innerHTML") | 155 EXPECT_TRUE(EvaluateScript(web_contents, "document.body.innerHTML") |
| 156 ->GetResult() | 156 ->GetResult() |
| 157 ->GetValue() | 157 ->GetValue() |
| 158 ->GetAsString(&inner_html)); | 158 ->GetAsString(&inner_html)); |
| 159 EXPECT_EQ(kResponseBody, inner_html); | 159 EXPECT_EQ(kResponseBody, inner_html); |
| 160 } | 160 } |
| 161 | 161 |
| 162 IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, WebGLSupported) { |
| 163 HeadlessWebContents* web_contents = |
| 164 browser()->CreateWebContentsBuilder().Build(); |
| 165 |
| 166 bool webgl_supported; |
| 167 EXPECT_TRUE(EvaluateScript( |
| 168 web_contents, |
| 169 "(document.createElement('canvas').getContext('webgl')" |
| 170 " instanceof WebGLRenderingContext)") |
| 171 ->GetResult() |
| 172 ->GetValue() |
| 173 ->GetAsBoolean(&webgl_supported)); |
| 174 EXPECT_TRUE(webgl_supported); |
| 175 } |
| 176 |
| 162 } // namespace headless | 177 } // namespace headless |
| OLD | NEW |