Index: content/public/test/browser_test_utils.cc |
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc |
index fac8957dbfd8e28c7518cbcb49e8401e6c04cdec..703202d0ff59cb9901dce5ef4755b19d05f6ce5b 100644 |
--- a/content/public/test/browser_test_utils.cc |
+++ b/content/public/test/browser_test_utils.cc |
@@ -29,6 +29,7 @@ |
#include "content/browser/web_contents/web_contents_view.h" |
#include "content/common/input/synthetic_web_input_event_builders.h" |
#include "content/common/input_messages.h" |
+#include "content/common/text_input_state.h" |
#include "content/common/view_messages.h" |
#include "content/public/browser/browser_context.h" |
#include "content/public/browser/histogram_fetcher.h" |
@@ -1223,4 +1224,18 @@ uint32_t InputMsgWatcher::WaitForAck() { |
return ack_result_; |
} |
+TextInputStateTestExport::TextInputStateTestExport( |
+ const ui::TextInputType& type, |
+ const std::string& value) |
+ : type_(type), value_(value) {} |
+ |
+// static |
+TextInputStateTestExport TextInputStateTestExport::FromWebContents( |
+ WebContents* web_contents) { |
+ TextInputState state = |
+ static_cast<WebContentsImpl*>(web_contents)->GetTextInputState(); |
+ |
+ return TextInputStateTestExport(state.type, state.value); |
+} |
+ |
} // namespace content |