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

Unified Diff: chrome/test/functional/gpu.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 9 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 | « chrome/test/functional/fullscreen_mouselock.py ('k') | chrome/test/functional/gtalk/gtalk_base_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/gpu.py
===================================================================
--- chrome/test/functional/gpu.py (revision 261231)
+++ chrome/test/functional/gpu.py (working copy)
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-
-import pyauto_functional # Must be imported before pyauto
-import pyauto
-
-
-class GpuTest(pyauto.PyUITest):
- """GPU Tests Runner."""
-
- def _GetGpuPID(self):
- """Fetch the pid of the GPU process."""
- child_processes = self.GetBrowserInfo()['child_processes']
- for x in child_processes:
- if x['type'] == 'GPU':
- return x['pid']
- return None
-
- def _IsHardwareAccelerated(self, feature):
- """Check if gpu is enabled in the machine before running any tests."""
- self.NavigateToURL('about:gpu')
- def IsFeatureStatusLoaded():
- """Returns whether the feature status UI has been loaded.
-
- The about:gpu page fetches status for features asynchronously, so use
- this to check if the fetch is done.
- """
- js = """
- var list = document.querySelector(".feature-status-list");
- domAutomationController.send(list.hasChildNodes() ? "done" : "");
- """
- return self.ExecuteJavascript(js)
- self.assertTrue(self.WaitUntil(IsFeatureStatusLoaded, 10))
- search = feature + ': Hardware accelerated'
- find_result = self.FindInPage(search)['match_count']
- if find_result:
- # about:gpu page starts a gpu process. Restart the browser to clear
- # the state. We could kill the gpu process, but navigating to a page
- # after killing the gpu can lead to flakiness.
- # See crbug.com/93423.
- self.RestartBrowser()
- return True
- else:
- logging.warn('Hardware acceleration not available')
- return False
-
- def _VerifyGPUProcessOnPage(self, url):
- url = self.GetFileURLForDataPath('pyauto_private', 'gpu', url)
- self.NavigateToURL(url)
- self.assertTrue(self.WaitUntil(
- lambda: self._GetGpuPID() is not None), msg='No process for GPU')
-
- def testSingleGpuProcess(self):
- """Verify there's only one gpu process shared across all uses."""
- self.assertTrue(self._IsHardwareAccelerated('WebGL'))
- url = self.GetFileURLForDataPath('pyauto_private',
- 'gpu', 'WebGLField.html')
- self.AppendTab(pyauto.GURL(url))
- # Open a new window.
- self.OpenNewBrowserWindow(True)
- self.NavigateToURL(url, 1, 0)
- # Open a new incognito window.
- self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
- self.NavigateToURL(url, 1, 0)
- # Verify there's only 1 gpu process.
- gpu_process_count = 0
- for x in self.GetBrowserInfo()['child_processes']:
- if x['type'] == 'GPU':
- gpu_process_count += 1
- self.assertEqual(1, gpu_process_count)
-
-
-if __name__ == '__main__':
- pyauto_functional.Main()
« no previous file with comments | « chrome/test/functional/fullscreen_mouselock.py ('k') | chrome/test/functional/gtalk/gtalk_base_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698