Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: ios/web/shell/test/pdf_egtest.mm

Issue 2183583002: [ios] EarlGrey test for PDF Mime type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@css_selector_matcher
Patch Set: Fixed dangling reference inside the block Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/shell/test/http_server_files/testpage.pdf ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/test/pdf_egtest.mm
diff --git a/ios/web/shell/test/pdf_egtest.mm b/ios/web/shell/test/pdf_egtest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..6211c82ade279d06fcc30b0559fae03319b9c42b
--- /dev/null
+++ b/ios/web/shell/test/pdf_egtest.mm
@@ -0,0 +1,38 @@
+// 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 "ios/web/public/test/http_server.h"
+#include "ios/web/public/test/http_server_util.h"
+#include "ios/web/shell/test/app/navigation_test_util.h"
+#import "ios/web/shell/test/earl_grey/shell_base_test_case.h"
+#import "ios/web/shell/test/earl_grey/shell_matchers.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";
+} // namespace
+
+using web::shell_test_util::LoadUrl;
+using web::test::HttpServer;
+
+// PDF test cases for the web shell.
+@interface PDFTest : ShellBaseTestCase
+@end
+
+@implementation PDFTest
+
+// Tests MIME type of the loaded PDF document.
+- (void)testMIMEType {
+ web::test::SetUpFileBasedHttpServer();
+ LoadUrl(HttpServer::MakeUrl(kTestPDFURL));
+ [[EarlGrey selectElementWithMatcher:web::webViewMimeType("application/pdf")]
baxley 2016/07/26 18:21:36 Do you think this method is useful as a helper, wh
Eugene But (OOO till 7-30) 2016/07/27 01:15:46 I don't know the answer. I've made webViewInWebSta
+ assertWithMatcher:grey_notNil()];
+}
+
+@end
« no previous file with comments | « ios/web/shell/test/http_server_files/testpage.pdf ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698