| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "content/browser/frame_host/navigation_entry_impl.h" | 7 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/browser/web_contents/web_contents_view.h" | 9 #include "content/browser/web_contents/web_contents_view.h" |
| 10 #include "content/common/frame_messages.h" | 10 #include "content/common/frame_messages.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 } | 490 } |
| 491 | 491 |
| 492 // WebContentsDelegate: | 492 // WebContentsDelegate: |
| 493 void LoadProgressChanged(WebContents* source, double progress) override { | 493 void LoadProgressChanged(WebContents* source, double progress) override { |
| 494 EXPECT_TRUE(did_start_loading); | 494 EXPECT_TRUE(did_start_loading); |
| 495 EXPECT_FALSE(did_stop_loading); | 495 EXPECT_FALSE(did_stop_loading); |
| 496 progresses.push_back(progress); | 496 progresses.push_back(progress); |
| 497 } | 497 } |
| 498 | 498 |
| 499 // WebContentsObserver: | 499 // WebContentsObserver: |
| 500 void DidStartLoading(RenderViewHost* render_view_host) override { | 500 void DidStartLoading() override { |
| 501 EXPECT_FALSE(did_start_loading); | 501 EXPECT_FALSE(did_start_loading); |
| 502 EXPECT_EQ(0U, progresses.size()); | 502 EXPECT_EQ(0U, progresses.size()); |
| 503 EXPECT_FALSE(did_stop_loading); | 503 EXPECT_FALSE(did_stop_loading); |
| 504 did_start_loading = true; | 504 did_start_loading = true; |
| 505 } | 505 } |
| 506 | 506 |
| 507 void DidStopLoading(RenderViewHost* render_view_host) override { | 507 void DidStopLoading() override { |
| 508 EXPECT_TRUE(did_start_loading); | 508 EXPECT_TRUE(did_start_loading); |
| 509 EXPECT_GE(progresses.size(), 1U); | 509 EXPECT_GE(progresses.size(), 1U); |
| 510 EXPECT_FALSE(did_stop_loading); | 510 EXPECT_FALSE(did_stop_loading); |
| 511 did_stop_loading = true; | 511 did_stop_loading = true; |
| 512 } | 512 } |
| 513 | 513 |
| 514 bool did_start_loading; | 514 bool did_start_loading; |
| 515 std::vector<double> progresses; | 515 std::vector<double> progresses; |
| 516 bool did_stop_loading; | 516 bool did_stop_loading; |
| 517 }; | 517 }; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 scoped_ptr<FirstVisuallyNonEmptyPaintObserver> observer( | 635 scoped_ptr<FirstVisuallyNonEmptyPaintObserver> observer( |
| 636 new FirstVisuallyNonEmptyPaintObserver(shell())); | 636 new FirstVisuallyNonEmptyPaintObserver(shell())); |
| 637 | 637 |
| 638 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); | 638 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); |
| 639 | 639 |
| 640 observer->WaitForDidFirstVisuallyNonEmptyPaint(); | 640 observer->WaitForDidFirstVisuallyNonEmptyPaint(); |
| 641 ASSERT_TRUE(observer->did_fist_visually_non_empty_paint_); | 641 ASSERT_TRUE(observer->did_fist_visually_non_empty_paint_); |
| 642 } | 642 } |
| 643 | 643 |
| 644 } // namespace content | 644 } // namespace content |
| 645 | |
| OLD | NEW |