Chromium Code Reviews| 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(web_contents, | |
| 168 "document.createElement('canvas').getContext('" | |
|
altimin
2016/07/26 14:47:05
nit: Can we try to format this code more nicely?
Sami
2016/07/27 14:26:05
Definitely, done.
| |
| 169 "webgl') instanceof WebGLRenderingContext") | |
| 170 ->GetResult() | |
| 171 ->GetValue() | |
| 172 ->GetAsBoolean(&webgl_supported)); | |
| 173 EXPECT_TRUE(webgl_supported); | |
| 174 } | |
| 175 | |
| 162 } // namespace headless | 176 } // namespace headless |
| OLD | NEW |