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

Side by Side Diff: tools/chrome_remote_control/chrome_remote_control/tab_runtime_unittest.py

Issue 10875044: Basic framework for devtools-based scrolling tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with the added files Created 8 years, 3 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 # 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
3 # found in the LICENSE file.
4 import browser
5 import browser_finder
6 import browser_options
7 import tab_runtime
8 import unittest
9
10 class TabRuntimeTest(unittest.TestCase):
11 def setUp(self):
12 self._browser = None
13 self._tab = None
14 options = browser_options.BrowserOptions()
15 browser_to_create = browser_finder.FindBestPossibleBrowser(options)
16 try:
17 self._browser = browser_to_create.Create()
18 self._tab = self._browser.ConnectToNthTab(0)
19 except:
20 self.tearDown()
21 raise
22
23 def tearDown(self):
24 if self._tab:
25 self._tab.Close()
26 if self._browser:
27 self._browser.Close()
28
29 def testRuntimeEvaluateSimple(self):
30 res = self._tab.runtime.Evaluate("1+1")
31 assert res == 2
32
33 def testRuntimeEvaluateThatFails(self):
34 self.assertRaises(tab_runtime.EvaluateException,
35 lambda: self._tab.runtime.Evaluate("fsdfsdfsf"))
36
37 def testRuntimeEvaluateOfSomethingThatCantJSONize(self):
38 self.assertRaises(tab_runtime.EvaluateException,
39 lambda: self._tab.runtime.Evaluate("window"))
40
41 def testRuntimeLoadURL(self):
42 self._tab.BeginToLoadURL("http://www.google.com")
43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698