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

Unified Diff: ios/web/web_state/web_state_impl_unittest.mm

Issue 2611283003: [ios] Moved ASSERT_TRUE out of block in WebStateTest.ScriptExecution. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_impl_unittest.mm
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm
index 1099a04bc49be7371ec19607f0401019b2ea627a..fc85666610addb993c7dad4a287b98580e1c61c8 100644
--- a/ios/web/web_state/web_state_impl_unittest.mm
+++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -692,15 +692,17 @@ TEST_F(WebStateTest, ScriptExecution) {
// Execute script with callback.
__block std::unique_ptr<base::Value> execution_result;
+ __block bool execution_complete = false;
web_state_->ExecuteJavaScript(base::UTF8ToUTF16("window.foo"),
base::BindBlock(^(const base::Value* value) {
- ASSERT_TRUE(value);
execution_result = value->CreateDeepCopy();
+ execution_complete = true;
}));
- base::test::ios::WaitUntilCondition(^bool() {
- return execution_result.get();
+ base::test::ios::WaitUntilCondition(^{
+ return execution_complete;
});
+ ASSERT_TRUE(execution_result);
std::string string_result;
execution_result->GetAsString(&string_result);
EXPECT_EQ("bar", string_result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698