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

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

Issue 23359003: Eliminate unused PYAUTO tests and TestingAutomationProvider methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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
5 import pyauto_functional # Must come before pyauto (and thus, policy_base).
6 import policy_base
7
8
9 class ChromeosRetailMode(policy_base.PolicyTestBase):
10 """Tests for retail mode."""
11
12 # The inherited setUp() method fakes enterprise enrollment. Setting the mode
13 # to 'kiosk' causes enrollment into retail mode instead of the default
14 # enterprise mode.
15 mode = 'kiosk'
16 machine_id = 'KIOSK'
17
18 def ShouldOOBESkipToLogin(self):
19 # There's no OOBE to skip.
20 return False
21
22 def _CheckOnRetailModeLoginScreen(self):
23 """Checks that the retail mode login screen is visible."""
24 return self.ExecuteJavascriptInOOBEWebUI(
25 """window.domAutomationController.send(
26 !!document.getElementById('demo-login-text'));
27 """)
28
29 def Login(self):
30 """Login to retail mode by simulating a mouse click."""
31 self.ExecuteJavascriptInOOBEWebUI(
32 """var event = document.createEvent("MouseEvent");
33 event.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0,
34 false, false, false, false, 0, null);
35 window.domAutomationController.send(
36 document.getElementById('page').dispatchEvent(event));
37 """)
38
39 def testLogin(self):
40 """Tests retail mode login."""
41 self.assertTrue(self._CheckOnRetailModeLoginScreen(),
42 msg='Expected to be on the retail mode login screen.')
43
44 self.Login()
45 self.assertTrue(self.GetLoginInfo()['is_logged_in'],
46 msg='Expected to be logged in.')
47 self.Logout()
48
49
50 if __name__ == '__main__':
51 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/chromeos_oobe.py ('k') | chrome/test/functional/chromeos_txt_msg_functional.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698