diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 07:58:05 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 07:58:05 +0000 |
commit | f46aff6ee482e56eb3e885c65cd8d5989ac133af (patch) | |
tree | 256e4da27837872305dde8cc7ef668189439e4b1 /chrome/test/ui/ui_test.cc | |
parent | ddc5288912f95a6cc89e93db5ef2c779b4a88838 (diff) | |
download | chromium_src-f46aff6ee482e56eb3e885c65cd8d5989ac133af.zip chromium_src-f46aff6ee482e56eb3e885c65cd8d5989ac133af.tar.gz chromium_src-f46aff6ee482e56eb3e885c65cd8d5989ac133af.tar.bz2 |
This fixes http://code.google.com/p/chromium/issues/detail?id=146&,
which was an issue with navigation attempts initiated by Flash not
working correctly in Chrome.
The plugin would initiate a navigation in response to a user click. This
would eventually result in a call to a script on the page, which would
query the history in a timer, and would end up resetting the selected
URL to the original URL as the history length would not be updated as
yet. The reason being the following:-
1. A Frame navigation is initiated by the renderer in response to the
user click.
2. This is sent as an async message to the browser UI thread.
3. When the navigation in the browser completes we update the history
info in render view asynchronously.
The fix is to attempt to update the history count when we receive notifications
from webkit. These include notifications for items being added to the history,
navigations based on history (like history.back/forward/goto, etc).
These counts continue to be updated as before from the browser as well.
Added UI tests to test these cases.
Bug=146
R=jam
Review URL: http://codereview.chromium.org/7412
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui/ui_test.cc')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 263b7b7..a9e799f 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -28,6 +28,7 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/test_file_util.h" #include "googleurl/src/gurl.h" +#include "net/base/net_util.h" bool UITest::in_process_renderer_ = false; bool UITest::in_process_plugins_ = false; @@ -586,5 +587,40 @@ void UITest::PrintResult(const std::wstring& measurement, trace.c_str(), value, units.c_str()); } +GURL UITest::GetTestUrl(const std::wstring& test_directory, + const std::wstring &test_case) { + std::wstring path; + PathService::Get(chrome::DIR_TEST_DATA, &path); + file_util::AppendToPath(&path, test_directory); + file_util::AppendToPath(&path, test_case); + return net::FilePathToFileURL(path); +} + +void UITest::WaitForFinish(const std::string &name, + const std::string &id, + const GURL &url, + const std::string& test_complete_cookie, + const std::string& expected_cookie_value, + const int wait_time) { + const int kIntervalMilliSeconds = 50; + // The webpage being tested has javascript which sets a cookie + // which signals completion of the test. The cookie name is + // a concatenation of the test name and the test id. This allows + // us to run multiple tests within a single webpage and test + // that they all c + std::string cookie_name = name; + cookie_name.append("."); + cookie_name.append(id); + cookie_name.append("."); + cookie_name.append(test_complete_cookie); + + scoped_ptr<TabProxy> tab(GetActiveTab()); + + bool test_result = WaitUntilCookieValue(tab.get(), url, + cookie_name.c_str(), + kIntervalMilliSeconds, wait_time, + expected_cookie_value.c_str()); + EXPECT_EQ(true, test_result); +} |