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

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

Issue 2184763002: headless: Enable GL support by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/DEPS ('k') | headless/lib/headless_content_main_delegate.cc » ('j') | 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/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
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
OLDNEW
« no previous file with comments | « headless/DEPS ('k') | headless/lib/headless_content_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698