def testCanLaunchAlwaysTrueReturnsAllExceptExactAndReference(self): all_types = set(android_browser_finder.FindAllBrowserTypes()) expected_types = all_types - set(('exact', 'reference')) possible_browsers = android_browser_finder._FindAllPossibleBrowsers( self.finder_options, self.fake_platform) self.assertEqual(expected_types, set([b.browser_type for b in possible_browsers]))
def testCanLaunchAlwaysTrueReturnsAllExceptExact(self): fake_platform = FakeAndroidPlatform(can_launch=True) all_types = set( android_browser_finder.FindAllBrowserTypes(self.finder_options)) expected_types = all_types - set(('exact', )) possible_browsers = android_browser_finder._FindAllPossibleBrowsers( self.finder_options, fake_platform) self.assertEqual(expected_types, set([b.browser_type for b in possible_browsers]))
def testCanLaunchAlwaysTrueReturnsAllExceptExact(self): self.finder_options.browser_type = 'any' self.fs.CreateFile(self.expected_reference_build) all_types = set(android_browser_finder.FindAllBrowserTypes()) expected_types = all_types - set(('exact', )) possible_browsers = android_browser_finder._FindAllPossibleBrowsers( self.finder_options, self.fake_platform) self.assertEqual(expected_types, set([b.browser_type for b in possible_browsers]))
def testCanLaunchAlwaysTrueReturnsAllExceptExactAndReference(self): if not self.finder_options.chrome_root: self.skipTest('--chrome-root is not specified, skip the test') all_types = set( android_browser_finder.FindAllBrowserTypes(self.finder_options)) expected_types = all_types - set(('exact', 'reference')) possible_browsers = android_browser_finder._FindAllPossibleBrowsers( self.finder_options, self.fake_platform) self.assertEqual(expected_types, set([b.browser_type for b in possible_browsers]))
def testCanLaunchAlwaysTrueWithExactApkReturnsAll(self): self.fs.CreateFile('/foo/ContentShell.apk') self.fs.CreateFile(self.expected_reference_build) self.finder_options.browser_executable = '/foo/ContentShell.apk' self._get_package_name_mock.return_value = 'org.chromium.content_shell_apk' expected_types = set(android_browser_finder.FindAllBrowserTypes()) possible_browsers = android_browser_finder._FindAllPossibleBrowsers( self.finder_options, self.fake_platform) self.assertEqual(expected_types, set([b.browser_type for b in possible_browsers]))
def testCanLaunchAlwaysTrueWithExactApkReturnsAll(self): self._android_browser_finder_stub.os.path.files.append( '/foo/content-shell.apk') self.finder_options.browser_executable = '/foo/content-shell.apk' self._get_package_name_mock.return_value = 'org.chromium.content_shell_apk' fake_platform = FakeAndroidPlatform(can_launch=True) expected_types = set( android_browser_finder.FindAllBrowserTypes(self.finder_options)) possible_browsers = android_browser_finder._FindAllPossibleBrowsers( self.finder_options, fake_platform) self.assertEqual(expected_types, set([b.browser_type for b in possible_browsers]))