Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
| 6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #import "ios/testing/wait_util.h" | 9 #import "ios/testing/wait_util.h" |
| 10 #import "ios/web/navigation/navigation_item_impl.h" | 10 #import "ios/web/navigation/navigation_item_impl.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 const char kPushStateId[] = "push-state"; | 42 const char kPushStateId[] = "push-state"; |
| 43 const char kReplaceStateId[] = "replace-state"; | 43 const char kReplaceStateId[] = "replace-state"; |
| 44 | 44 |
| 45 // JavaScript functions on the history state test page. | 45 // JavaScript functions on the history state test page. |
| 46 NSString* const kUpdateStateParamsScriptFormat = | 46 NSString* const kUpdateStateParamsScriptFormat = |
| 47 @"updateStateParams('%s', '%s', '%s')"; | 47 @"updateStateParams('%s', '%s', '%s')"; |
| 48 NSString* const kOnLoadCheckScript = @"isOnLoadPlaceholderTextVisible()"; | 48 NSString* const kOnLoadCheckScript = @"isOnLoadPlaceholderTextVisible()"; |
| 49 NSString* const kNoOpCheckScript = @"isNoOpPlaceholderTextVisible()"; | 49 NSString* const kNoOpCheckScript = @"isNoOpPlaceholderTextVisible()"; |
| 50 | 50 |
| 51 // Wait timeout for state updates. | 51 // Wait timeout for state updates. |
| 52 const NSTimeInterval kWaitForStateUpdateTimeout = 2.0; | 52 const NSTimeInterval kWaitForStateUpdateTimeout = 5.0; |
|
Eugene But (OOO till 7-30)
2017/03/13 22:52:53
Did this become flaky after this CL?:
https://code
michaeldo
2017/03/13 23:26:54
It has always been flaky. The messaging simply hel
| |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 // Test fixture for integration tests involving html5 window.history state | 56 // Test fixture for integration tests involving html5 window.history state |
| 57 // operations. | 57 // operations. |
| 58 class HistoryStateOperationsTest : public web::WebIntTest { | 58 class HistoryStateOperationsTest : public web::WebIntTest { |
| 59 protected: | 59 protected: |
| 60 void SetUp() override { | 60 void SetUp() override { |
| 61 web::WebIntTest::SetUp(); | 61 web::WebIntTest::SetUp(); |
| 62 | 62 |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 // Verify that url has been replaced. | 427 // Verify that url has been replaced. |
| 428 BOOL completed = | 428 BOOL completed = |
| 429 testing::WaitUntilConditionOrTimeout(kWaitForStateUpdateTimeout, ^{ | 429 testing::WaitUntilConditionOrTimeout(kWaitForStateUpdateTimeout, ^{ |
| 430 return GetLastCommittedItem()->GetURL() == new_url; | 430 return GetLastCommittedItem()->GetURL() == new_url; |
| 431 }); | 431 }); |
| 432 EXPECT_TRUE(completed) << "Failed to validate current url."; | 432 EXPECT_TRUE(completed) << "Failed to validate current url."; |
| 433 // Verify that the hashchange event was not fired. | 433 // Verify that the hashchange event was not fired. |
| 434 EXPECT_FALSE(static_cast<web::NavigationItemImpl*>(GetLastCommittedItem()) | 434 EXPECT_FALSE(static_cast<web::NavigationItemImpl*>(GetLastCommittedItem()) |
| 435 ->IsCreatedFromHashChange()); | 435 ->IsCreatedFromHashChange()); |
| 436 } | 436 } |
| OLD | NEW |