def testMacVersionExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page7.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('mac', 'mountainlion')) self.assertExpectationEquals('pass', page, StubPlatform('mac', 'mavericks')) self.assertExpectationEquals('pass', page, StubPlatform('mac', 'yosemite')) ps = story_set.StorySet() page = page_module.Page('http://test.com/page8.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('mac', 'mountainlion')) self.assertExpectationEquals('fail', page, StubPlatform('mac', 'mavericks')) self.assertExpectationEquals('pass', page, StubPlatform('mac', 'yosemite')) ps = story_set.StorySet() page = page_module.Page('http://test.com/page9.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('mac', 'mountainlion')) self.assertExpectationEquals('pass', page, StubPlatform('mac', 'mavericks')) self.assertExpectationEquals('fail', page, StubPlatform('mac', 'yosemite'))
def FilterStorySet(cls, story_set): """Filters the given story set, using filters provided in the command line. Returns a new StorySet object with only filtered stories. Story sharding is done before exclusion and inclusion is done. """ if cls._begin_index < 0: cls._begin_index = 0 if cls._end_index is None: cls._end_index = len(story_set) final_story_set = story_set_module.StorySet( archive_data_file=story_set.archive_data_file, cloud_storage_bucket=story_set.bucket, base_dir=story_set.base_dir, serving_dirs=story_set.serving_dirs, ) for story in story_set[cls._begin_index:cls._end_index]: # Exclude filters take priority. if cls._exclude_tags.HasLabelIn(story): continue if cls._exclude_regex.HasMatch(story): continue if cls._include_tags and not cls._include_tags.HasLabelIn(story): continue if cls._include_regex and not cls._include_regex.HasMatch(story): continue final_story_set.AddStory(story) return final_story_set
def testANGLEConditions(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test6-1.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('win'), gl_renderer='ANGLE Direct3D11') self.assertExpectationEquals('fail', page, StubPlatform('win'), gl_renderer='ANGLE Direct3D9') # Regression test for a native mac GL_RENDERER string matching # an ANGLE expectation. page = page_module.Page('http://test.com/test6-2.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('mac'), gl_renderer='Mac Something OpenGL') self.assertExpectationEquals('fail', page, StubPlatform('win'), gl_renderer='ANGLE OpenGL') # Tests for the no_angle keyword page = page_module.Page('http://test.com/test6-3.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('mac'), gl_renderer='Mac Something OpenGL') self.assertExpectationEquals('pass', page, StubPlatform('win'), gl_renderer='ANGLE OpenGL')
def testGpuDeviceIdExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test2.html', ps) self.assertExpectationEquals('fail', page, gpu=VENDOR_NVIDIA, device=0x1001) self.assertExpectationEquals('fail', page, gpu=VENDOR_NVIDIA, device=0x1002) self.assertExpectationEquals('pass', page, gpu=VENDOR_NVIDIA, device=0x1003) self.assertExpectationEquals('pass', page, gpu=VENDOR_AMD, device=0x1001)
def testAbsoluteExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page5.html', ps) page_org = page_module.Page('http://test.org/page5.html', ps) page_https = page_module.Page('https://test.com/page5.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('win')) self.assertExpectationEquals('pass', page_org, StubPlatform('win')) self.assertExpectationEquals('pass', page_https, StubPlatform('win'))
def testExplicitPathsHavePrecedenceOverWildcards(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/conformance/glsl/page00.html', ps) self.assertExpectationEquals('fail', page) page = page_module.Page('http://test.com/conformance/glsl/page15.html', ps) self.assertExpectationEquals('skip', page)
def CreateStorySet(self, options): story_set_path = os.path.join(path_util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') ps = story_set_module.StorySet( archive_data_file='data/maps.json', base_dir=story_set_path, cloud_storage_bucket=story_module.PUBLIC_BUCKET) ps.AddStory(MapsPage(ps, ps.base_dir, self.GetExpectations())) return ps
def CreateStorySet(self, options): ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=['']) ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, 'file://screenshot_sync_canvas.html', 'ScreenshotSync.WithCanvas', self.GetExpectations())) ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, 'file://screenshot_sync_divs.html', 'ScreenshotSync.WithDivs', self.GetExpectations())) return ps
def CreateStorySet(self, options): features = ['WebGL', 'Canvas'] ps = story_set_module.StorySet() for feature in features: ps.AddStory( ChromeGpuPage(story_set=ps, feature=feature, expectations=self.GetExpectations())) return ps
def testANGLEConditions(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test6.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('win'), gl_renderer='Direct3D11') self.assertExpectationEquals('fail', page, StubPlatform('win'), gl_renderer='Direct3D9')
def testBrowserTypeConditions(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page10.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('android'), browser_type='android-content-shell') self.assertExpectationEquals('fail', page, StubPlatform('android'), browser_type='android-webview-shell')
def testFlakyPerPlatformExpectation(self): ps = story_set.StorySet() page1 = page_module.Page('http://test.com/test2.html', ps) self.assertExpectationEquals('pass', page1, StubPlatform('win')) self.assertEquals(6, self.getRetriesForPage(page1, StubPlatform('win'))) self.assertExpectationEquals('pass', page1, StubPlatform('mac')) self.assertEquals(0, self.getRetriesForPage(page1, StubPlatform('mac'))) page2 = page_module.Page('http://test.com/wildcardtest1.html', ps) self.assertExpectationEquals('pass', page2, StubPlatform('win')) self.assertEquals(7, self.getRetriesForPage(page2, StubPlatform('win'))) self.assertExpectationEquals('pass', page2, StubPlatform('mac')) self.assertEquals(0, self.getRetriesForPage(page2, StubPlatform('mac')))
def testGpuDeviceStringExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test5.html', ps) self.assertExpectationEquals('fail', page, vendor_string=VENDOR_STRING_IMAGINATION, device_string=DEVICE_STRING_SGX) self.assertExpectationEquals('pass', page, vendor_string=VENDOR_STRING_IMAGINATION, device_string='Triangle Monster 3000') self.assertExpectationEquals('pass', page, vendor_string='Acme', device_string=DEVICE_STRING_SGX)
def testMultipleExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test3.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('win'), VENDOR_AMD, 0x1001) self.assertExpectationEquals('fail', page, StubPlatform('win'), VENDOR_INTEL, 0x1002) self.assertExpectationEquals('pass', page, StubPlatform('win'), VENDOR_NVIDIA, 0x1001) self.assertExpectationEquals('pass', page, StubPlatform('mac'), VENDOR_AMD, 0x1001) self.assertExpectationEquals('pass', page, StubPlatform('win'), VENDOR_AMD, 0x1002)
def __init__(self, times_to_fail_test=0, manager_mock=None, max_failures=None): super(FakeTest, self).__init__(max_failures) self._fake_pages = [] self._fake_story_set = story_set_module.StorySet() self._created_story_set = False validator_mock = manager_mock.validator if manager_mock else None self.validator = FakeValidator(manager_mock=validator_mock) if times_to_fail_test > 0: self.validator = ValidatorWhichFailsNTimes( times_to_fail=times_to_fail_test, manager_mock=validator_mock) else: self.validator = FakeValidator(manager_mock=validator_mock)
def CreateStorySet(self, options): ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=set([''])) ps.AddStory( GPUProcessCrashesExactlyOnce(ps, ps.base_dir, self.GetExpectations())) ps.AddStory( WebGLContextLostFromGPUProcessExitPage(ps, ps.base_dir, self.GetExpectations())) ps.AddStory( WebGLContextLostFromLoseContextExtensionPage( ps, ps.base_dir, self.GetExpectations())) ps.AddStory( WebGLContextLostFromQuantityPage(ps, ps.base_dir, self.GetExpectations())) ps.AddStory( WebGLContextLostFromSelectElementPage(ps, ps.base_dir, self.GetExpectations())) ps.AddStory( WebGLContextLostInHiddenTabPage(ps, ps.base_dir, self.GetExpectations())) return ps
def testPageNameExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page6.html', ps, name='Pages.page_6') self.assertExpectationEquals('fail', page)
def testWildcardExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page4.html', ps) page_js = page_module.Page('http://test.com/page4.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('win')) self.assertExpectationEquals('fail', page_js, StubPlatform('win'))
def testConditionlessExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page3.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('win')) self.assertExpectationEquals('fail', page, StubPlatform('mac', 'lion')) self.assertExpectationEquals('fail', page, StubPlatform('linux'))
def testOSVersionExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page2.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('win', 'vista')) self.assertExpectationEquals('pass', page, StubPlatform('win', 'win7'))
def CreateStorySet(self, options): ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=['']) ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, self.GetExpectations())) return ps
def testFileScheme(self): ps = story_set.StorySet() page = page_module.Page('file://conformance/attribs/page13.html', ps) self.assertExpectationEquals('fail', page)
def testFlakyExpectation(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test7.html', ps) self.assertExpectationEquals('flaky', page) self.assertEquals(5, self.getRetriesForPage(page))
def testNoExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page0.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('win'))
def testUserDefinedConditions(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/page11.html', ps) self.assertExpectationEquals('fail', page, StubPlatform('win')) page = page_module.Page('http://test.com/page12.html', ps) self.assertExpectationEquals('pass', page, StubPlatform('win'))
def testGpuExpectations(self): ps = story_set.StorySet() page = page_module.Page('http://test.com/test1.html', ps) self.assertExpectationEquals('fail', page, gpu=VENDOR_NVIDIA) self.assertExpectationEquals('fail', page, gpu=VENDOR_INTEL) self.assertExpectationEquals('pass', page, gpu=VENDOR_AMD)
def testFileSchemeOnWindows(self): ps = story_set.StorySet() page = page_module.Page('file://conformance\\attribs\\page14.html', ps) self.assertExpectationEquals('pass', page) self.assertExpectationEquals('fail', page, StubPlatform('win'))
def setUp(self): self.story_set = story_set.StorySet() self.story_set.AddStory(StoryFoo())
def testQueryArgsAreStrippedFromFileURLs(self): ps = story_set.StorySet() page = page_module.Page( 'file://conformance/glsl/page15.html?webglVersion=2', ps) self.assertExpectationEquals('skip', page)
def setUp(self): self.story_set = story_set.StorySet() self.story_set.AddStory(StoryFoo(name='foo'))