Commit 79b203d5 authored by Hiroshi Ichikawa's avatar Hiroshi Ichikawa Committed by Commit Bot

Rename WebViewIntTest to WebViewInttestBase.

This is mainly to avoid having two files with too similar names (web_view_inttest vs. web_view_int_test).

Also replaced Bind() with BindRepeating().

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I2988cd25cbcf24495fc7e039cf1610d03e15bff0
Reviewed-on: https://chromium-review.googlesource.com/1141447
Commit-Queue: Hiroshi Ichikawa <ichikawa@chromium.org>
Reviewed-by: default avatarJohn Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576409}
parent 996ba055
...@@ -11,9 +11,9 @@ source_set("inttests") { ...@@ -11,9 +11,9 @@ source_set("inttests") {
sources = [ sources = [
"scroll_view_kvo_inttest.mm", "scroll_view_kvo_inttest.mm",
"web_view_autofill_inttest.mm", "web_view_autofill_inttest.mm",
"web_view_int_test.h",
"web_view_int_test.mm",
"web_view_inttest.mm", "web_view_inttest.mm",
"web_view_inttest_base.h",
"web_view_inttest_base.mm",
"web_view_kvo_inttest.mm", "web_view_kvo_inttest.mm",
"web_view_restorable_state_inttest.mm", "web_view_restorable_state_inttest.mm",
"web_view_script_command_inttest.mm", "web_view_script_command_inttest.mm",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/web_view/test/observer.h" #import "ios/web_view/test/observer.h"
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h" #import "ios/web_view/test/web_view_test_util.h"
#include "testing/gtest_mac.h" #include "testing/gtest_mac.h"
...@@ -19,7 +19,7 @@ namespace ios_web_view { ...@@ -19,7 +19,7 @@ namespace ios_web_view {
// Tests that the KVO compliant properties of CWVScrollView correctly report // Tests that the KVO compliant properties of CWVScrollView correctly report
// changes. // changes.
typedef ios_web_view::WebViewIntTest ScrollViewKvoTest; typedef ios_web_view::WebViewInttestBase ScrollViewKvoTest;
// Tests that CWVScrollView correctly reports |contentOffset| state. // Tests that CWVScrollView correctly reports |contentOffset| state.
TEST_F(ScrollViewKvoTest, contentOffset) { TEST_F(ScrollViewKvoTest, contentOffset) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h" #import "ios/web_view/test/web_view_test_util.h"
#import "net/base/mac/url_conversions.h" #import "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
...@@ -47,7 +47,7 @@ NSString* const kTestFormHtml = ...@@ -47,7 +47,7 @@ NSString* const kTestFormHtml =
} // namespace } // namespace
// Tests autofill features in CWVWebViews. // Tests autofill features in CWVWebViews.
class WebViewAutofillTest : public WebViewIntTest { class WebViewAutofillTest : public WebViewInttestBase {
protected: protected:
WebViewAutofillTest() : autofill_controller_(web_view_.autofillController) {} WebViewAutofillTest() : autofill_controller_(web_view_.autofillController) {}
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h" #import "ios/web_view/test/web_view_test_util.h"
#import "net/base/mac/url_conversions.h" #import "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
...@@ -27,7 +27,7 @@ namespace ios_web_view { ...@@ -27,7 +27,7 @@ namespace ios_web_view {
// Tests public methods in CWVWebView. // Tests public methods in CWVWebView.
// //
// Note that some methods are covered by other tests in this directory. // Note that some methods are covered by other tests in this directory.
class WebViewTest : public ios_web_view::WebViewIntTest { class WebViewTest : public ios_web_view::WebViewInttestBase {
public: public:
void SetUp() override { void SetUp() override {
test_server_->RegisterRequestHandler(base::BindRepeating( test_server_->RegisterRequestHandler(base::BindRepeating(
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_ #ifndef IOS_WEB_VIEW_TEST_WEB_VIEW_INTTEST_BASE_H_
#define IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_ #define IOS_WEB_VIEW_TEST_WEB_VIEW_INTTEST_BASE_H_
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include <memory> #include <memory>
...@@ -28,10 +28,10 @@ namespace ios_web_view { ...@@ -28,10 +28,10 @@ namespace ios_web_view {
// A test fixture for testing CWVWebView. A test server is also created to // A test fixture for testing CWVWebView. A test server is also created to
// support loading content. The server supports the urls returned by the GetUrl* // support loading content. The server supports the urls returned by the GetUrl*
// methods below. // methods below.
class WebViewIntTest : public PlatformTest { class WebViewInttestBase : public PlatformTest {
protected: protected:
WebViewIntTest(); WebViewInttestBase();
~WebViewIntTest() override; ~WebViewInttestBase() override;
// Returns URL to an html page with title set to |title|. // Returns URL to an html page with title set to |title|.
// //
...@@ -63,4 +63,4 @@ class WebViewIntTest : public PlatformTest { ...@@ -63,4 +63,4 @@ class WebViewIntTest : public PlatformTest {
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_ #endif // IOS_WEB_VIEW_TEST_WEB_VIEW_INTTEST_BASE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import <ChromeWebView/ChromeWebView.h> #import <ChromeWebView/ChromeWebView.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
...@@ -96,24 +96,26 @@ std::unique_ptr<net::test_server::HttpResponse> TestRequestHandler( ...@@ -96,24 +96,26 @@ std::unique_ptr<net::test_server::HttpResponse> TestRequestHandler(
namespace ios_web_view { namespace ios_web_view {
WebViewIntTest::WebViewIntTest() WebViewInttestBase::WebViewInttestBase()
: web_view_(test::CreateWebView()), : web_view_(test::CreateWebView()),
test_server_(std::make_unique<net::EmbeddedTestServer>( test_server_(std::make_unique<net::EmbeddedTestServer>(
net::test_server::EmbeddedTestServer::TYPE_HTTP)) { net::test_server::EmbeddedTestServer::TYPE_HTTP)) {
test_server_->RegisterRequestHandler(base::Bind(&TestRequestHandler)); test_server_->RegisterRequestHandler(
base::BindRepeating(&TestRequestHandler));
} }
WebViewIntTest::~WebViewIntTest() = default; WebViewInttestBase::~WebViewInttestBase() = default;
GURL WebViewIntTest::GetUrlForPageWithTitle(const std::string& title) { GURL WebViewInttestBase::GetUrlForPageWithTitle(const std::string& title) {
return GetUrlForPageWithTitleAndBody(title, std::string()); return GetUrlForPageWithTitleAndBody(title, std::string());
} }
GURL WebViewIntTest::GetUrlForPageWithHtmlBody(const std::string& html) { GURL WebViewInttestBase::GetUrlForPageWithHtmlBody(const std::string& html) {
return GetUrlForPageWithTitleAndBody(std::string(), html); return GetUrlForPageWithTitleAndBody(std::string(), html);
} }
GURL WebViewIntTest::GetUrlForPageWithTitleAndBody(const std::string& title, GURL WebViewInttestBase::GetUrlForPageWithTitleAndBody(
const std::string& title,
const std::string& body) { const std::string& body) {
GURL url = test_server_->GetURL(kPageHtmlPath); GURL url = test_server_->GetURL(kPageHtmlPath);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "ios/web_view/test/observer.h" #import "ios/web_view/test/observer.h"
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h" #import "ios/web_view/test/web_view_test_util.h"
#import "net/base/mac/url_conversions.h" #import "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
...@@ -23,7 +23,7 @@ namespace ios_web_view { ...@@ -23,7 +23,7 @@ namespace ios_web_view {
// Tests that the KVO compliant properties of CWVWebView correctly report // Tests that the KVO compliant properties of CWVWebView correctly report
// changes. // changes.
typedef ios_web_view::WebViewIntTest WebViewKvoTest; typedef ios_web_view::WebViewInttestBase WebViewKvoTest;
// Tests that CWVWebView correctly reports |canGoBack| and |canGoForward| state. // Tests that CWVWebView correctly reports |canGoBack| and |canGoForward| state.
TEST_F(WebViewKvoTest, CanGoBackForward) { TEST_F(WebViewKvoTest, CanGoBackForward) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#import <ChromeWebView/ChromeWebView.h> #import <ChromeWebView/ChromeWebView.h>
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h" #import "ios/web_view/test/web_view_test_util.h"
#include "testing/gtest_mac.h" #include "testing/gtest_mac.h"
...@@ -16,7 +16,7 @@ namespace ios_web_view { ...@@ -16,7 +16,7 @@ namespace ios_web_view {
// Tests encodeRestorableStateWithCoder: and decodeRestorableStateWithCoder: // Tests encodeRestorableStateWithCoder: and decodeRestorableStateWithCoder:
// methods. // methods.
typedef ios_web_view::WebViewIntTest WebViewRestorableStateTest; typedef ios_web_view::WebViewInttestBase WebViewRestorableStateTest;
TEST_F(WebViewRestorableStateTest, EncodeDecode) { TEST_F(WebViewRestorableStateTest, EncodeDecode) {
// Load 2 URLs to create non-default state. // Load 2 URLs to create non-default state.
ASSERT_FALSE([web_view_ lastCommittedURL]); ASSERT_FALSE([web_view_ lastCommittedURL]);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/web_view/test/web_view_int_test.h" #import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h" #import "ios/web_view/test/web_view_test_util.h"
#import "net/base/mac/url_conversions.h" #import "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
namespace ios_web_view { namespace ios_web_view {
// Tests the script command feature in CWVWebView. // Tests the script command feature in CWVWebView.
using WebViewScriptCommandTest = WebViewIntTest; using WebViewScriptCommandTest = WebViewInttestBase;
// Tests that a handler added by -[CWVWebView // Tests that a handler added by -[CWVWebView
// addScriptCommandHandler:commandPrefix] is invoked by JavaScript. // addScriptCommandHandler:commandPrefix] is invoked by JavaScript.
......
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