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

Side by Side Diff: tools/telemetry/telemetry/core/chrome/tracing_backend_unittest.py

Issue 12813013: [Telemetry] Cause web server to keep resources in memory and thread requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nduca comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 import cStringIO 5 import cStringIO
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import unittest 9 import unittest
10 10
11 from telemetry.core import util 11 from telemetry.core import util
12 from telemetry.core.chrome import tracing_backend 12 from telemetry.core.chrome import tracing_backend
13 from telemetry.test import tab_test_case 13 from telemetry.test import tab_test_case
14 14
15 15
16 class TracingBackendTest(tab_test_case.TabTestCase): 16 class TracingBackendTest(tab_test_case.TabTestCase):
17 def _StartServer(self): 17 def _StartServer(self):
18 base_dir = os.path.dirname(__file__) 18 base_dir = os.path.dirname(__file__)
19 self._browser.SetHTTPServerDirectory( 19 self._browser.SetHTTPServerDirectories(
20 os.path.join(base_dir, '..', '..', '..', 'unittest_data')) 20 os.path.join(base_dir, '..', '..', '..', 'unittest_data'))
21 21
22 def _WaitForAnimationFrame(self): 22 def _WaitForAnimationFrame(self):
23 def _IsDone(): 23 def _IsDone():
24 js_is_done = """done""" 24 js_is_done = """done"""
25 return bool(self._tab.EvaluateJavaScript(js_is_done)) 25 return bool(self._tab.EvaluateJavaScript(js_is_done))
26 util.WaitFor(_IsDone, 5) 26 util.WaitFor(_IsDone, 5)
27 27
28 def testGotTrace(self): 28 def testGotTrace(self):
29 if not self._browser.supports_tracing: 29 if not self._browser.supports_tracing:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 '"bar"', 65 '"bar"',
66 '"baz"']) 66 '"baz"'])
67 f = cStringIO.StringIO() 67 f = cStringIO.StringIO()
68 ri.Serialize(f) 68 ri.Serialize(f)
69 v = f.getvalue() 69 v = f.getvalue()
70 70
71 j = json.loads(v) 71 j = json.loads(v)
72 assert 'traceEvents' in j 72 assert 'traceEvents' in j
73 self.assertEquals(j['traceEvents'], 73 self.assertEquals(j['traceEvents'],
74 ['foo', 'bar', 'baz']) 74 ['foo', 'bar', 'baz'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698