Commit cd6b5c92 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Compile some ios_chrome_web_egtest files with EG2.

This CL makes changes to the files, so they compiled without errors
with EG2. Updated EG1 build target with proper EG1 defined.

This CL does not add files to EG2 target, because tests are failing
due to EG2 helper absence.
Relanding reverted: https://crrev.com/c/1632591

Patch 2 remove changes from forms_egtests.mm which broke slim-nav bot.

Bug: 922813
Change-Id: I1efbe63abdb7d5624d16af479e4fe68621272d50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637034Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Auto-Submit: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664871}
parent e51641dd
...@@ -317,6 +317,7 @@ source_set("unit_tests_internal") { ...@@ -317,6 +317,7 @@ source_set("unit_tests_internal") {
source_set("eg_tests") { source_set("eg_tests") {
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
defines = [ "CHROME_EARL_GREY_1" ]
testonly = true testonly = true
sources = [ sources = [
"browsing_egtest.mm", "browsing_egtest.mm",
......
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
// 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 <EarlGrey/EarlGrey.h>
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h" #import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
#import "ios/web/public/test/http_server/http_server.h" #import "ios/web/public/test/http_server/http_server.h"
#include "ios/web/public/test/http_server/http_server_util.h" #include "ios/web/public/test/http_server/http_server_util.h"
...@@ -39,8 +38,21 @@ const char kWindow2Closed[] = "window2.closed: true"; ...@@ -39,8 +38,21 @@ const char kWindow2Closed[] = "window2.closed: true";
@implementation ChildWindowOpenByDOMTestCase @implementation ChildWindowOpenByDOMTestCase
#if defined(CHROME_EARL_GREY_2)
+ (void)setUpForTestCase {
[super setUpForTestCase];
[self setUpHelper];
}
#elif defined(CHROME_EARL_GREY_1)
+ (void)setUp { + (void)setUp {
[super setUp]; [super setUp];
[self setUpHelper];
}
#else
#error Not an EarlGrey Test
#endif
+ (void)setUpHelper {
CHROME_EG_ASSERT_NO_ERROR( CHROME_EG_ASSERT_NO_ERROR(
[ChromeEarlGrey setContentSettings:CONTENT_SETTING_ALLOW]); [ChromeEarlGrey setContentSettings:CONTENT_SETTING_ALLOW]);
web::test::SetUpFileBasedHttpServer(); web::test::SetUpFileBasedHttpServer();
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// 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 <EarlGrey/EarlGrey.h>
#include <functional> #include <functional>
#include <string> #include <string>
...@@ -11,6 +9,7 @@ ...@@ -11,6 +9,7 @@
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h" #import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
#include "ios/testing/embedded_test_server_handlers.h" #include "ios/testing/embedded_test_server_handlers.h"
#include "net/test/embedded_test_server/default_handlers.h" #include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_request.h"
......
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