| 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/ui/ppapi_uitest.h" | 5 #include "chrome/test/ui/ppapi_uitest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/string_util.h" |
| 11 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 12 #include "base/string_util.h" | |
| 13 #include "base/test/test_timeouts.h" | 13 #include "base/test/test_timeouts.h" |
| 14 #include "base/timer.h" | 14 #include "base/timer.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_navigator.h" | 17 #include "chrome/browser/ui/browser_navigator.h" |
| 18 #include "chrome/browser/ui/browser_tabstrip.h" | 18 #include "chrome/browser/ui/browser_tabstrip.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/test/base/in_process_browser_test.h" | 21 #include "chrome/test/base/in_process_browser_test.h" |
| 22 #include "chrome/test/base/test_launcher_utils.h" | 22 #include "chrome/test/base/test_launcher_utils.h" |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 TEST_PPAPI_IN_PROCESS(View_CreatedVisible); | 1073 TEST_PPAPI_IN_PROCESS(View_CreatedVisible); |
| 1074 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible); | 1074 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible); |
| 1075 TEST_PPAPI_NACL_VIA_HTTP(View_CreatedVisible); | 1075 TEST_PPAPI_NACL_VIA_HTTP(View_CreatedVisible); |
| 1076 // This test ensures that plugins created in a background tab have their | 1076 // This test ensures that plugins created in a background tab have their |
| 1077 // initial visibility set to false. We don't bother testing in-process for this | 1077 // initial visibility set to false. We don't bother testing in-process for this |
| 1078 // custom test since the out of process code also exercises in-process. | 1078 // custom test since the out of process code also exercises in-process. |
| 1079 | 1079 |
| 1080 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { | 1080 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { |
| 1081 // Make a second tab in the foreground. | 1081 // Make a second tab in the foreground. |
| 1082 GURL url = GetTestFileUrl("View_CreatedInvisible"); | 1082 GURL url = GetTestFileUrl("View_CreatedInvisible"); |
| 1083 browser::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); | 1083 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); |
| 1084 params.disposition = NEW_BACKGROUND_TAB; | 1084 params.disposition = NEW_BACKGROUND_TAB; |
| 1085 ui_test_utils::NavigateToURL(¶ms); | 1085 ui_test_utils::NavigateToURL(¶ms); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 // This test messes with tab visibility so is custom. | 1088 // This test messes with tab visibility so is custom. |
| 1089 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { | 1089 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { |
| 1090 // The plugin will be loaded in the foreground tab and will send us a message. | 1090 // The plugin will be loaded in the foreground tab and will send us a message. |
| 1091 TestFinishObserver observer( | 1091 TestFinishObserver observer( |
| 1092 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), | 1092 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
| 1093 TestTimeouts::action_max_timeout_ms()); | 1093 TestTimeouts::action_max_timeout_ms()); |
| 1094 | 1094 |
| 1095 GURL url = GetTestFileUrl("View_PageHideShow"); | 1095 GURL url = GetTestFileUrl("View_PageHideShow"); |
| 1096 ui_test_utils::NavigateToURL(browser(), url); | 1096 ui_test_utils::NavigateToURL(browser(), url); |
| 1097 | 1097 |
| 1098 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; | 1098 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
| 1099 EXPECT_STREQ("TestPageHideShow:Created", observer.result().c_str()); | 1099 EXPECT_STREQ("TestPageHideShow:Created", observer.result().c_str()); |
| 1100 observer.Reset(); | 1100 observer.Reset(); |
| 1101 | 1101 |
| 1102 // Make a new tab to cause the original one to hide, this should trigger the | 1102 // Make a new tab to cause the original one to hide, this should trigger the |
| 1103 // next phase of the test. | 1103 // next phase of the test. |
| 1104 browser::NavigateParams params( | 1104 chrome::NavigateParams params(browser(), GURL(chrome::kAboutBlankURL), |
| 1105 browser(), GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_LINK); | 1105 content::PAGE_TRANSITION_LINK); |
| 1106 params.disposition = NEW_FOREGROUND_TAB; | 1106 params.disposition = NEW_FOREGROUND_TAB; |
| 1107 ui_test_utils::NavigateToURL(¶ms); | 1107 ui_test_utils::NavigateToURL(¶ms); |
| 1108 | 1108 |
| 1109 // Wait until the test acks that it got hidden. | 1109 // Wait until the test acks that it got hidden. |
| 1110 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; | 1110 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
| 1111 EXPECT_STREQ("TestPageHideShow:Hidden", observer.result().c_str()); | 1111 EXPECT_STREQ("TestPageHideShow:Hidden", observer.result().c_str()); |
| 1112 | 1112 |
| 1113 // Wait for the test completion event. | 1113 // Wait for the test completion event. |
| 1114 observer.Reset(); | 1114 observer.Reset(); |
| 1115 | 1115 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) | 1166 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) |
| 1167 | 1167 |
| 1168 TEST_PPAPI_IN_PROCESS(MouseCursor) | 1168 TEST_PPAPI_IN_PROCESS(MouseCursor) |
| 1169 TEST_PPAPI_OUT_OF_PROCESS(MouseCursor) | 1169 TEST_PPAPI_OUT_OF_PROCESS(MouseCursor) |
| 1170 TEST_PPAPI_NACL_VIA_HTTP(MouseCursor) | 1170 TEST_PPAPI_NACL_VIA_HTTP(MouseCursor) |
| 1171 | 1171 |
| 1172 // Only enabled in out-of-process mode. | 1172 // Only enabled in out-of-process mode. |
| 1173 TEST_PPAPI_OUT_OF_PROCESS(FlashFile_CreateTemporaryFile) | 1173 TEST_PPAPI_OUT_OF_PROCESS(FlashFile_CreateTemporaryFile) |
| 1174 | 1174 |
| 1175 #endif // ADDRESS_SANITIZER | 1175 #endif // ADDRESS_SANITIZER |
| OLD | NEW |