OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 import optparse | 4 import optparse |
5 import os | 5 import os |
6 import unittest | 6 import unittest |
7 | 7 |
8 from telemetry.core import browser_options | 8 from telemetry.core import browser_options |
9 | 9 |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 current_dir = os.path.dirname(__file__) | 75 current_dir = os.path.dirname(__file__) |
76 parser.parse_args(['--browser', 'any', '--profile-dir', current_dir]) | 76 parser.parse_args(['--browser', 'any', '--profile-dir', current_dir]) |
77 self.assertEquals(options.browser_options.profile_dir, current_dir) | 77 self.assertEquals(options.browser_options.profile_dir, current_dir) |
78 | 78 |
79 def testExtraBrowserArgs(self): | 79 def testExtraBrowserArgs(self): |
80 options = browser_options.BrowserFinderOptions() | 80 options = browser_options.BrowserFinderOptions() |
81 parser = options.CreateParser() | 81 parser = options.CreateParser() |
82 parser.parse_args(['--extra-browser-args=--foo --bar']) | 82 parser.parse_args(['--extra-browser-args=--foo --bar']) |
83 | 83 |
84 self.assertEquals(options.browser_options.extra_browser_args, | 84 self.assertEquals(options.browser_options.extra_browser_args, |
85 set(['--foo','--bar'])) | 85 set(['--foo', '--bar'])) |
86 | 86 |
87 def testUseDevToolsActivePort(self): | 87 def testUseDevToolsActivePort(self): |
88 options = browser_options.BrowserFinderOptions() | 88 options = browser_options.BrowserFinderOptions() |
89 parser = options.CreateParser() | 89 parser = options.CreateParser() |
90 parser.parse_args(['--use-devtools-active-port']) | 90 parser.parse_args(['--use-devtools-active-port']) |
91 | 91 |
92 self.assertEquals(options.browser_options.use_devtools_active_port, True) | 92 self.assertEquals(options.browser_options.use_devtools_active_port, True) |
93 | 93 |
94 def testMergeDefaultValues(self): | 94 def testMergeDefaultValues(self): |
95 options = browser_options.BrowserFinderOptions() | 95 options = browser_options.BrowserFinderOptions() |
(...skipping 13 matching lines...) Expand all Loading... |
109 | 109 |
110 options.MergeDefaultValues(parser.get_default_values()) | 110 options.MergeDefaultValues(parser.get_default_values()) |
111 | 111 |
112 self.assertTrue(options.already_true) | 112 self.assertTrue(options.already_true) |
113 self.assertFalse(options.already_false) | 113 self.assertFalse(options.already_false) |
114 self.assertTrue(options.unset is None) | 114 self.assertTrue(options.unset is None) |
115 self.assertTrue(options.default_true) | 115 self.assertTrue(options.default_true) |
116 self.assertFalse(options.default_false) | 116 self.assertFalse(options.default_false) |
117 self.assertFalse(options.override_to_true) | 117 self.assertFalse(options.override_to_true) |
118 self.assertTrue(options.override_to_false) | 118 self.assertTrue(options.override_to_false) |
OLD | NEW |