Commit 911807f0 authored by Yi Su's avatar Yi Su Committed by Commit Bot

Remove ios_web_shell_egtests.PDFTestCase.

ios_web_shell_egtests.PDFTestCase can be removed now since it's covered
by WebStateObserverTest.PdfFileUrlNavigation.

Bug: 930859
Change-Id: I5bfc34f825908b1380e52a7eb1e0a20450033661
Reviewed-on: https://chromium-review.googlesource.com/c/1486533
Commit-Queue: Yi Su <mrsuyi@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Auto-Submit: Yi Su <mrsuyi@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635143}
parent a01c5e3e
......@@ -22,7 +22,6 @@ ios_eg_test("ios_web_shell_egtests") {
"meta_tags_egtest.mm",
"navigation_egtest.mm",
"page_state_egtest.mm",
"pdf_egtest.mm",
"plugin_placeholder_egtest.mm",
"redirect_egtest.mm",
"service_manager_egtest.mm",
......@@ -101,7 +100,6 @@ bundle_data("bundle") {
sources = [
"http_server_files/basic_navigation_test.html",
"http_server_files/tall_page.html",
"http_server_files/testpage.pdf",
]
outputs = [
"{{bundle_resources_dir}}/{{source_root_relative_dir}}/" +
......
This diff was suppressed by a .gitattributes entry.
// Copyright 2016 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 "base/test/ios/wait_util.h"
#import "ios/web/public/test/earl_grey/web_view_matchers.h"
#import "ios/web/public/test/http_server/http_server.h"
#include "ios/web/public/test/http_server/http_server_util.h"
#import "ios/web/shell/test/app/web_shell_test_util.h"
#import "ios/web/shell/test/earl_grey/shell_earl_grey.h"
#import "ios/web/shell/test/earl_grey/web_shell_test_case.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace {
// URL spec for test PDF page.
const char kTestPDFURL[] =
"http://ios/web/shell/test/http_server_files/testpage.pdf";
// Matcher for WKWebView displaying PDF.
id<GREYMatcher> WebViewWithPdf() {
web::WebState* web_state = web::shell_test_util::GetCurrentWebState();
MatchesBlock matches = ^BOOL(UIView* view) {
return base::test::ios::WaitUntilConditionOrTimeout(
base::test::ios::kWaitForUIElementTimeout, ^{
return web_state->GetContentsMimeType() == "application/pdf";
});
};
DescribeToBlock describe = ^(id<GREYDescription> description) {
[description appendText:@"web view with PDF"];
};
return grey_allOf(
WebViewInWebState(web_state),
[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
descriptionBlock:describe],
nil);
}
} // namespace
using web::test::HttpServer;
// PDF test cases for the web shell.
@interface PDFTestCase : WebShellTestCase
@end
@implementation PDFTestCase
// Tests MIME type of the loaded PDF document.
- (void)testMIMEType {
web::test::SetUpFileBasedHttpServer();
[ShellEarlGrey loadURL:HttpServer::MakeUrl(kTestPDFURL)];
[[EarlGrey selectElementWithMatcher:WebViewWithPdf()]
assertWithMatcher:grey_notNil()];
}
@end
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