Skip to content

Commit

Permalink
[ios] Removed deprecated ios/web/test/web_test.h.
Browse files Browse the repository at this point in the history
This header was split into 3 separate headers:
 ios/web/public/test/web_test.h
 ios/web/public/test/web_test_with_web_state.h
 ios/web/test/web_test_with_web_controller.h

BUG=619076

Review-Url: https://codereview.chromium.org/2063763002
Cr-Commit-Position: refs/heads/master@{#399554}
  • Loading branch information
eugenebut authored and Commit bot committed Jun 13, 2016
1 parent 7408e40 commit deaa823
Show file tree
Hide file tree
Showing 23 changed files with 157 additions and 163 deletions.
1 change: 0 additions & 1 deletion ios/web/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ source_set("test_support") {
"test/test_web_thread_bundle.cc",
"test/web_int_test.h",
"test/web_int_test.mm",
"test/web_test.h",
"test/web_test_suite.h",
"test/web_test_suite.mm",
"test/web_test_with_web_controller.h",
Expand Down
2 changes: 1 addition & 1 deletion ios/web/active_state_manager_impl_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ios/web/public/browser_state.h"
#include "ios/web/public/test/test_browser_state.h"
#include "ios/web/public/test/test_web_thread_bundle.h"
#import "ios/web/test/web_test.h"
#include "ios/web/public/test/web_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
Expand Down
1 change: 0 additions & 1 deletion ios/web/ios_web.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@
'test/test_web_thread_bundle.cc',
'test/web_int_test.h',
'test/web_int_test.mm',
'test/web_test.h',
'test/web_test_with_web_controller.h',
'test/web_test_with_web_controller.mm',
'test/web_test_suite.h',
Expand Down
3 changes: 2 additions & 1 deletion ios/web/net/crw_cert_verification_controller_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
#include "ios/web/net/crw_cert_verification_controller.h"

#include "base/mac/bind_objc_block.h"
#include "base/mac/scoped_nsobject.h"
#include "base/message_loop/message_loop.h"
#include "base/test/ios/wait_util.h"
#include "ios/web/public/test/web_test.h"
#include "ios/web/public/web_thread.h"
#import "ios/web/test/web_test.h"
#import "ios/web/web_state/wk_web_view_security_util.h"
#include "net/base/test_data_directory.h"
#include "net/cert/mock_cert_verifier.h"
Expand Down
3 changes: 2 additions & 1 deletion ios/web/net/crw_ssl_status_updater_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#import "ios/web/navigation/navigation_manager_impl.h"
#include "ios/web/public/cert_store.h"
#include "ios/web/public/navigation_item.h"
#import "ios/web/test/web_test.h"
#include "ios/web/public/ssl_status.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/web_state/wk_web_view_security_util.h"
#include "net/base/test_data_directory.h"
#include "net/test/cert_test_util.h"
Expand Down
6 changes: 3 additions & 3 deletions ios/web/public/test/web_test_with_web_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ class WebTestWithWebState : public WebTest,
web::WebState* web_state();
const web::WebState* web_state() const;

// The web controller for testing.
// TODO(crbug.com/619076): Remove this ivar.
base::WeakNSObject<CRWWebController> webController_;
// true if a task has been processed.
bool processed_a_task_;

Expand All @@ -74,6 +71,9 @@ class WebTestWithWebState : public WebTest,
NSString* CreateLoadCheck();
// The web state for testing.
std::unique_ptr<WebState> web_state_;
// The web controller for testing.
// TODO(crbug.com/619076): Remove this ivar.
base::WeakNSObject<CRWWebController> webController_;
};

} // namespace web
Expand Down
2 changes: 1 addition & 1 deletion ios/web/test/web_int_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import <WebKit/WebKit.h>

#include "ios/web/test/web_test.h"
#include "ios/web/public/test/web_test.h"

