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