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

Side by Side Diff: tools/telemetry/telemetry/core/backends/chrome/inspector_console_unittest.py

Issue 151003003: Fix navigation to unittest files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert changes in memory_cache_http_unittest.py Created 6 years, 10 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/inspector_memory_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 re 5 import re
6 import StringIO 6 import StringIO
7 7
8 from telemetry import test
9 from telemetry.core import util 8 from telemetry.core import util
10 from telemetry.unittest import tab_test_case 9 from telemetry.unittest import tab_test_case
11 10
12 11
13 class TabConsoleTest(tab_test_case.TabTestCase): 12 class TabConsoleTest(tab_test_case.TabTestCase):
14 @test.Disabled('chromeos')
15 def testConsoleOutputStream(self): 13 def testConsoleOutputStream(self):
16 self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
17
18 stream = StringIO.StringIO() 14 stream = StringIO.StringIO()
19 self._tab.message_output_stream = stream 15 self._tab.message_output_stream = stream
20 16
21 self._tab.Navigate( 17 self.Navigate('page_that_logs_to_console.html')
22 self._browser.http_server.UrlOf('page_that_logs_to_console.html'))
23 self._tab.WaitForDocumentReadyStateToBeComplete()
24 18
25 initial = self._tab.EvaluateJavaScript('window.__logCount') 19 initial = self._tab.EvaluateJavaScript('window.__logCount')
26 def GotLog(): 20 def GotLog():
27 current = self._tab.EvaluateJavaScript('window.__logCount') 21 current = self._tab.EvaluateJavaScript('window.__logCount')
28 return current > initial 22 return current > initial
29 util.WaitFor(GotLog, 5) 23 util.WaitFor(GotLog, 5)
30 24
31 lines = [l for l in stream.getvalue().split('\n') if len(l)] 25 lines = [l for l in stream.getvalue().split('\n') if len(l)]
32 26
33 self.assertTrue(len(lines) >= 1) 27 self.assertTrue(len(lines) >= 1)
34 for line in lines: 28 for line in lines:
35 prefix = 'http://(.+)/page_that_logs_to_console.html:9' 29 prefix = 'http://(.+)/page_that_logs_to_console.html:9'
36 expected_line = 'At %s: Hello, world' % prefix 30 expected_line = 'At %s: Hello, world' % prefix
37 self.assertTrue(re.match(expected_line, line)) 31 self.assertTrue(re.match(expected_line, line))
38 32
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/inspector_memory_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698