Commit 2de879b6 authored by vabr's avatar vabr Committed by Commit bot

Improve ios/web/public/test/web_js_test.h

This CL does some minor changes to web_js_test.h based on eugenebut's
recommendations in https://codereview.chromium.org/2150513002/#msg21.

R=eugenebut@chromium.org
BUG=627775

Review-Url: https://codereview.chromium.org/2148723003
Cr-Commit-Position: refs/heads/master@{#405234}
parent 99d59c53
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment