Commit 7d379ce1 authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Add js injection receiver methods to test web state.

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ia5890c49825428177dbdc4c2a9429616bb92d747
Reviewed-on: https://chromium-review.googlesource.com/744521Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512852}
parent a4e3f2d5
......@@ -87,6 +87,7 @@ class TestWebState : public WebState {
// Setters for test data.
void SetBrowserState(BrowserState* browser_state);
void SetJSInjectionReceiver(CRWJSInjectionReceiver* injection_receiver);
void SetContentIsHTML(bool content_is_html);
void SetLoading(bool is_loading);
void SetCurrentURL(const GURL& url);
......@@ -109,6 +110,7 @@ class TestWebState : public WebState {
private:
BrowserState* browser_state_;
CRWJSInjectionReceiver* injection_receiver_;
bool web_usage_enabled_;
bool is_loading_;
bool is_visible_;
......
......@@ -128,7 +128,7 @@ void TestWebState::SetIsEvicted(bool value) {
}
CRWJSInjectionReceiver* TestWebState::GetJSInjectionReceiver() const {
return nullptr;
return injection_receiver_;
}
void TestWebState::ExecuteJavaScript(const base::string16& javascript) {}
......@@ -173,6 +173,11 @@ void TestWebState::SetBrowserState(BrowserState* browser_state) {
browser_state_ = browser_state;
}
void TestWebState::SetJSInjectionReceiver(
CRWJSInjectionReceiver* injection_receiver) {
injection_receiver_ = injection_receiver;
}
void TestWebState::SetContentIsHTML(bool content_is_html) {
content_is_html_ = content_is_html;
}
......
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