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

Side by Side Diff: chrome/test/functional/gpu_mem.py

Issue 10702200: PyAuto test for GPU memory consumption (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated PyAuto test for GPU memory consumption. Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import pyauto_functional
7 import pyauto
8
9 class GpuMemTest(pyauto.PyUITest):
10 # Return the number of bytes of GPU memory being used
11 def _getGpuMemUsage(self):
12 gpuMemStats = self.GetGpuMemStats()
13 if gpuMemStats['gpu_active'] == False:
14 self.fail(msg='GPU process not active.')
15 return gpuMemStats['gpu_memory_bytes_used']
16
17 def testSanity(self):
nduca 2012/07/17 22:40:25 In general, prefer test name that tell someone who
18 """Report GPU memory usage when test page with 3D CSS is open."""
19 url_3dcss = self.GetFileURLForDataPath('gpu/mem_3dcss.html')
20 self.NavigateToURL(url_3dcss, 0)
21 print 'Using ', self._getGpuMemUsage(), ' bytes of GPU memory'
nduca 2012/07/17 22:40:25 I think the intent of this is that it consumes a l
22
23 def testOverSubscribe(self):
24 """Over-subscribe GPU memory."""
25 url_3dcss = self.GetFileURLForDataPath('gpu/mem_3dcss.html')
26 # Let tabs_to_open be the number of instances of mem_3dcss.html that
27 # will oversubscribe all available GPU memory by a factor of 4
28 # TODO - compute this reliably -- this is a wild guess
nduca 2012/07/17 22:40:25 Hmmm so how are you going to compute this? Doesn't
29 tabs_to_open = 2
30 # Record memory usage statistics as each new tab is opened
31 for i in xrange(tabs_to_open):
32 self.AppendTab(url_3dcss, windex=0)
33 # TODO - verify that we never exceeded the GPU memory budget
nduca 2012/07/17 22:40:25 How?
34 # TODO - verify that we actually used 'most' of the GPU memory (say,
35 # half of it), and that the GPU memory manager did kick
36 # around some resources
nduca 2012/07/17 22:40:25 Maybe using a fixed amount of memory is good here
37 print 'Using ', self._getGpuMemUsage(), ' bytes of GPU memory'
nduca 2012/07/17 22:40:25 Should we have a test that verifies that we get a
mmocny 2012/07/18 15:20:18 GpuMemoryManager will have unittests here, but tho
38
39 if __name__ == '__main__':
40 pyauto_functional.Main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698