def testPageTestWithIncompatibleStory(self):
        options = options_for_unittests.GetCopy()

        b = TestBenchmark(
            story_module.Story(
                name='test story',
                shared_state_class=shared_page_state.SharedPageState))
        with self.assertRaisesRegexp(
                Exception, 'containing only telemetry.page.Page stories'):
            story_runner.RunBenchmark(b, b.CreateStorySet(options), None,
                                      options.browser_options, options)

        state_class = story_module.SharedState
        b = TestBenchmark(
            story_module.Story(name='test benchmark',
                               shared_state_class=state_class))
        with self.assertRaisesRegexp(
                Exception, 'containing only telemetry.page.Page stories'):
            story_runner.RunBenchmark(b, b.CreateStorySet(options), None,
                                      options.browser_options, options)

        b = TestBenchmark(
            android.AndroidStory(name='test benchmark', start_intent=None))
        with self.assertRaisesRegexp(
                Exception, 'containing only telemetry.page.Page stories'):
            story_runner.RunBenchmark(b, b.CreateStorySet(options), None,
                                      options.browser_options, options)
Beispiel #2
0
    def testPageTestWithIncompatibleStory(self):
        b = TestBenchmark(
            story_module.Story(
                shared_state_class=shared_page_state.SharedPageState))
        with self.assertRaisesRegexp(
                Exception, 'containing only telemetry.page.Page stories'):
            b.Run(browser_options.BrowserFinderOptions())

        state_class = story_module.SharedState
        b = TestBenchmark(story_module.Story(shared_state_class=state_class))
        with self.assertRaisesRegexp(
                Exception, 'containing only telemetry.page.Page stories'):
            b.Run(browser_options.BrowserFinderOptions())

        b = TestBenchmark(android.AndroidStory(start_intent=None))
        with self.assertRaisesRegexp(
                Exception, 'containing only telemetry.page.Page stories'):
            b.Run(browser_options.BrowserFinderOptions())
  def testPageTestWithIncompatibleStory(self):
    b = TestBenchmark(story_module.Story(
        name='test story',
        shared_state_class=shared_page_state.SharedPageState))
    with self.assertRaisesRegexp(
        Exception, 'containing only telemetry.page.Page stories'):
      b.Run(options_for_unittests.GetCopy())

    state_class = story_module.SharedState
    b = TestBenchmark(story_module.Story(
        name='test benchmark',
        shared_state_class=state_class))
    with self.assertRaisesRegexp(
        Exception, 'containing only telemetry.page.Page stories'):
      b.Run(options_for_unittests.GetCopy())

    b = TestBenchmark(android.AndroidStory(
        name='test benchmark', start_intent=None))
    with self.assertRaisesRegexp(
        Exception, 'containing only telemetry.page.Page stories'):
      b.Run(options_for_unittests.GetCopy())