| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 #endif | 1015 #endif |
| 1016 TEST_PPAPI_NACL(MAYBE_View_CreatedVisible); | 1016 TEST_PPAPI_NACL(MAYBE_View_CreatedVisible); |
| 1017 | 1017 |
| 1018 // This test ensures that plugins created in a background tab have their | 1018 // This test ensures that plugins created in a background tab have their |
| 1019 // initial visibility set to false. We don't bother testing in-process for this | 1019 // initial visibility set to false. We don't bother testing in-process for this |
| 1020 // custom test since the out of process code also exercises in-process. | 1020 // custom test since the out of process code also exercises in-process. |
| 1021 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { | 1021 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { |
| 1022 // Make a second tab in the foreground. | 1022 // Make a second tab in the foreground. |
| 1023 GURL url = GetTestFileUrl("View_CreatedInvisible"); | 1023 GURL url = GetTestFileUrl("View_CreatedInvisible"); |
| 1024 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK); | 1024 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK); |
| 1025 params.disposition = NEW_BACKGROUND_TAB; | 1025 params.disposition = WindowOpenDisposition::NEW_BACKGROUND_TAB; |
| 1026 ui_test_utils::NavigateToURL(¶ms); | 1026 ui_test_utils::NavigateToURL(¶ms); |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 // This test messes with tab visibility so is custom. | 1029 // This test messes with tab visibility so is custom. |
| 1030 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_View_PageHideShow) { | 1030 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_View_PageHideShow) { |
| 1031 // The plugin will be loaded in the foreground tab and will send us a message. | 1031 // The plugin will be loaded in the foreground tab and will send us a message. |
| 1032 PPAPITestMessageHandler handler; | 1032 PPAPITestMessageHandler handler; |
| 1033 content::JavascriptTestObserver observer( | 1033 content::JavascriptTestObserver observer( |
| 1034 browser()->tab_strip_model()->GetActiveWebContents(), | 1034 browser()->tab_strip_model()->GetActiveWebContents(), |
| 1035 &handler); | 1035 &handler); |
| 1036 | 1036 |
| 1037 GURL url = GetTestFileUrl("View_PageHideShow"); | 1037 GURL url = GetTestFileUrl("View_PageHideShow"); |
| 1038 ui_test_utils::NavigateToURL(browser(), url); | 1038 ui_test_utils::NavigateToURL(browser(), url); |
| 1039 | 1039 |
| 1040 ASSERT_TRUE(observer.Run()) << handler.error_message(); | 1040 ASSERT_TRUE(observer.Run()) << handler.error_message(); |
| 1041 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str()); | 1041 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str()); |
| 1042 observer.Reset(); | 1042 observer.Reset(); |
| 1043 | 1043 |
| 1044 // Make a new tab to cause the original one to hide, this should trigger the | 1044 // Make a new tab to cause the original one to hide, this should trigger the |
| 1045 // next phase of the test. | 1045 // next phase of the test. |
| 1046 chrome::NavigateParams params( | 1046 chrome::NavigateParams params( |
| 1047 browser(), GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_LINK); | 1047 browser(), GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_LINK); |
| 1048 params.disposition = NEW_FOREGROUND_TAB; | 1048 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
| 1049 ui_test_utils::NavigateToURL(¶ms); | 1049 ui_test_utils::NavigateToURL(¶ms); |
| 1050 | 1050 |
| 1051 // Wait until the test acks that it got hidden. | 1051 // Wait until the test acks that it got hidden. |
| 1052 ASSERT_TRUE(observer.Run()) << handler.error_message(); | 1052 ASSERT_TRUE(observer.Run()) << handler.error_message(); |
| 1053 EXPECT_STREQ("TestPageHideShow:Hidden", handler.message().c_str()); | 1053 EXPECT_STREQ("TestPageHideShow:Hidden", handler.message().c_str()); |
| 1054 observer.Reset(); | 1054 observer.Reset(); |
| 1055 | 1055 |
| 1056 // Switch back to the test tab. | 1056 // Switch back to the test tab. |
| 1057 browser()->tab_strip_model()->ActivateTabAt(0, true); | 1057 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| 1058 | 1058 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); | 1255 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); |
| 1256 base::FilePath app_dir = data_dir.AppendASCII("ppapi") | 1256 base::FilePath app_dir = data_dir.AppendASCII("ppapi") |
| 1257 .AppendASCII("tests") | 1257 .AppendASCII("tests") |
| 1258 .AppendASCII("extensions") | 1258 .AppendASCII("extensions") |
| 1259 .AppendASCII(extension_dirname) | 1259 .AppendASCII(extension_dirname) |
| 1260 .AppendASCII(toolchain_); | 1260 .AppendASCII(toolchain_); |
| 1261 | 1261 |
| 1262 const extensions::Extension* extension = LoadExtension(app_dir); | 1262 const extensions::Extension* extension = LoadExtension(app_dir); |
| 1263 ASSERT_TRUE(extension); | 1263 ASSERT_TRUE(extension); |
| 1264 | 1264 |
| 1265 AppLaunchParams params(browser()->profile(), extension, | 1265 AppLaunchParams params( |
| 1266 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, | 1266 browser()->profile(), extension, extensions::LAUNCH_CONTAINER_NONE, |
| 1267 extensions::SOURCE_TEST); | 1267 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_TEST); |
| 1268 params.command_line = *base::CommandLine::ForCurrentProcess(); | 1268 params.command_line = *base::CommandLine::ForCurrentProcess(); |
| 1269 OpenApplication(params); | 1269 OpenApplication(params); |
| 1270 } | 1270 } |
| 1271 | 1271 |
| 1272 void RunTests(const std::string& extension_dirname) { | 1272 void RunTests(const std::string& extension_dirname) { |
| 1273 ExtensionTestMessageListener listener("PASS", false); | 1273 ExtensionTestMessageListener listener("PASS", false); |
| 1274 LaunchTestingApp(extension_dirname); | 1274 LaunchTestingApp(extension_dirname); |
| 1275 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 1275 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 1276 } | 1276 } |
| 1277 | 1277 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 MAYBE_PPAPI_NACL(NoSocketPermissions)) { | 1320 MAYBE_PPAPI_NACL(NoSocketPermissions)) { |
| 1321 RunTests("no_socket_permissions"); | 1321 RunTests("no_socket_permissions"); |
| 1322 } | 1322 } |
| 1323 | 1323 |
| 1324 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest, | 1324 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest, |
| 1325 MAYBE_PPAPI_NACL(SocketPermissions)) { | 1325 MAYBE_PPAPI_NACL(SocketPermissions)) { |
| 1326 RunTests("socket_permissions"); | 1326 RunTests("socket_permissions"); |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 #endif | 1329 #endif |
| OLD | NEW |