namespace web {

Expand Down
13 changes: 0 additions & 13 deletions ios/web/test/web_test.h

This file was deleted.

4 changes: 2 additions & 2 deletions ios/web/web_state/crw_pass_kit_downloader_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

#import "ios/web/web_state/crw_pass_kit_downloader.h"

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#include <memory>

#import "base/mac/scoped_nsobject.h"
#import "ios/web/test/web_test.h"
#include "ios/web/public/test/web_test.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/test_url_fetcher_factory.h"
Expand Down
4 changes: 2 additions & 2 deletions ios/web/web_state/js/common_js_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <Foundation/Foundation.h>

#include "base/macros.h"
#import "ios/web/test/web_test.h"
#import "ios/web/public/test/web_test_with_web_state.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"

Expand All @@ -27,7 +27,7 @@
namespace web {

// Test fixture to test common.js.
typedef web::WebTestWithWebController CommonJsTest;
typedef web::WebTestWithWebState CommonJsTest;

// Tests __gCrWeb.common.isTextField JavaScript API.
TEST_F(CommonJsTest, IsTestField) {
Expand Down
4 changes: 2 additions & 2 deletions ios/web/web_state/js/core_js_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "base/macros.h"
#include "base/strings/stringprintf.h"
#import "ios/web/test/web_test.h"
#import "ios/web/public/test/web_test_with_web_state.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"

Expand All @@ -25,7 +25,7 @@
namespace web {

// Test fixture to test core.js.
class CoreJsTest : public web::WebTestWithWebController {
class CoreJsTest : public web::WebTestWithWebState {
protected:
void ImageTesterHelper(
NSString* htmlForImage,
Expand Down
6 changes: 3 additions & 3 deletions ios/web/web_state/js/crw_js_injection_manager_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <stddef.h>
#import <Foundation/Foundation.h>

#import "ios/web/public/test/web_test_with_web_state.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
#import "ios/web/public/web_state/web_state.h"
#import "ios/web/test/web_test.h"
#include "testing/gtest_mac.h"

// Testing class of JsInjectioManager that has no dependencies.
Expand Down Expand Up @@ -158,10 +158,10 @@ - (NSArray*)directDependencies {
namespace web {

// Test fixture to test web controller injection.
class JsInjectionManagerTest : public web::WebTestWithWebController {
class JsInjectionManagerTest : public web::WebTestWithWebState {
protected:
void SetUp() override {
web::WebTestWithWebController::SetUp();
web::WebTestWithWebState::SetUp();
// Loads a dummy page to prepare JavaScript evaluation.
NSString* const kPageContent = @"<html><body><div></div></body></html>";
LoadHtml(kPageContent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/test/web_test.h"
#import "ios/web/web_state/ui/crw_wk_script_message_router.h"
#import "testing/gtest_mac.h"
#import "third_party/ocmock/OCMock/OCMock.h"
Expand Down
2 changes: 1 addition & 1 deletion ios/web/web_state/js/page_script_util_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/test/test_browser_state.h"
#import "ios/web/public/test/test_web_client.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/test/web_test.h"
#include "testing/gtest_mac.h"

namespace web {
Expand Down
10 changes: 5 additions & 5 deletions ios/web/web_state/ui/crw_web_controller_observer_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "ios/web/public/web_state/js/crw_js_injection_manager.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
#import "ios/web/test/crw_fake_web_controller_observer.h"
#import "ios/web/test/web_test.h"
#import "ios/web/test/web_test_with_web_controller.h"
#include "testing/gtest_mac.h"

namespace web {
Expand All @@ -24,11 +24,11 @@ void SetUp() override {
web::WebTestWithWebController::SetUp();
fake_web_controller_observer_.reset(
[[CRWFakeWebControllerObserver alloc] initWithCommandPrefix:@"test"]);
[webController_ addObserver:fake_web_controller_observer_];
[web_controller() addObserver:fake_web_controller_observer_];
}

void TearDown() override {
[webController_ removeObserver:fake_web_controller_observer_];
[web_controller() removeObserver:fake_web_controller_observer_];
fake_web_controller_observer_.reset();
web::WebTestWithWebController::TearDown();
}
Expand Down Expand Up @@ -63,7 +63,7 @@ void TearDown() override {
TEST_F(CRWWebControllerObserverTest, HandleImmediateCommand) {
LoadHtml(@"<p></p>");
ASSERT_NSNE(@"http://testimmediate#target",
[webController_ externalRequestWindowName]);
[web_controller() externalRequestWindowName]);
// The only valid immediate commands are window.unload and externalRequest.
base::DictionaryValue command;
command.SetString("command", "externalRequest");
Expand All @@ -77,7 +77,7 @@ void TearDown() override {
message.c_str()]);
WaitForBackgroundTasks();
ASSERT_NSEQ(@"http://testimmediate#target",
[webController_ externalRequestWindowName]);
[web_controller() externalRequestWindowName]);
}

// Send a large number of commands and check each one is immediately received.
Expand Down
Loading

0 comments on commit deaa823

Please sign in to comment.