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

Unified Diff: content/test/gpu/gpu_tests/context_lost.py

Issue 251443006: Adding test to ensure context restoration due to GC doesn't crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/data/gpu/webgl.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/gpu/gpu_tests/context_lost.py
diff --git a/content/test/gpu/gpu_tests/context_lost.py b/content/test/gpu/gpu_tests/context_lost.py
index f80a78e632f1994eb9ee44c7682e77d62f07e30c..bd76460183dca7255f0e2baf9ed4fca5d283aa8a 100644
--- a/content/test/gpu/gpu_tests/context_lost.py
+++ b/content/test/gpu/gpu_tests/context_lost.py
@@ -91,6 +91,26 @@ class _ContextLostValidator(page_test.PageTest):
raise page_test.Failure(
'Test failed (context not restored properly?)')
+ elif page.force_garbage_collection:
+ # Force GC to clean up any contexts not attached to the page.
+ tab.CollectGarbage()
+ completed = False
+ try:
+ print "Waiting for page to finish."
+ util.WaitFor(lambda: tab.EvaluateJavaScript(
+ 'window.domAutomationController._finished'), wait_timeout)
+ completed = True
+ except util.TimeoutException:
+ pass
+
+ if not completed:
+ raise page_test.Failure(
+ 'Test didn\'t complete (no context restored event?)')
+ if not tab.EvaluateJavaScript(
+ 'window.domAutomationController._succeeded'):
+ raise page_test.Failure(
+ 'Test failed (context not restored properly?)')
+
class ContextLost(test_module.Test):
enabled = True
test = _ContextLostValidator
@@ -114,6 +134,7 @@ class ContextLost(test_module.Test):
],
'kill_gpu_process': True,
'number_of_gpu_process_kills': 1,
+ 'force_garbage_collection': False
},
{
'name': 'ContextLost.WebGLContextLostFromLoseContextExtension',
@@ -124,7 +145,20 @@ class ContextLost(test_module.Test):
{ 'action': 'wait',
'javascript': 'window.domAutomationController._finished' }
],
- 'kill_gpu_process': False
+ 'kill_gpu_process': False,
+ 'force_garbage_collection': False
+ },
+ {
+ 'name': 'ContextLost.WebGLContextLostFromQuantity',
+ 'url': 'file://webgl.html?query=forced_quantity_loss',
+ 'script_to_evaluate_on_commit': harness_script,
+ 'navigate_steps': [
+ { 'action': 'navigate' },
+ { 'action': 'wait',
+ 'javascript': 'window.domAutomationController._loaded' }
+ ],
+ 'kill_gpu_process': False,
+ 'force_garbage_collection': True
},
]
}
« no previous file with comments | « content/test/data/gpu/webgl.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698