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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 180113003: Prepare for per frame did{Start,Stop}Loading calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 818629c57aa8aa4118d6fd10a2548ff40efc1525..c668b47f83c8cafff8d57581780f84ccbde10bd5 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -2221,6 +2221,40 @@ TEST_F(RenderViewImplTest, SendFaviconURLUpdateEvent) {
ViewHostMsg_UpdateFaviconURL::ID));
}
+// Test progress tracker messages.
+TEST_F(RenderViewImplTest, SendProgressCompletionUpdates) {
+ std::string data_url_string = "data:text/html,<body>placeholder</body>";
+ GURL url(data_url_string);
+ GetMainFrame()->loadRequest(blink::WebURLRequest(url));
+
+ EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching(
+ FrameHostMsg_DidStartLoading::ID));
+
+ // The load started, we should receive a start notification and a progress
+ // update with the minimum progress.
+ const IPC::Message* message = render_thread_->sink().GetFirstMessageMatching(
+ ViewHostMsg_DidChangeLoadProgress::ID);
+ EXPECT_TRUE(message);
+ Tuple1<double> progress_value;
+ ViewHostMsg_DidChangeLoadProgress::Read(message, &progress_value);
+ EXPECT_EQ(0.1, progress_value.a);
+ render_thread_->sink().ClearMessages();
+
+ ProcessPendingMessages();
+
+ // The data url has loaded, so we should see a progress change to 1.0 (done)
+ // and a stop notification.
+ message = render_thread_->sink().GetFirstMessageMatching(
+ ViewHostMsg_DidChangeLoadProgress::ID);
+ EXPECT_TRUE(message);
+ ViewHostMsg_DidChangeLoadProgress::Read(message, &progress_value);
+ EXPECT_EQ(1.0, progress_value.a);
+
+ EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching(
+ FrameHostMsg_DidStopLoading::ID));
+ render_thread_->sink().ClearMessages();
+}
+
TEST_F(RenderViewImplTest, FocusElementCallsFocusedNodeChanged) {
LoadHTML("<input id='test1' value='hello1'></input>"
"<input id='test2' value='hello2'></input>");
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698