| 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 "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
| 22 #include "content/public/test/javascript_test_observer.h" | 22 #include "content/public/test/javascript_test_observer.h" |
| 23 #include "content/public/test/test_renderer_host.h" | 23 #include "content/public/test/test_renderer_host.h" |
| 24 #include "extensions/common/constants.h" |
| 24 #include "extensions/test/extension_test_message_listener.h" | 25 #include "extensions/test/extension_test_message_listener.h" |
| 25 #include "ppapi/shared_impl/test_harness_utils.h" | 26 #include "ppapi/shared_impl/test_harness_utils.h" |
| 26 | 27 |
| 27 using content::RenderViewHost; | 28 using content::RenderViewHost; |
| 28 | 29 |
| 29 // This macro finesses macro expansion to do what we want. | 30 // This macro finesses macro expansion to do what we want. |
| 30 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name) | 31 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name) |
| 31 // Turn the given token into a string. This allows us to use precompiler stuff | 32 // Turn the given token into a string. This allows us to use precompiler stuff |
| 32 // to turn names into DISABLED_Foo, but still pass a string to RunTest. | 33 // to turn names into DISABLED_Foo, but still pass a string to RunTest. |
| 33 #define STRINGIFY(test_name) #test_name | 34 #define STRINGIFY(test_name) #test_name |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); | 1347 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); |
| 1347 base::FilePath app_dir = data_dir.AppendASCII("ppapi") | 1348 base::FilePath app_dir = data_dir.AppendASCII("ppapi") |
| 1348 .AppendASCII("tests") | 1349 .AppendASCII("tests") |
| 1349 .AppendASCII("extensions") | 1350 .AppendASCII("extensions") |
| 1350 .AppendASCII("packaged_app") | 1351 .AppendASCII("packaged_app") |
| 1351 .AppendASCII("newlib"); | 1352 .AppendASCII("newlib"); |
| 1352 | 1353 |
| 1353 const extensions::Extension* extension = LoadExtension(app_dir); | 1354 const extensions::Extension* extension = LoadExtension(app_dir); |
| 1354 ASSERT_TRUE(extension); | 1355 ASSERT_TRUE(extension); |
| 1355 | 1356 |
| 1356 AppLaunchParams params(browser()->profile(), | 1357 AppLaunchParams params(browser()->profile(), extension, |
| 1357 extension, | 1358 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, |
| 1358 extensions::LAUNCH_CONTAINER_NONE, | 1359 extensions::SOURCE_UNTRACKED); |
| 1359 NEW_WINDOW); | |
| 1360 params.command_line = *CommandLine::ForCurrentProcess(); | 1360 params.command_line = *CommandLine::ForCurrentProcess(); |
| 1361 OpenApplication(params); | 1361 OpenApplication(params); |
| 1362 } | 1362 } |
| 1363 }; | 1363 }; |
| 1364 | 1364 |
| 1365 // Load a packaged app, and wait for it to successfully post a "hello" message | 1365 // Load a packaged app, and wait for it to successfully post a "hello" message |
| 1366 // back. | 1366 // back. |
| 1367 IN_PROC_BROWSER_TEST_F(PackagedAppTest, SuccessfulLoad) { | 1367 IN_PROC_BROWSER_TEST_F(PackagedAppTest, SuccessfulLoad) { |
| 1368 ExtensionTestMessageListener listener("hello", true); | 1368 ExtensionTestMessageListener listener("hello", true); |
| 1369 LaunchTestingApp(); | 1369 LaunchTestingApp(); |
| 1370 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 1370 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 1371 } | 1371 } |
| OLD | NEW |