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") {
sources = [
"scroll_view_kvo_inttest.mm",
"web_view_autofill_inttest.mm",
"web_view_int_test.h",
"web_view_int_test.mm",
"web_view_inttest.mm",
"web_view_inttest_base.h",
"web_view_inttest_base.mm",
"web_view_kvo_inttest.mm",
"web_view_restorable_state_inttest.mm",
"web_view_script_command_inttest.mm",
......
......@@ -7,7 +7,7 @@
#import "base/test/ios/wait_util.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"
#include "testing/gtest_mac.h"
......@@ -19,7 +19,7 @@ namespace ios_web_view {
// Tests that the KVO compliant properties of CWVScrollView correctly report
// changes.
typedef ios_web_view::WebViewIntTest ScrollViewKvoTest;
typedef ios_web_view::WebViewInttestBase ScrollViewKvoTest;
// Tests that CWVScrollView correctly reports |contentOffset| state.
TEST_F(ScrollViewKvoTest, contentOffset) {
......
......@@ -8,7 +8,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.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 "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
......@@ -47,7 +47,7 @@ NSString* const kTestFormHtml =
} // namespace
// Tests autofill features in CWVWebViews.
class WebViewAutofillTest : public WebViewIntTest {
class WebViewAutofillTest : public WebViewInttestBase {
protected:
WebViewAutofillTest() : autofill_controller_(web_view_.autofillController) {}
......
......@@ -6,7 +6,7 @@
#import <Foundation/Foundation.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 "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
......@@ -27,7 +27,7 @@ namespace ios_web_view {
// Tests public methods in CWVWebView.
//
// 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:
void SetUp() override {
test_server_->RegisterRequestHandler(base::BindRepeating(
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_
#define 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_INTTEST_BASE_H_
#import <Foundation/Foundation.h>
#include <memory>
......@@ -28,10 +28,10 @@ namespace ios_web_view {
// 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*
// methods below.
class WebViewIntTest : public PlatformTest {
class WebViewInttestBase : public PlatformTest {
protected:
WebViewIntTest();
~WebViewIntTest() override;
WebViewInttestBase();
~WebViewInttestBase() override;
// Returns URL to an html page with title set to |title|.
//
......@@ -63,4 +63,4 @@ class WebViewIntTest : public PlatformTest {
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 @@
// Use of this source code is governed by a BSD-style license that can be
// 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 <Foundation/Foundation.h>
......@@ -96,25 +96,27 @@ std::unique_ptr<net::test_server::HttpResponse> TestRequestHandler(
namespace ios_web_view {
WebViewIntTest::WebViewIntTest()
WebViewInttestBase::WebViewInttestBase()
: web_view_(test::CreateWebView()),
test_server_(std::make_unique<net::EmbeddedTestServer>(
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());
}
GURL WebViewIntTest::GetUrlForPageWithHtmlBody(const std::string& html) {
GURL WebViewInttestBase::GetUrlForPageWithHtmlBody(const std::string& html) {
return GetUrlForPageWithTitleAndBody(std::string(), html);
}
GURL WebViewIntTest::GetUrlForPageWithTitleAndBody(const std::string& title,
const std::string& body) {
GURL WebViewInttestBase::GetUrlForPageWithTitleAndBody(
const std::string& title,
const std::string& body) {
GURL url = test_server_->GetURL(kPageHtmlPath);
// Encode |title| and |body| in url query in order to build the server
......
......@@ -8,7 +8,7 @@
#include "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.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 "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
......@@ -23,7 +23,7 @@ namespace ios_web_view {
// Tests that the KVO compliant properties of CWVWebView correctly report
// changes.
typedef ios_web_view::WebViewIntTest WebViewKvoTest;
typedef ios_web_view::WebViewInttestBase WebViewKvoTest;
// Tests that CWVWebView correctly reports |canGoBack| and |canGoForward| state.
TEST_F(WebViewKvoTest, CanGoBackForward) {
......
......@@ -4,7 +4,7 @@
#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"
#include "testing/gtest_mac.h"
......@@ -16,7 +16,7 @@ namespace ios_web_view {
// Tests encodeRestorableStateWithCoder: and decodeRestorableStateWithCoder:
// methods.
typedef ios_web_view::WebViewIntTest WebViewRestorableStateTest;
typedef ios_web_view::WebViewInttestBase WebViewRestorableStateTest;
TEST_F(WebViewRestorableStateTest, EncodeDecode) {
// Load 2 URLs to create non-default state.
ASSERT_FALSE([web_view_ lastCommittedURL]);
......
......@@ -6,7 +6,7 @@
#import <Foundation/Foundation.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 "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
......@@ -43,7 +43,7 @@
namespace ios_web_view {
// Tests the script command feature in CWVWebView.
using WebViewScriptCommandTest = WebViewIntTest;
using WebViewScriptCommandTest = WebViewInttestBase;
// Tests that a handler added by -[CWVWebView
// 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