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

Unified Diff: chrome/test/ppapi/ppapi_browsertest.cc

Issue 723623002: Add Non-SFI test for a NaCl packaged app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: possible gyp fix? Created 6 years, 1 month 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
« no previous file with comments | « no previous file | ppapi/tests/extensions/extensions.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ppapi/ppapi_browsertest.cc
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc
index 47157b6040565cfe03ce3f4d6419939a1b67d0c4..fd0e794189bbe041c86a4d52c08ccbbb7bfaaee4 100644
--- a/chrome/test/ppapi/ppapi_browsertest.cc
+++ b/chrome/test/ppapi/ppapi_browsertest.cc
@@ -17,6 +17,7 @@
#include "chrome/test/nacl/nacl_browsertest_util.h"
#include "chrome/test/ppapi/ppapi_test.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/nacl/common/nacl_switches.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/javascript_test_observer.h"
@@ -1338,8 +1339,8 @@ TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate)
class PackagedAppTest : public ExtensionBrowserTest {
public:
- virtual void SetUpOnMainThread() override {
- }
+ explicit PackagedAppTest(const std::string& toolchain)
+ : toolchain_(toolchain) { }
void LaunchTestingApp() {
base::FilePath data_dir;
@@ -1348,7 +1349,7 @@ class PackagedAppTest : public ExtensionBrowserTest {
.AppendASCII("tests")
.AppendASCII("extensions")
.AppendASCII("packaged_app")
- .AppendASCII("newlib");
+ .AppendASCII(toolchain_);
const extensions::Extension* extension = LoadExtension(app_dir);
ASSERT_TRUE(extension);
@@ -1360,12 +1361,38 @@ class PackagedAppTest : public ExtensionBrowserTest {
params.command_line = *CommandLine::ForCurrentProcess();
OpenApplication(params);
}
+
+ void RunTests() {
+ ExtensionTestMessageListener listener("hello", true);
+ LaunchTestingApp();
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+ }
+ protected:
+ std::string toolchain_;
+};
+
+class NewlibPackagedAppTest : public PackagedAppTest {
+ public:
+ NewlibPackagedAppTest() : PackagedAppTest("newlib") { }
+};
+
+class NonSfiPackagedAppTest : public PackagedAppTest {
+ public:
+ NonSfiPackagedAppTest() : PackagedAppTest("nonsfi") { }
+
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ PackagedAppTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitch(switches::kEnableNaClNonSfiMode);
+ }
};
// Load a packaged app, and wait for it to successfully post a "hello" message
// back.
-IN_PROC_BROWSER_TEST_F(PackagedAppTest, SuccessfulLoad) {
- ExtensionTestMessageListener listener("hello", true);
- LaunchTestingApp();
- EXPECT_TRUE(listener.WaitUntilSatisfied());
+IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest, SuccessfulLoad) {
+ RunTests();
+}
+
+IN_PROC_BROWSER_TEST_F(NonSfiPackagedAppTest,
+ MAYBE_PNACL_NONSFI(SuccessfulLoad)) {
+ RunTests();
}
« no previous file with comments | « no previous file | ppapi/tests/extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698