summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 19:44:20 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 19:44:20 +0000
commit72e6216d6db17ee1b67cf0110240f635c1bec38f (patch)
tree2af1169bc6cd973e98e4dd25f8cff01458be6042 /webkit
parentb1774f1af8852499efac6c358daf07c8d48b1f72 (diff)
downloadchromium_src-72e6216d6db17ee1b67cf0110240f635c1bec38f.zip
chromium_src-72e6216d6db17ee1b67cf0110240f635c1bec38f.tar.gz
chromium_src-72e6216d6db17ee1b67cf0110240f635c1bec38f.tar.bz2
Avoid flakiness related to progress notifications sometimes happening in a nested fashion. Due to the event sending controller, it is possible for the completion of one load to kick off another or lead to the cancelation of a third. These situations can easily result in DidStartLoading being called twice without a DidStopLoading in between, and vice versa.
Upstream DRT does not care about the progress notifications being ordered properly, and so I don't think we should either. R=tony Review URL: http://codereview.chromium.org/10888 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/mac/test_webview_delegate.mm16
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc16
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.h8
3 files changed, 5 insertions, 35 deletions
diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm
index f383b1c..0955b14 100644
--- a/webkit/tools/test_shell/mac/test_webview_delegate.mm
+++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm
@@ -85,19 +85,11 @@ void TestWebViewDelegate::OpenURL(WebView* webview, const GURL& url,
}
void TestWebViewDelegate::DidStartLoading(WebView* webview) {
- if (page_is_loading_) {
- LOG(ERROR) << "DidStartLoading called while loading";
- return;
- }
- page_is_loading_ = true;
+ // Ignored
}
void TestWebViewDelegate::DidStopLoading(WebView* webview) {
- if (!page_is_loading_) {
- LOG(ERROR) << "DidStopLoading called while not loading";
- return;
- }
- page_is_loading_ = false;
+ // Ignored
}
void TestWebViewDelegate::WindowObjectCleared(WebFrame* webframe) {
@@ -215,8 +207,6 @@ void TestWebViewDelegate::DidFailProvisionalLoadWithError(
GetFrameDescription(frame).c_str());
}
- if (page_is_loading_)
- DidStopLoading(webview);
LocationChangeDone(frame->GetProvisionalDataSource());
// Don't display an error page if we're running layout tests, because
@@ -290,8 +280,6 @@ void TestWebViewDelegate::DidFailLoadWithError(WebView* webview,
GetFrameDescription(frame).c_str());
}
- if (page_is_loading_)
- DidStopLoading(webview);
LocationChangeDone(frame->GetDataSource());
}
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 314f378..d3d4e0d 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -82,19 +82,11 @@ void TestWebViewDelegate::OpenURL(WebView* webview, const GURL& url,
}
void TestWebViewDelegate::DidStartLoading(WebView* webview) {
- if (page_is_loading_) {
- LOG(ERROR) << "DidStartLoading called while loading";
- return;
- }
- page_is_loading_ = true;
+ // Ignored
}
void TestWebViewDelegate::DidStopLoading(WebView* webview) {
- if (!page_is_loading_) {
- LOG(ERROR) << "DidStopLoading called while not loading";
- return;
- }
- page_is_loading_ = false;
+ // Ignored
}
void TestWebViewDelegate::WindowObjectCleared(WebFrame* webframe) {
@@ -212,8 +204,6 @@ void TestWebViewDelegate::DidFailProvisionalLoadWithError(
GetFrameDescription(frame).c_str());
}
- if (page_is_loading_)
- DidStopLoading(webview);
LocationChangeDone(frame->GetProvisionalDataSource());
// Don't display an error page if we're running layout tests, because
@@ -288,8 +278,6 @@ void TestWebViewDelegate::DidFailLoadWithError(WebView* webview,
GetFrameDescription(frame).c_str());
}
- if (page_is_loading_)
- DidStopLoading(webview);
LocationChangeDone(frame->GetDataSource());
}
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h
index bd03106a..48c0930 100644
--- a/webkit/tools/test_shell/test_webview_delegate.h
+++ b/webkit/tools/test_shell/test_webview_delegate.h
@@ -55,8 +55,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>,
typedef std::vector<CapturedContextMenuEvent> CapturedContextMenuEvents;
TestWebViewDelegate(TestShell* shell)
- : page_is_loading_(false),
- is_custom_policy_delegate_(false),
+ : is_custom_policy_delegate_(false),
shell_(shell),
top_loading_frame_(NULL),
page_id_(-1),
@@ -274,11 +273,6 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>,
std::wstring GetFrameDescription(WebFrame* webframe);
private:
- // True while a page is in the process of being loaded. This flag should
- // not be necessary, but it helps guard against mismatched messages for
- // starting and ending loading frames.
- bool page_is_loading_;
-
// Causes navigation actions just printout the intended navigation instead
// of taking you to the page. This is used for cases like mailto, where you
// don't actually want to open the mail program.