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

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

Issue 9372120: Implementation of AutomationEventQueue and associated framework to support generic non-blocking aut… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Nirnimesh's comments. Created 8 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
(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
5 import json
6
7 import pyauto_functional # must be imported before pyauto
8 import pyauto
9
10
11 class PyAutoEventsTest(pyauto.PyUITest):
12
13 def testBasicEvents(self):
14 """Basic test for the event queue."""
15 url = self.GetHttpURLForDataPath('apptest', 'basic.html')
16 driver = self.NewWebDriver()
17 event_id = self.AddDomRaisedEventObserver();
18 self.NavigateToURL(url)
19 self._VerifyNextEvent(event_id, 'init')
20 self._VerifyNextEvent(event_id, 'login ready')
21 driver.find_element_by_id('login').click()
22 self._VerifyNextEvent(event_id, 'login start')
23 self._VerifyNextEvent(event_id, 'login done')
24
25 def _VerifyNextEvent(self, event_id, event_name):
26 # TODO(craigdh): Temporary hack to ignore unexpected events generated by
27 # chromedriver's use of DomAutomationController. The upcoming revision to
28 # RaisedEvents will fix this. Note this isn't polling, just ignoring
29 # chromedriver events.
30 while json.loads(self.GetQueuedEvent(event_id).get('name')) != event_name:
31 pass
32
Nirnimesh 2012/02/28 09:13:09 You aren't "verifying" anything in this method as
craigdh 2012/02/28 22:42:56 Renamed "_ExpectEvent". The upcoming fixed version
33
34 if __name__ == '__main__':
35 pyauto_functional.Main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698