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

Unified Diff: telemetry/telemetry/page/legacy_page_test.py

Issue 1921633003: [Telemetry] Rename page_test to legacy_page_test (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Add TODO Created 4 years, 8 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
Index: telemetry/telemetry/page/legacy_page_test.py
diff --git a/telemetry/telemetry/page/page_test.py b/telemetry/telemetry/page/legacy_page_test.py
similarity index 86%
copy from telemetry/telemetry/page/page_test.py
copy to telemetry/telemetry/page/legacy_page_test.py
index 29cc729aa669459161f4c33519a79459d96e6b2e..5d99a612bb386abf95b7bad14eae740a4e153e5d 100644
--- a/telemetry/telemetry/page/page_test.py
+++ b/telemetry/telemetry/page/legacy_page_test.py
@@ -12,7 +12,7 @@ from telemetry.web_perf.story_test import Failure
class TestNotSupportedOnPlatformError(Exception):
- """PageTest Exception raised when a required feature is unavailable.
+ """LegacyPageTest Exception raised when a required feature is unavailable.
The feature required to run the test could be part of the platform,
hardware configuration, or browser.
@@ -20,23 +20,32 @@ class TestNotSupportedOnPlatformError(Exception):
class MultiTabTestAppCrashError(Exception):
- """PageTest Exception raised after browser or tab crash for multi-tab tests.
+ """Exception raised after browser or tab crash for multi-tab tests.
Used to abort the test rather than try to recover from an unknown state.
"""
class MeasurementFailure(Failure):
- """PageTest Exception raised when an undesired but designed-for problem."""
+ """Exception raised when an undesired but designed-for problem."""
-class PageTest(object):
+class LegacyPageTest(object):
"""A class styled on unittest.TestCase for creating page-specific tests.
+ Note that this method of measuring browser's performance is obsolete and only
+ here for "historical" reason. For your performance measurement need, please
+ use TimelineBasedMeasurement instead: https://goo.gl/eMvikK
+
+ For correctness testing, please use
+ telemetry.testing.serially_executed_browser_test_case.SeriallyBrowserTestCase
+ instead. See examples in:
+ https://github.com/catapult-project/catapult/tree/master/telemetry/examples/browser_tests
+
Test should override ValidateAndMeasurePage to perform test
validation and page measurement as necessary.
- class BodyChildElementMeasurement(PageTest):
+ class BodyChildElementMeasurement(LegacyPageTest):
def ValidateAndMeasurePage(self, page, tab, results):
body_child_count = tab.EvaluateJavaScript(
'document.body.children.length')
@@ -47,7 +56,7 @@ class PageTest(object):
def __init__(self,
needs_browser_restart_after_each_page=False,
clear_cache_before_each_run=False):
- super(PageTest, self).__init__()
+ super(LegacyPageTest, self).__init__()
self.options = None
self._needs_browser_restart_after_each_page = (
@@ -64,7 +73,7 @@ class PageTest(object):
single-tab tests too. That is because the state of multi-tab tests
(e.g., how many tabs are open, etc.) is unknown after crashes.
"""
- return self.TabForPage.__func__ is not PageTest.TabForPage.__func__
+ return self.TabForPage.__func__ is not LegacyPageTest.TabForPage.__func__
@property
def clear_cache_before_each_run(self):
@@ -150,7 +159,7 @@ class PageTest(object):
When adding measurement results, call results.AddValue(...) for
each result. Raise an exception or add a failure.FailureValue on
- failure. page_test.py also provides several base exception classes
+ failure. legacy_page_test.py also provides several base exception classes
to use.
Prefer metric value names that are in accordance with python
« no previous file with comments | « telemetry/telemetry/internal/story_runner_unittest.py ('k') | telemetry/telemetry/page/page_run_end_to_end_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698