| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_navigator.h" | 11 #include "chrome/browser/ui/browser_navigator.h" |
| 12 #include "chrome/browser/ui/extensions/app_launch_params.h" | 12 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| 13 #include "chrome/browser/ui/extensions/application_launch.h" | 13 #include "chrome/browser/ui/extensions/application_launch.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
| 17 #include "chrome/test/nacl/nacl_browsertest_util.h" | 17 #include "chrome/test/nacl/nacl_browsertest_util.h" |
| 18 #include "chrome/test/ppapi/ppapi_test.h" | 18 #include "chrome/test/ppapi/ppapi_test.h" |
| 19 #include "components/content_settings/core/browser/host_content_settings_map.h" | 19 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 20 #include "components/nacl/common/nacl_switches.h" | 20 #include "components/nacl/common/nacl_switches.h" |
| 21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/common/url_constants.h" | 22 #include "content/public/common/url_constants.h" |
| 23 #include "content/public/test/javascript_test_observer.h" | 23 #include "content/public/test/javascript_test_observer.h" |
| 24 #include "content/public/test/test_renderer_host.h" | 24 #include "content/public/test/test_renderer_host.h" |
| 25 #include "extensions/common/constants.h" |
| 25 #include "extensions/test/extension_test_message_listener.h" | 26 #include "extensions/test/extension_test_message_listener.h" |
| 26 #include "ppapi/shared_impl/test_harness_utils.h" | 27 #include "ppapi/shared_impl/test_harness_utils.h" |
| 27 | 28 |
| 28 using content::RenderViewHost; | 29 using content::RenderViewHost; |
| 29 | 30 |
| 30 // This macro finesses macro expansion to do what we want. | 31 // This macro finesses macro expansion to do what we want. |
| 31 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name) | 32 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name) |
| 32 // Turn the given token into a string. This allows us to use precompiler stuff | 33 // Turn the given token into a string. This allows us to use precompiler stuff |
| 33 // to turn names into DISABLED_Foo, but still pass a string to RunTest. | 34 // to turn names into DISABLED_Foo, but still pass a string to RunTest. |
| 34 #define STRINGIFY(test_name) #test_name | 35 #define STRINGIFY(test_name) #test_name |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); | 1348 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); |
| 1348 base::FilePath app_dir = data_dir.AppendASCII("ppapi") | 1349 base::FilePath app_dir = data_dir.AppendASCII("ppapi") |
| 1349 .AppendASCII("tests") | 1350 .AppendASCII("tests") |
| 1350 .AppendASCII("extensions") | 1351 .AppendASCII("extensions") |
| 1351 .AppendASCII("packaged_app") | 1352 .AppendASCII("packaged_app") |
| 1352 .AppendASCII(toolchain_); | 1353 .AppendASCII(toolchain_); |
| 1353 | 1354 |
| 1354 const extensions::Extension* extension = LoadExtension(app_dir); | 1355 const extensions::Extension* extension = LoadExtension(app_dir); |
| 1355 ASSERT_TRUE(extension); | 1356 ASSERT_TRUE(extension); |
| 1356 | 1357 |
| 1357 AppLaunchParams params(browser()->profile(), | 1358 AppLaunchParams params(browser()->profile(), extension, |
| 1358 extension, | 1359 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, |
| 1359 extensions::LAUNCH_CONTAINER_NONE, | 1360 extensions::SOURCE_UNTRACKED); |
| 1360 NEW_WINDOW); | |
| 1361 params.command_line = *CommandLine::ForCurrentProcess(); | 1361 params.command_line = *CommandLine::ForCurrentProcess(); |
| 1362 OpenApplication(params); | 1362 OpenApplication(params); |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 void RunTests() { | 1365 void RunTests() { |
| 1366 ExtensionTestMessageListener listener("hello", true); | 1366 ExtensionTestMessageListener listener("hello", true); |
| 1367 LaunchTestingApp(); | 1367 LaunchTestingApp(); |
| 1368 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 1368 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 1369 } | 1369 } |
| 1370 protected: | 1370 protected: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1391 // Load a packaged app, and wait for it to successfully post a "hello" message | 1391 // Load a packaged app, and wait for it to successfully post a "hello" message |
| 1392 // back. | 1392 // back. |
| 1393 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest, SuccessfulLoad) { | 1393 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest, SuccessfulLoad) { |
| 1394 RunTests(); | 1394 RunTests(); |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 IN_PROC_BROWSER_TEST_F(NonSfiPackagedAppTest, | 1397 IN_PROC_BROWSER_TEST_F(NonSfiPackagedAppTest, |
| 1398 MAYBE_PNACL_NONSFI(SuccessfulLoad)) { | 1398 MAYBE_PNACL_NONSFI(SuccessfulLoad)) { |
| 1399 RunTests(); | 1399 RunTests(); |
| 1400 } | 1400 } |
| OLD | NEW |