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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc

Issue 2923433002: Move ExecuteScript method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Tweaked a comment in WebViewPlugin::WebViewHelper::main_frame [as suggested in CR feedback] Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/renderer/searchbox/searchbox_extension.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h" 5 #include "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return client; 205 return client;
206 } 206 }
207 207
208 void AnotherExtractionDone(bool success) { 208 void AnotherExtractionDone(bool success) {
209 success_ = success; 209 success_ = success;
210 message_loop_->QuitClosure().Run(); 210 message_loop_->QuitClosure().Run();
211 } 211 }
212 212
213 // Does the actual work of removing the iframe "frame1" from the document. 213 // Does the actual work of removing the iframe "frame1" from the document.
214 void RemoveIframe() { 214 void RemoveIframe() {
215 blink::WebFrame* main_frame = GetMainFrame(); 215 blink::WebLocalFrame* main_frame = GetMainFrame();
216 ASSERT_TRUE(main_frame); 216 ASSERT_TRUE(main_frame);
217 main_frame->ExecuteScript(blink::WebString( 217 main_frame->ExecuteScript(blink::WebString(
218 "document.body.removeChild(document.getElementById('frame1'));")); 218 "document.body.removeChild(document.getElementById('frame1'));"));
219 } 219 }
220 220
221 MockFeatureExtractorClock clock_; 221 MockFeatureExtractorClock clock_;
222 bool success_; 222 bool success_;
223 std::unique_ptr<TestPhishingDOMFeatureExtractor> extractor_; 223 std::unique_ptr<TestPhishingDOMFeatureExtractor> extractor_;
224 scoped_refptr<content::MessageLoopRunner> message_loop_; 224 scoped_refptr<content::MessageLoopRunner> message_loop_;
225 base::WeakPtrFactory<PhishingDOMFeatureExtractorTest> weak_factory_; 225 base::WeakPtrFactory<PhishingDOMFeatureExtractorTest> weak_factory_;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 "<html><head></head><body>" 569 "<html><head></head><body>"
570 "<iframe src=\"" + 570 "<iframe src=\"" +
571 net::EscapeForHTML(iframe1_url.spec()) + 571 net::EscapeForHTML(iframe1_url.spec()) +
572 "\" id=\"frame1\"></iframe>" 572 "\" id=\"frame1\"></iframe>"
573 "<form></form></body></html>"); 573 "<form></form></body></html>");
574 ExtractFeatures("host.com", html, &features); 574 ExtractFeatures("host.com", html, &features);
575 ExpectFeatureMapsAreEqual(features, expected_features); 575 ExpectFeatureMapsAreEqual(features, expected_features);
576 } 576 }
577 577
578 } // namespace safe_browsing 578 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/searchbox/searchbox_extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698