Commit 28703c1a authored by Nazerke's avatar Nazerke Committed by Commit Bot

[iOS][eg2] Convert tab grid egtest to EG2.

This CL
 - adds the source file to sources list,
 - adds required gn dependencies,
 - links to both eg1 and eg2 frameworks,
 - adds helper to +(void)setUp to support eg2.

Bug: 866147
Change-Id: I7b3b794b6ef11ac2eae114904764a00151f901e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893066
Auto-Submit: Nazerke Kalidolda <nazerke@google.com>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Nazerke Kalidolda <nazerke@google.com>
Cr-Commit-Position: refs/heads/master@{#712677}
parent e9c07b8f
...@@ -170,6 +170,7 @@ source_set("eg2_tests") { ...@@ -170,6 +170,7 @@ source_set("eg2_tests") {
] ]
testonly = true testonly = true
sources = [ sources = [
"tab_grid_egtest.mm",
"tab_grid_transition_egtest.mm", "tab_grid_transition_egtest.mm",
] ]
...@@ -180,6 +181,7 @@ source_set("eg2_tests") { ...@@ -180,6 +181,7 @@ source_set("eg2_tests") {
"//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2", "//ios/testing/earl_grey:eg_test_support+eg2",
"//ios/third_party/earl_grey2:test_lib", "//ios/third_party/earl_grey2:test_lib",
"//ios/web/public/test/http_server",
"//net:test_support", "//net:test_support",
] ]
libs = [ "UIKit.framework" ] libs = [ "UIKit.framework" ]
......
...@@ -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/stringprintf.h" #include "base/strings/stringprintf.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_constants.h" #import "ios/chrome/browser/ui/tab_grid/tab_grid_constants.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_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.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"
#import "ios/web/public/test/http_server/http_server_util.h" #import "ios/web/public/test/http_server/http_server_util.h"
...@@ -37,9 +36,22 @@ char kResponse3[] = "Test Page 3 content"; ...@@ -37,9 +36,22 @@ char kResponse3[] = "Test Page 3 content";
@implementation TabGridTestCase @implementation TabGridTestCase
#if defined(CHROME_EARL_GREY_2)
+ (void)setUpForTestCase {
[super setUpForTestCase];
[self setUpHelper];
}
#elif defined(CHROME_EARL_GREY_1)
// Set up called once for the class. // Set up called once for the class.
+ (void)setUp { + (void)setUp {
[super setUp]; [super setUp];
[self setUpHelper];
}
#else
#error Not an EarlGrey Test
#endif
+ (void)setUpHelper {
std::map<GURL, std::string> responses; std::map<GURL, std::string> responses;
const char kPageFormat[] = "<head><title>%s</title></head><body>%s</body>"; const char kPageFormat[] = "<head><title>%s</title></head><body>%s</body>";
responses[web::test::HttpServer::MakeUrl(kURL1)] = responses[web::test::HttpServer::MakeUrl(kURL1)] =
......
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