OLD | NEW |
| (Empty) |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 import os | |
6 | |
7 from telemetry.core import util | |
8 | |
9 def NavigateToTestFile(tab, filename, script_to_evaluate_on_commit=None): | |
10 """Navigates |tab| to |filename| in the unittest data directory. | |
11 | |
12 Also sets up http server to point to the unittest data directory. | |
13 """ | |
14 tab.browser.SetHTTPServerDirectories(util.GetUnittestDataDir()) | |
15 path = os.path.join(util.GetUnittestDataDir(), filename) | |
16 tab.Navigate(tab.browser.http_server.UrlOf(path), | |
17 script_to_evaluate_on_commit) | |
18 tab.WaitForDocumentReadyStateToBeComplete() | |
19 return path | |
20 | |
OLD | NEW |