OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/test/test_timeouts.h" | |
7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
8 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/test/automation/tab_proxy.h" | 10 #include "chrome/test/automation/tab_proxy.h" |
10 #include "chrome/test/ui/ui_test.h" | 11 #include "chrome/test/ui/ui_test.h" |
11 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
12 #include "net/test/test_server.h" | 13 #include "net/test/test_server.h" |
13 #include "webkit/glue/plugins/plugin_switches.h" | 14 #include "webkit/glue/plugins/plugin_switches.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 FilePath(FILE_PATH_LITERAL("ppapi/tests"))); | 78 FilePath(FILE_PATH_LITERAL("ppapi/tests"))); |
78 ASSERT_TRUE(test_server.Start()); | 79 ASSERT_TRUE(test_server.Start()); |
79 RunTestURL(test_server.GetURL("files/test_case.html?" + test_case)); | 80 RunTestURL(test_server.GetURL("files/test_case.html?" + test_case)); |
80 } | 81 } |
81 | 82 |
82 private: | 83 private: |
83 void RunTestURL(const GURL& test_url) { | 84 void RunTestURL(const GURL& test_url) { |
84 scoped_refptr<TabProxy> tab(GetActiveTab()); | 85 scoped_refptr<TabProxy> tab(GetActiveTab()); |
85 ASSERT_TRUE(tab.get()); | 86 ASSERT_TRUE(tab.get()); |
86 ASSERT_TRUE(tab->NavigateToURL(test_url)); | 87 ASSERT_TRUE(tab->NavigateToURL(test_url)); |
88 | |
89 // First wait for the "starting" signal. This cookie is set at the start | |
90 // of every test. Waiting for this separately allows us to avoid a single | |
91 // long timeout. Instead, we can have two timeouts which allow startup + | |
92 // test execution time to take a while on a loaded computer, while also | |
93 // making sure we're making forward progress. | |
viettrungluu
2010/12/09 23:20:22
Uhm, this is all commented out?
| |
94 /* | |
95 std::string startup_cookie = | |
96 WaitUntilCookieNonEmpty(tab.get(), test_url, | |
97 "STARTUP_COOKIE", action_max_timeout_ms()); | |
98 | |
99 // If this fails, the plugin couldn't be loaded in the given amount of | |
100 // time. This may mean the plugin was not found or possibly the system | |
101 // can't load it due to missing symbols, etc. | |
102 ASSERT_STREQ("STARTED", startup_cookie.c_str()) | |
103 << "Plugin couldn't be loaded. Make sure the PPAPI test plugin is " | |
104 << "built, in the right place, and doesn't have any missing symbols."; | |
105 */ | |
106 | |
87 std::string escaped_value = | 107 std::string escaped_value = |
88 WaitUntilCookieNonEmpty(tab.get(), test_url, | 108 WaitUntilCookieNonEmpty(tab.get(), test_url, |
89 "COMPLETION_COOKIE", action_max_timeout_ms()); | 109 "COMPLETION_COOKIE", TestTimeouts::large_test_timeout_ms()); |
90 EXPECT_STREQ("PASS", escaped_value.c_str()); | 110 EXPECT_STREQ("PASS", escaped_value.c_str()); |
91 } | 111 } |
92 }; | 112 }; |
93 | 113 |
94 TEST_F(PPAPITest, FAILS_Instance) { | 114 TEST_F(PPAPITest, FAILS_Instance) { |
95 RunTest("Instance"); | 115 RunTest("Instance"); |
96 } | 116 } |
97 | 117 |
98 TEST_F(PPAPITest, Graphics2D) { | 118 TEST_F(PPAPITest, Graphics2D) { |
99 RunTest("Graphics2D"); | 119 RunTest("Graphics2D"); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 | 163 |
144 // TODO(dumi): figure out why this test is flaky / crashing. | 164 // TODO(dumi): figure out why this test is flaky / crashing. |
145 TEST_F(PPAPITest, DISABLED_FileRef) { | 165 TEST_F(PPAPITest, DISABLED_FileRef) { |
146 RunTestViaHTTP("FileRef"); | 166 RunTestViaHTTP("FileRef"); |
147 } | 167 } |
148 | 168 |
149 // http://crbug.com/63239 | 169 // http://crbug.com/63239 |
150 TEST_F(PPAPITest, DISABLED_DirectoryReader) { | 170 TEST_F(PPAPITest, DISABLED_DirectoryReader) { |
151 RunTestViaHTTP("DirectoryReader"); | 171 RunTestViaHTTP("DirectoryReader"); |
152 } | 172 } |
OLD | NEW |