diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 23:49:17 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 23:49:17 +0000 |
commit | bde9617672d03e32e98dfe5f5aa17d3bd568dd54 (patch) | |
tree | 1dbd7abbe9c26890c33d524bf9ddb0c6d8e6a7f0 /chrome_frame/test/test_with_web_server.h | |
parent | c12cfc336a84875997258a5425c077e4726ca2a5 (diff) | |
download | chromium_src-bde9617672d03e32e98dfe5f5aa17d3bd568dd54.zip chromium_src-bde9617672d03e32e98dfe5f5aa17d3bd568dd54.tar.gz chromium_src-bde9617672d03e32e98dfe5f5aa17d3bd568dd54.tar.bz2 |
Attempt to fix the flakiness associated with the ChromeFrame FullTabModeIE_TestMultipleGet and FullTabModeIE_TestPostReissue
tests. These tests expect the last request received to be /quit?OK. However at times it appears that we receive an additional
accept request which ends up failing this test.
Fix is to add a custom function which returns the request associated with a path. Changed the expectations accordingly.
Review URL: http://codereview.chromium.org/1903001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/test_with_web_server.h')
-rw-r--r-- | chrome_frame/test/test_with_web_server.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome_frame/test/test_with_web_server.h b/chrome_frame/test/test_with_web_server.h index f1c9334..2f3c05d7 100644 --- a/chrome_frame/test/test_with_web_server.h +++ b/chrome_frame/test/test_with_web_server.h @@ -129,6 +129,21 @@ class SimpleWebServerTest { return c->request(); } + bool FindRequest(const std::string& path, + const test_server::Request** request) { + test_server::ConnectionList::const_iterator index; + for (index = server_.connections().begin(); + index != server_.connections().end(); index++) { + const test_server::Connection* connection = *index; + if (!lstrcmpiA(connection->request().path().c_str(), path.c_str())) { + if (request) + *request = &connection->request(); + return true; + } + } + return false; + } + // Counts the number of times a page was requested. // Optionally checks if the request method for each is equal to // |expected_method|. If expected_method is NULL no such check is made. @@ -140,7 +155,8 @@ class SimpleWebServerTest { for (it = connections.begin(); it != connections.end(); ++it) { const test_server::Connection* c = (*it); const test_server::Request& r = c->request(); - if (ASCIIToWide(r.path().substr(1)).compare(page) == 0) { + if (!r.path().empty() && + ASCIIToWide(r.path().substr(1)).compare(page) == 0) { if (expected_method) { EXPECT_EQ(expected_method, r.method()); } |