OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/web_state/web_state_impl.h" | 5 #include "ios/web/web_state/web_state_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 })); | 587 })); |
588 base::test::ios::WaitUntilCondition(^bool() { | 588 base::test::ios::WaitUntilCondition(^bool() { |
589 return execution_result.get(); | 589 return execution_result.get(); |
590 }); | 590 }); |
591 | 591 |
592 std::string string_result; | 592 std::string string_result; |
593 execution_result->GetAsString(&string_result); | 593 execution_result->GetAsString(&string_result); |
594 EXPECT_EQ("bar", string_result); | 594 EXPECT_EQ("bar", string_result); |
595 } | 595 } |
596 | 596 |
| 597 // Tests loading progress. |
| 598 TEST_F(WebStateTest, LoadingProgress) { |
| 599 EXPECT_FLOAT_EQ(0.0, web_state_->GetLoadingProgress()); |
| 600 LoadHtml("<html></html>"); |
| 601 base::test::ios::WaitUntilCondition(^bool() { |
| 602 return web_state_->GetLoadingProgress() == 1.0; |
| 603 }); |
| 604 } |
| 605 |
597 } // namespace | 606 } // namespace |
598 } // namespace web | 607 } // namespace web |
OLD | NEW |