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" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_navigator.h" | 12 #include "chrome/browser/ui/browser_navigator.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/test/base/javascript_test_observer.h" | |
15 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
16 #include "chrome/test/nacl/nacl_browsertest_util.h" | 15 #include "chrome/test/nacl/nacl_browsertest_util.h" |
17 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
18 #include "content/public/common/url_constants.h" | 17 #include "content/public/common/url_constants.h" |
| 18 #include "content/public/test/javascript_test_observer.h" |
19 #include "content/public/test/test_renderer_host.h" | 19 #include "content/public/test/test_renderer_host.h" |
20 | 20 |
21 using content::RenderViewHost; | 21 using content::RenderViewHost; |
22 | 22 |
23 // This macro finesses macro expansion to do what we want. | 23 // This macro finesses macro expansion to do what we want. |
24 #define STRIP_PREFIXES(test_name) StripPrefixes(#test_name) | 24 #define STRIP_PREFIXES(test_name) StripPrefixes(#test_name) |
25 // Turn the given token into a string. This allows us to use precompiler stuff | 25 // Turn the given token into a string. This allows us to use precompiler stuff |
26 // to turn names into DISABLED_Foo, but still pass a string to RunTest. | 26 // to turn names into DISABLED_Foo, but still pass a string to RunTest. |
27 #define STRINGIFY(test_name) #test_name | 27 #define STRINGIFY(test_name) #test_name |
28 #define LIST_TEST(test_name) STRINGIFY(test_name) "," | 28 #define LIST_TEST(test_name) STRINGIFY(test_name) "," |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 GURL url = GetTestFileUrl("View_CreatedInvisible"); | 1198 GURL url = GetTestFileUrl("View_CreatedInvisible"); |
1199 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); | 1199 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); |
1200 params.disposition = NEW_BACKGROUND_TAB; | 1200 params.disposition = NEW_BACKGROUND_TAB; |
1201 ui_test_utils::NavigateToURL(¶ms); | 1201 ui_test_utils::NavigateToURL(¶ms); |
1202 } | 1202 } |
1203 | 1203 |
1204 // This test messes with tab visibility so is custom. | 1204 // This test messes with tab visibility so is custom. |
1205 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { | 1205 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { |
1206 // The plugin will be loaded in the foreground tab and will send us a message. | 1206 // The plugin will be loaded in the foreground tab and will send us a message. |
1207 PPAPITestMessageHandler handler; | 1207 PPAPITestMessageHandler handler; |
1208 JavascriptTestObserver observer( | 1208 content::JavascriptTestObserver observer( |
1209 browser()->tab_strip_model()->GetActiveWebContents(), | 1209 browser()->tab_strip_model()->GetActiveWebContents(), |
1210 &handler); | 1210 &handler); |
1211 | 1211 |
1212 GURL url = GetTestFileUrl("View_PageHideShow"); | 1212 GURL url = GetTestFileUrl("View_PageHideShow"); |
1213 ui_test_utils::NavigateToURL(browser(), url); | 1213 ui_test_utils::NavigateToURL(browser(), url); |
1214 | 1214 |
1215 ASSERT_TRUE(observer.Run()) << handler.error_message(); | 1215 ASSERT_TRUE(observer.Run()) << handler.error_message(); |
1216 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str()); | 1216 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str()); |
1217 observer.Reset(); | 1217 observer.Reset(); |
1218 | 1218 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 LIST_TEST(FlashDRM_GetHmonitor) | 1369 LIST_TEST(FlashDRM_GetHmonitor) |
1370 LIST_TEST(FlashDRM_GetVoucherFile)); | 1370 LIST_TEST(FlashDRM_GetVoucherFile)); |
1371 } | 1371 } |
1372 | 1372 |
1373 TEST_PPAPI_IN_PROCESS(TalkPrivate) | 1373 TEST_PPAPI_IN_PROCESS(TalkPrivate) |
1374 TEST_PPAPI_OUT_OF_PROCESS(TalkPrivate) | 1374 TEST_PPAPI_OUT_OF_PROCESS(TalkPrivate) |
1375 | 1375 |
1376 #if defined(OS_CHROMEOS) | 1376 #if defined(OS_CHROMEOS) |
1377 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate) | 1377 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate) |
1378 #endif | 1378 #endif |
OLD | NEW |