OLD | NEW |
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 from telemetry import tab_test_case | 5 from telemetry.core import user_agent |
6 from telemetry import user_agent | 6 from telemetry.test import tab_test_case |
7 | 7 |
8 | 8 |
9 class UserAgentTest(tab_test_case.TabTestCase): | 9 class UserAgentTest(tab_test_case.TabTestCase): |
10 def CustomizeBrowserOptions(self, options): | 10 def CustomizeBrowserOptions(self, options): |
11 options.browser_user_agent_type = 'tablet' | 11 options.browser_user_agent_type = 'tablet' |
12 | 12 |
13 def testUserAgent(self): | 13 def testUserAgent(self): |
14 ua = self._tab.EvaluateJavaScript('window.navigator.userAgent') | 14 ua = self._tab.EvaluateJavaScript('window.navigator.userAgent') |
15 self.assertEquals(ua, user_agent.UA_TYPE_MAPPING['tablet']) | 15 self.assertEquals(ua, user_agent.UA_TYPE_MAPPING['tablet']) |
OLD | NEW |