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

Unified Diff: ios/web/public/test/web_js_test.h

Issue 2148723003: Improve ios/web/public/test/web_js_test.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@627775_all_in_one
Patch Set: DCHECK_NSEQ Created 4 years, 5 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/public/test/web_js_test.h
diff --git a/ios/web/public/test/web_js_test.h b/ios/web/public/test/web_js_test.h
index 74550e4de0784e1929b62adaee6b0345717b43c1..3785b05ecebf4f475a51263d5ab19e870cd4b5c0 100644
--- a/ios/web/public/test/web_js_test.h
+++ b/ios/web/public/test/web_js_test.h
@@ -20,7 +20,7 @@ template <class WebTestT>
class WebJsTest : public WebTestT {
public:
WebJsTest(NSArray* java_script_paths)
- : java_script_paths_([java_script_paths retain]) {}
+ : java_script_paths_([java_script_paths copy]) {}
protected:
// Loads |html| and inject JavaScripts at |javaScriptPaths_|.
@@ -60,11 +60,10 @@ class WebJsTest : public WebTestT {
template <class WebTestT>
void WebJsTest<WebTestT>::Inject() {
- // Wait until main web injection has occured.
- NSString* beacon = nil;
- do {
- beacon = WebTestT::EvaluateJavaScriptAsString(@"typeof __gCrWeb");
- } while (![beacon isEqualToString:@"object"]);
+ // Main web injection should have occured.
+ DCHECK_NSEQ(@"object",
+ WebTestT::EvaluateJavaScriptAsString(@"typeof __gCrWeb"));
+
for (NSString* java_script_path in java_script_paths_.get()) {
NSString* path =
[base::mac::FrameworkBundle() pathForResource:java_script_path
« 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