OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_NACL_NACL_TEST_H_ | |
6 #define CHROME_TEST_NACL_NACL_TEST_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/test/base/layout_test_http_server.h" | |
10 #include "chrome/test/ui/ui_test.h" | |
11 | |
12 class FilePath; | |
13 | |
14 // This class implements integration tests for Native Client. | |
15 // For security reasons, Native Client currently loads modules from port 5103 | |
16 // only, therefore running the test currently requires starting | |
17 // a local webserver on this port. | |
18 // This limitation will be removed in the future. | |
19 // Additional functionality used in this test is implemented in html and JS | |
20 // files that are part of NaCl tree. | |
21 class NaClTest : public UITest { | |
22 protected: | |
23 NaClTest(); | |
24 virtual ~NaClTest(); | |
25 | |
26 // Get the path to the native_client/tests directory, the root of testing | |
27 // data. | |
28 static FilePath GetTestRootDir(); | |
29 | |
30 // Waits for a test case (identified by path) to finish. | |
31 void WaitForFinish(const FilePath& filename, int wait_time); | |
32 | |
33 // Navigate the browser to a given test path, and wait for the test to | |
34 // complete. | |
35 void RunTest(const FilePath& filename, int timeout); | |
36 | |
37 // Similar to RunTest, but relies on the html file to use the "nexes" | |
38 // property to specify the URLs for all the nexes required to run the test | |
39 // on different architectures. | |
40 void RunMultiarchTest(const FilePath& filename, int timeout); | |
41 | |
42 // gtest test setup overrides. | |
43 virtual void SetUp(); | |
44 virtual void TearDown(); | |
45 | |
46 // Construct a URL for a test file on our local webserver. | |
47 GURL GetTestUrl(const FilePath& filename); | |
48 | |
49 private: | |
50 // Compute the path to the test binaries (prebuilt NaCL executables). | |
51 FilePath GetTestBinariesDir(); | |
52 bool use_x64_nexes_; | |
53 | |
54 // This test uses an HTML file that lists nexes for different architectures | |
55 // in the "nexes" property | |
56 bool multiarch_test_; | |
57 | |
58 LayoutTestHttpServer http_server_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(NaClTest); | |
61 }; | |
62 | |
63 #endif // CHROME_TEST_NACL_NACL_TEST_H_ | |
OLD | NEW |