| 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 "chrome/test/ppapi/ppapi_test.h" | 5 #include "chrome/test/ppapi/ppapi_test.h" |
| 6 | 6 |
| 7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 TEST_PPAPI_IN_PROCESS(View_CreatedVisible); | 1108 TEST_PPAPI_IN_PROCESS(View_CreatedVisible); |
| 1109 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible); | 1109 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible); |
| 1110 TEST_PPAPI_NACL(View_CreatedVisible); | 1110 TEST_PPAPI_NACL(View_CreatedVisible); |
| 1111 // This test ensures that plugins created in a background tab have their | 1111 // This test ensures that plugins created in a background tab have their |
| 1112 // initial visibility set to false. We don't bother testing in-process for this | 1112 // initial visibility set to false. We don't bother testing in-process for this |
| 1113 // custom test since the out of process code also exercises in-process. | 1113 // custom test since the out of process code also exercises in-process. |
| 1114 | 1114 |
| 1115 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { | 1115 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { |
| 1116 // Make a second tab in the foreground. | 1116 // Make a second tab in the foreground. |
| 1117 GURL url = GetTestFileUrl("View_CreatedInvisible"); | 1117 GURL url = GetTestFileUrl("View_CreatedInvisible"); |
| 1118 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); | 1118 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK); |
| 1119 params.disposition = NEW_BACKGROUND_TAB; | 1119 params.disposition = NEW_BACKGROUND_TAB; |
| 1120 ui_test_utils::NavigateToURL(¶ms); | 1120 ui_test_utils::NavigateToURL(¶ms); |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 // This test messes with tab visibility so is custom. | 1123 // This test messes with tab visibility so is custom. |
| 1124 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_View_PageHideShow) { | 1124 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_View_PageHideShow) { |
| 1125 // The plugin will be loaded in the foreground tab and will send us a message. | 1125 // The plugin will be loaded in the foreground tab and will send us a message. |
| 1126 PPAPITestMessageHandler handler; | 1126 PPAPITestMessageHandler handler; |
| 1127 content::JavascriptTestObserver observer( | 1127 content::JavascriptTestObserver observer( |
| 1128 browser()->tab_strip_model()->GetActiveWebContents(), | 1128 browser()->tab_strip_model()->GetActiveWebContents(), |
| 1129 &handler); | 1129 &handler); |
| 1130 | 1130 |
| 1131 GURL url = GetTestFileUrl("View_PageHideShow"); | 1131 GURL url = GetTestFileUrl("View_PageHideShow"); |
| 1132 ui_test_utils::NavigateToURL(browser(), url); | 1132 ui_test_utils::NavigateToURL(browser(), url); |
| 1133 | 1133 |
| 1134 ASSERT_TRUE(observer.Run()) << handler.error_message(); | 1134 ASSERT_TRUE(observer.Run()) << handler.error_message(); |
| 1135 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str()); | 1135 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str()); |
| 1136 observer.Reset(); | 1136 observer.Reset(); |
| 1137 | 1137 |
| 1138 // Make a new tab to cause the original one to hide, this should trigger the | 1138 // Make a new tab to cause the original one to hide, this should trigger the |
| 1139 // next phase of the test. | 1139 // next phase of the test. |
| 1140 chrome::NavigateParams params( | 1140 chrome::NavigateParams params( |
| 1141 browser(), GURL(url::kAboutBlankURL), content::PAGE_TRANSITION_LINK); | 1141 browser(), GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_LINK); |
| 1142 params.disposition = NEW_FOREGROUND_TAB; | 1142 params.disposition = NEW_FOREGROUND_TAB; |
| 1143 ui_test_utils::NavigateToURL(¶ms); | 1143 ui_test_utils::NavigateToURL(¶ms); |
| 1144 | 1144 |
| 1145 // Wait until the test acks that it got hidden. | 1145 // Wait until the test acks that it got hidden. |
| 1146 ASSERT_TRUE(observer.Run()) << handler.error_message(); | 1146 ASSERT_TRUE(observer.Run()) << handler.error_message(); |
| 1147 EXPECT_STREQ("TestPageHideShow:Hidden", handler.message().c_str()); | 1147 EXPECT_STREQ("TestPageHideShow:Hidden", handler.message().c_str()); |
| 1148 observer.Reset(); | 1148 observer.Reset(); |
| 1149 | 1149 |
| 1150 // Switch back to the test tab. | 1150 // Switch back to the test tab. |
| 1151 browser()->tab_strip_model()->ActivateTabAt(0, true); | 1151 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 LIST_TEST(FlashDRM_GetHmonitor) | 1321 LIST_TEST(FlashDRM_GetHmonitor) |
| 1322 LIST_TEST(FlashDRM_GetVoucherFile)); | 1322 LIST_TEST(FlashDRM_GetVoucherFile)); |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 TEST_PPAPI_IN_PROCESS(TalkPrivate) | 1325 TEST_PPAPI_IN_PROCESS(TalkPrivate) |
| 1326 TEST_PPAPI_OUT_OF_PROCESS(TalkPrivate) | 1326 TEST_PPAPI_OUT_OF_PROCESS(TalkPrivate) |
| 1327 | 1327 |
| 1328 #if defined(OS_CHROMEOS) | 1328 #if defined(OS_CHROMEOS) |
| 1329 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate) | 1329 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate) |
| 1330 #endif | 1330 #endif |
| OLD | NEW |