Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: chrome/test/ui/ppapi_uitest.cc

Issue 7677031: Try to reduce the flankness of the PPAPI UI tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/tests/testing_instance.h » ('j') | ppapi/tests/testing_instance.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ppapi_uitest.cc
===================================================================
--- chrome/test/ui/ppapi_uitest.cc (revision 97356)
+++ chrome/test/ui/ppapi_uitest.cc (working copy)
@@ -90,26 +90,33 @@
ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(test_url));
- // First wait for the "starting" signal. This cookie is set at the start
- // of every test. Waiting for this separately allows us to avoid a single
- // long timeout. Instead, we can have two timeouts which allow startup +
- // test execution time to take a while on a loaded computer, while also
- // making sure we're making forward progress.
- std::string startup_cookie =
- WaitUntilCookieNonEmpty(tab.get(), test_url,
- "STARTUP_COOKIE", TestTimeouts::action_max_timeout_ms());
+ // See comment above TestingInstance in the ppapi test plugin. Basically
polina 2011/08/22 23:53:58 a file path would be useful here
+ // it sets a series of numbered cookies. The value of "..." means it's
+ // still working and we should continue to wait, any other value indicates
+ // completion (in this case it will start with "PASS" or "FAIL". This
+ // keeps us from timing out on cookie waits for long tests.
polina 2011/08/22 23:53:58 missing closing ")"
+ int progress_number = 0;
+ std::string progress;
+ while (true) {
Paweł Hajdan Jr. 2011/08/18 22:45:13 NOOOOOOO! If you need a loop, you're doing it wron
Paweł Hajdan Jr. 2011/08/18 22:47:20 Ooops, please ignore my earlier comment. It's not
+ std::string cookie_name = StringPrintf("PPAPI_PROGRESS_%d",
polina 2011/08/22 23:53:58 Is it not an option to share "PPAPI_PROGRESS", "..
brettw 2011/08/24 16:42:17 Unfortunately, there's no code in common between t
+ progress_number);
+ progress = WaitUntilCookieNonEmpty(tab.get(), test_url,
+ cookie_name.c_str(), TestTimeouts::large_test_timeout_ms());
+ if (progress != "...")
+ break;
+ progress_number++;
+ }
- // If this fails, the plugin couldn't be loaded in the given amount of
- // time. This may mean the plugin was not found or possibly the system
- // can't load it due to missing symbols, etc.
- ASSERT_STREQ("STARTED", startup_cookie.c_str())
- << "Plugin couldn't be loaded. Make sure the PPAPI test plugin is "
- << "built, in the right place, and doesn't have any missing symbols.";
+ if (progress_number == 0) {
+ // Failing the first time probably means the plugin wasn't loaded.
+ ASSERT_FALSE(progress.empty())
+ << "Plugin couldn't be loaded. Make sure the PPAPI test plugin is "
+ << "built, in the right place, and doesn't have any missing symbols.";
+ } else {
+ ASSERT_FALSE(progress.empty()) << "Test timed out.";
+ }
- std::string escaped_value =
- WaitUntilCookieNonEmpty(tab.get(), test_url,
- "COMPLETION_COOKIE", TestTimeouts::large_test_timeout_ms());
- EXPECT_STREQ("PASS", escaped_value.c_str());
+ EXPECT_STREQ("PASS", progress.c_str());
}
};
« no previous file with comments | « no previous file | ppapi/tests/testing_instance.h » ('j') | ppapi/tests/testing_instance.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698