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

Side by Side Diff: content/shell/renderer/test_runner/test_runner.cc

Issue 706193003: [WebGL-chromium]Test to validate glinfo when webglcontext fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for build error. Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/shell/renderer/test_runner/test_runner.h" 5 #include "content/shell/renderer/test_runner/test_runner.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/public/test/layouttest_support.h" 10 #include "content/public/test/layouttest_support.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 std::string PlatformName(); 302 std::string PlatformName();
303 std::string TooltipText(); 303 std::string TooltipText();
304 bool DisableNotifyDone(); 304 bool DisableNotifyDone();
305 int WebHistoryItemCount(); 305 int WebHistoryItemCount();
306 bool InterceptPostMessage(); 306 bool InterceptPostMessage();
307 void SetInterceptPostMessage(bool value); 307 void SetInterceptPostMessage(bool value);
308 308
309 void NotImplemented(const gin::Arguments& args); 309 void NotImplemented(const gin::Arguments& args);
310 310
311 void forceNextWebGLContextCreationToFail(bool);
312
311 base::WeakPtr<TestRunner> runner_; 313 base::WeakPtr<TestRunner> runner_;
312 314
313 DISALLOW_COPY_AND_ASSIGN(TestRunnerBindings); 315 DISALLOW_COPY_AND_ASSIGN(TestRunnerBindings);
314 }; 316 };
315 317
316 gin::WrapperInfo TestRunnerBindings::kWrapperInfo = { 318 gin::WrapperInfo TestRunnerBindings::kWrapperInfo = {
317 gin::kEmbedderNativeGin}; 319 gin::kEmbedderNativeGin};
318 320
319 // static 321 // static
320 void TestRunnerBindings::Install(base::WeakPtr<TestRunner> runner, 322 void TestRunnerBindings::Install(base::WeakPtr<TestRunner> runner,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 .SetMethod("setCustomTextOutput", 539 .SetMethod("setCustomTextOutput",
538 &TestRunnerBindings::SetCustomTextOutput) 540 &TestRunnerBindings::SetCustomTextOutput)
539 .SetMethod("setViewSourceForFrame", 541 .SetMethod("setViewSourceForFrame",
540 &TestRunnerBindings::SetViewSourceForFrame) 542 &TestRunnerBindings::SetViewSourceForFrame)
541 .SetMethod("setMockPushClientSuccess", 543 .SetMethod("setMockPushClientSuccess",
542 &TestRunnerBindings::SetMockPushClientSuccess) 544 &TestRunnerBindings::SetMockPushClientSuccess)
543 .SetMethod("setMockPushClientError", 545 .SetMethod("setMockPushClientError",
544 &TestRunnerBindings::SetMockPushClientError) 546 &TestRunnerBindings::SetMockPushClientError)
545 .SetMethod("setBluetoothMockDataSet", 547 .SetMethod("setBluetoothMockDataSet",
546 &TestRunnerBindings::SetBluetoothMockDataSet) 548 &TestRunnerBindings::SetBluetoothMockDataSet)
549 .SetMethod("forceNextWebGLContextCreationToFail",
550 &TestRunnerBindings::forceNextWebGLContextCreationToFail)
547 551
548 // Properties. 552 // Properties.
549 .SetProperty("platformName", &TestRunnerBindings::PlatformName) 553 .SetProperty("platformName", &TestRunnerBindings::PlatformName)
550 .SetProperty("tooltipText", &TestRunnerBindings::TooltipText) 554 .SetProperty("tooltipText", &TestRunnerBindings::TooltipText)
551 .SetProperty("disableNotifyDone", &TestRunnerBindings::DisableNotifyDone) 555 .SetProperty("disableNotifyDone", &TestRunnerBindings::DisableNotifyDone)
552 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history 556 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history
553 .SetProperty("webHistoryItemCount", 557 .SetProperty("webHistoryItemCount",
554 &TestRunnerBindings::WebHistoryItemCount) 558 &TestRunnerBindings::WebHistoryItemCount)
555 .SetProperty("interceptPostMessage", 559 .SetProperty("interceptPostMessage",
556 &TestRunnerBindings::InterceptPostMessage, 560 &TestRunnerBindings::InterceptPostMessage,
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 if (runner_) 1445 if (runner_)
1442 return runner_->intercept_post_message_; 1446 return runner_->intercept_post_message_;
1443 return false; 1447 return false;
1444 } 1448 }
1445 1449
1446 void TestRunnerBindings::SetInterceptPostMessage(bool value) { 1450 void TestRunnerBindings::SetInterceptPostMessage(bool value) {
1447 if (runner_) 1451 if (runner_)
1448 runner_->intercept_post_message_ = value; 1452 runner_->intercept_post_message_ = value;
1449 } 1453 }
1450 1454
1455 void TestRunnerBindings::forceNextWebGLContextCreationToFail(
1456 bool forceFailContext) {
1457 if (runner_)
1458 runner_->forceNextWebGLContextCreationToFail(forceFailContext);
1459 }
1460
1451 void TestRunnerBindings::NotImplemented(const gin::Arguments& args) { 1461 void TestRunnerBindings::NotImplemented(const gin::Arguments& args) {
1452 } 1462 }
1453 1463
1454 class TestPageOverlay : public WebPageOverlay { 1464 class TestPageOverlay : public WebPageOverlay {
1455 public: 1465 public:
1456 explicit TestPageOverlay(WebView* web_view) 1466 explicit TestPageOverlay(WebView* web_view)
1457 : web_view_(web_view) { 1467 : web_view_(web_view) {
1458 } 1468 }
1459 virtual ~TestPageOverlay() {} 1469 virtual ~TestPageOverlay() {}
1460 1470
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2838 } 2848 }
2839 2849
2840 void TestRunner::CapturePixelsAsyncThen(v8::Handle<v8::Function> callback) { 2850 void TestRunner::CapturePixelsAsyncThen(v8::Handle<v8::Function> callback) {
2841 scoped_ptr<InvokeCallbackTask> task( 2851 scoped_ptr<InvokeCallbackTask> task(
2842 new InvokeCallbackTask(this, callback)); 2852 new InvokeCallbackTask(this, callback));
2843 proxy_->CapturePixelsAsync(base::Bind(&TestRunner::CapturePixelsCallback, 2853 proxy_->CapturePixelsAsync(base::Bind(&TestRunner::CapturePixelsCallback,
2844 weak_factory_.GetWeakPtr(), 2854 weak_factory_.GetWeakPtr(),
2845 base::Passed(&task))); 2855 base::Passed(&task)));
2846 } 2856 }
2847 2857
2858 void TestRunner::forceNextWebGLContextCreationToFail(bool forceFailContext) {
2859 if (web_view_)
2860 web_view_->forceNextWebGLContextCreationToFail(forceFailContext);
2861 }
2862
2848 void TestRunner::CopyImageAtAndCapturePixelsAsyncThen( 2863 void TestRunner::CopyImageAtAndCapturePixelsAsyncThen(
2849 int x, int y, v8::Handle<v8::Function> callback) { 2864 int x, int y, v8::Handle<v8::Function> callback) {
2850 scoped_ptr<InvokeCallbackTask> task( 2865 scoped_ptr<InvokeCallbackTask> task(
2851 new InvokeCallbackTask(this, callback)); 2866 new InvokeCallbackTask(this, callback));
2852 proxy_->CopyImageAtAndCapturePixels( 2867 proxy_->CopyImageAtAndCapturePixels(
2853 x, y, base::Bind(&TestRunner::CapturePixelsCallback, 2868 x, y, base::Bind(&TestRunner::CapturePixelsCallback,
2854 weak_factory_.GetWeakPtr(), 2869 weak_factory_.GetWeakPtr(),
2855 base::Passed(&task))); 2870 base::Passed(&task)));
2856 } 2871 }
2857 2872
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2961 } 2976 }
2962 2977
2963 void TestRunner::DidLosePointerLockInternal() { 2978 void TestRunner::DidLosePointerLockInternal() {
2964 bool was_locked = pointer_locked_; 2979 bool was_locked = pointer_locked_;
2965 pointer_locked_ = false; 2980 pointer_locked_ = false;
2966 if (was_locked) 2981 if (was_locked)
2967 web_view_->didLosePointerLock(); 2982 web_view_->didLosePointerLock();
2968 } 2983 }
2969 2984
2970 } // namespace content 2985 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698