DescriptionFix navigation to unittest files.
We have a number of instances where unit tests call UrlOf('blank.html') or something
similar. The _base_dir is src/tools/telemetry/unittest_data, so the output of relpath
is something like ../blank.html. This works because the http server just ignores the
../ and serves up http://localhost/blank.html. In the case of cros autotests, the output of
relpath ends up being something like ../../../../../../autotest/, and this doesn't work.
When running unit tests via autotest, cwd and the unittest_data directory have no common
parent. If they did, the buggy code would continue to work.
This patch introduces navigate_to_test.NavigateToTestFile, which takes a filename relative to the unittest data directory, converts it to an absolute path, sets up an http server pointing to the unittest data directory, and navigates the tab to the file as requested. tab_test_case.Navigate is a wrapper used by the majority of these unit tests.
Enable all previously failing cros unittests as well.
BUG=337582
TEST=manual
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252253
Patch Set 1 #Patch Set 2 : dtu feedback #Patch Set 3 : revert changes in memory_cache_http_unittest.py #Messages
Total messages: 18 (0 generated)
|