diff options
author | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-16 21:41:37 +0000 |
---|---|---|
committer | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-16 21:41:37 +0000 |
commit | 77f76019c424c2421a5e29f4e3d7a26b1e296de5 (patch) | |
tree | b9d0d692afa6b8c02278f61e3786f99d25b0e21d /chrome/test | |
parent | c53165eee209ac76acc894a9f593febbe87dc850 (diff) | |
download | chromium_src-77f76019c424c2421a5e29f4e3d7a26b1e296de5.zip chromium_src-77f76019c424c2421a5e29f4e3d7a26b1e296de5.tar.gz chromium_src-77f76019c424c2421a5e29f4e3d7a26b1e296de5.tar.bz2 |
Add a test: use "nexes" property in the embed tag and let the plugin choose the right binary to run.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=500
TEST=this CL
Review URL: http://codereview.chromium.org/3171010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/nacl/nacl_test.cc | 18 | ||||
-rw-r--r-- | chrome/test/nacl/nacl_test.h | 8 | ||||
-rw-r--r-- | chrome/test/nacl/nacl_ui_test.cc | 6 |
3 files changed, 27 insertions, 5 deletions
diff --git a/chrome/test/nacl/nacl_test.cc b/chrome/test/nacl/nacl_test.cc index ecad2e8..f1c2b75 100644 --- a/chrome/test/nacl/nacl_test.cc +++ b/chrome/test/nacl/nacl_test.cc @@ -24,7 +24,7 @@ const FilePath::CharType kBaseUrl[] = } // anonymous namespace NaClTest::NaClTest() - : UITest(), use_x64_nexes_(false) { + : UITest(), use_x64_nexes_(false), multiarch_test_(false) { launch_arguments_.AppendSwitch(switches::kEnableNaCl); // Currently we disable some of the sandboxes. See: @@ -47,10 +47,13 @@ FilePath NaClTest::GetTestRootDir() { GURL NaClTest::GetTestUrl(const FilePath& filename) { FilePath path(kBaseUrl); - if (use_x64_nexes_) - path = path.AppendASCII("x64"); - else - path = path.AppendASCII("x86"); + // Multiarch tests are in the directory defined by kBaseUrl. + if (!multiarch_test_) { + if (use_x64_nexes_) + path = path.AppendASCII("x64"); + else + path = path.AppendASCII("x86"); + } path = path.Append(filename); return GURL(path.value()); } @@ -75,6 +78,11 @@ void NaClTest::RunTest(const FilePath& filename, int timeout) { WaitForFinish(filename, timeout); } +void NaClTest::RunMultiarchTest(const FilePath& filename, int timeout) { + multiarch_test_ = true; + RunTest(filename, timeout); +} + void NaClTest::SetUp() { FilePath nacl_test_dir = GetTestRootDir(); diff --git a/chrome/test/nacl/nacl_test.h b/chrome/test/nacl/nacl_test.h index ce7ee77..00bcbb4 100644 --- a/chrome/test/nacl/nacl_test.h +++ b/chrome/test/nacl/nacl_test.h @@ -33,6 +33,11 @@ class NaClTest : public UITest { // complete. void RunTest(const FilePath& filename, int timeout); + // Similar to RunTest, but relies on the html file to use the "nexes" + // property to specify the URLs for all the nexes required to run the test + // on different architectures. + void RunMultiarchTest(const FilePath& filename, int timeout); + // gtest test setup overrides. virtual void SetUp(); virtual void TearDown(); @@ -44,6 +49,9 @@ class NaClTest : public UITest { // Compute the path to the test binaries (prebuilt NaCL executables). FilePath GetTestBinariesDir(); bool use_x64_nexes_; + // This test uses HTML file that lists nexes for different architectures + // in the "nexes" property + bool multiarch_test_; }; #endif // CHROME_TEST_NACL_NACL_TEST_H_ diff --git a/chrome/test/nacl/nacl_ui_test.cc b/chrome/test/nacl/nacl_ui_test.cc index 10af909..84c8950 100644 --- a/chrome/test/nacl/nacl_ui_test.cc +++ b/chrome/test/nacl/nacl_ui_test.cc @@ -83,3 +83,9 @@ TEST_F(NaClUITest, NpapiHwTest) { FilePath test_file(kNpapiHwHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } + +TEST_F(NaClUITest, MultiarchTest) { + FilePath test_file(kSrpcHwHtmlFileName); + RunMultiarchTest(test_file, action_max_timeout_ms()); +} + |