Commit 7f7fafa7 authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

Removed ExternalURLTabUsageRecorderTestCase

Removed ExternalURLTabUsageRecorderTestCase since it contains only one
disabled Earl Grey test. After some evaluation of the intention of the
test, it is not clear what purpose it serves/served or whether the code
being tested isn't already covered by unit tests.

Bug: 852341
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I988f4fc5512b40f331db565af2424e03b5c23b79
Reviewed-on: https://chromium-review.googlesource.com/1171365Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Peter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582342}
parent c20cee27
......@@ -194,25 +194,6 @@ source_set("eg_tests") {
libs = [ "XCTest.framework" ]
}
# TODO(crbug.com/694662): These tests depend on loading errors, which are
# behaving differently when the network is not available. When the underlying
# issue is resolved, these tests can move back to |eg_tests|.
source_set("external_url_eg_tests") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [
"external_url_tab_usage_recorder_egtest.mm",
]
deps = [
":metrics_internal",
":test_support",
"//ios/chrome/test/app:test_support",
"//ios/chrome/test/earl_grey:test_support",
"//ios/web/public/test/http_server",
]
libs = [ "XCTest.framework" ]
}
source_set("test_support") {
testonly = true
sources = [
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <EarlGrey/EarlGrey.h>
#import "ios/chrome/browser/metrics/tab_usage_recorder.h"
#import "ios/chrome/browser/metrics/tab_usage_recorder_test_util.h"
#import "ios/chrome/test/app/histogram_test_util.h"
#import "ios/chrome/test/app/tab_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
#include "ios/web/public/test/http_server/http_server_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace {
const char kTestUrl[] =
"http://ios/testing/data/http_server_files/memory_usage.html";
} // namespace
// External URL test case class for TabUsageRecorder.
@interface ExternalURLTabUsageRecorderTestCase : ChromeTestCase
@end
@implementation ExternalURLTabUsageRecorderTestCase
// TODO(crbug.com/852341): This test is failing on devices and simulators.
// Verify correct recording of metrics when the reloading of an evicted tab
// fails.
- (void)DISABLED_testEvictedTabReloadFailure {
web::test::SetUpFileBasedHttpServer();
chrome_test_util::HistogramTester histogramTester;
FailureBlock failureBlock = ^(NSString* error) {
GREYFail(error);
};
// This URL is purposely invalid so it triggers a navigation error.
GURL invalidURL(kTestUrl);
chrome_test_util::OpenNewTab();
[ChromeEarlGrey loadURL:invalidURL];
[ChromeEarlGrey waitForErrorPage];
tab_usage_recorder_test_util::OpenNewIncognitoTabUsingUIAndEvictMainTabs();
tab_usage_recorder_test_util::SwitchToNormalMode();
[ChromeEarlGrey waitForErrorPage];
histogramTester.ExpectUniqueSample(kEvictedTabReloadSuccessRate,
TabUsageRecorder::LOAD_FAILURE, 1,
failureBlock);
histogramTester.ExpectUniqueSample(kDidUserWaitForEvictedTabReload,
TabUsageRecorder::USER_WAITED, 1,
failureBlock);
histogramTester.ExpectTotalCount(kEvictedTabReloadTime, 0, failureBlock);
}
@end
......@@ -201,7 +201,6 @@ chrome_ios_eg_test("ios_chrome_smoke_egtests") {
chrome_ios_eg_test("ios_chrome_external_url_egtests") {
deps = [
"//ios/chrome/browser/metrics:external_url_eg_tests",
"//ios/chrome/browser/translate:external_url_eg_tests",
]
}
......
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