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

Unified Diff: tools/telemetry/telemetry/core/user_agent_unittest.py

Issue 640453002: Increase coverage of telemetry's user_agent_unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding myself to AUTHORS Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/user_agent_unittest.py
diff --git a/tools/telemetry/telemetry/core/user_agent_unittest.py b/tools/telemetry/telemetry/core/user_agent_unittest.py
index 1b50fb24a5eaa10e9e0ec460b6253080da34320f..242ef7657b5f230740a34402d42d2de94e2055a0 100644
--- a/tools/telemetry/telemetry/core/user_agent_unittest.py
+++ b/tools/telemetry/telemetry/core/user_agent_unittest.py
@@ -6,7 +6,16 @@ from telemetry.core import user_agent
from telemetry.unittest import tab_test_case
-class UserAgentTest(tab_test_case.TabTestCase):
+class MobileUserAgentTest(tab_test_case.TabTestCase):
+ @classmethod
+ def CustomizeBrowserOptions(cls, options):
+ options.browser_user_agent_type = 'mobile'
+
+ def testUserAgent(self):
+ ua = self._tab.EvaluateJavaScript('window.navigator.userAgent')
+ self.assertEquals(ua, user_agent.UA_TYPE_MAPPING['mobile'])
+
+class TabletUserAgentTest(tab_test_case.TabTestCase):
@classmethod
def CustomizeBrowserOptions(cls, options):
options.browser_user_agent_type = 'tablet'
@@ -14,3 +23,12 @@ class UserAgentTest(tab_test_case.TabTestCase):
def testUserAgent(self):
ua = self._tab.EvaluateJavaScript('window.navigator.userAgent')
self.assertEquals(ua, user_agent.UA_TYPE_MAPPING['tablet'])
+
+class DesktopUserAgentTest(tab_test_case.TabTestCase):
+ @classmethod
+ def CustomizeBrowserOptions(cls, options):
+ options.browser_user_agent_type = 'desktop'
+
+ def testUserAgent(self):
+ ua = self._tab.EvaluateJavaScript('window.navigator.userAgent')
+ self.assertEquals(ua, user_agent.UA_TYPE_MAPPING['desktop'])
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698