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

Side by Side Diff: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_browsertest.cc

Issue 878773002: Add a test for mime handler view iframes and make them work on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/guest_view/mime_handler_view/mime_handler_view_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/base_paths.h"
6 #include "base/files/file_util.h"
7 #include "base/path_service.h"
8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/test/base/ui_test_utils.h"
10 #include "content/public/test/browser_test_utils.h"
11 #include "extensions/browser/extension_registry.h"
12 #include "extensions/test/result_catcher.h"
13
14 // The test extension id is set by the key value in the manifest.
15 const char* kExtensionId = "oickdpebdnfbgkcaoklfcdhjniefkcji";
16
17 class MimeHandlerViewTest : public ExtensionApiTest {
18 public:
19 ~MimeHandlerViewTest() override {}
20
21 const extensions::Extension* LoadTestExtension() {
22 const extensions::Extension* extension = LoadExtension(
23 test_data_dir_.AppendASCII("mime_handler_view"));
24 if (!extension)
25 return nullptr;
26
27 CHECK_EQ(std::string(kExtensionId), extension->id());
28
29 return extension;
30 }
31
32 void RunTest(const std::string& path) {
33 const extensions::Extension* extension = LoadTestExtension();
34 ASSERT_TRUE(extension);
35
36 extensions::ResultCatcher catcher;
37
38 GURL extension_url("chrome-extension://" + std::string(kExtensionId) + "/" +
39 path);
40 ui_test_utils::NavigateToURL(browser(), extension_url);
41
42 if (!catcher.GetNextResult())
43 FAIL() << catcher.message();
44 }
45 };
46
47 // Not working on Windows because of crbug.com/443466.
48 #if defined(OS_WIN)
49 #define MAYBE_PostMessage DISABLED_PostMessage
50 #define MAYBE_Basic DISABLED_Basic
51 #define MAYBE_Embedded DISABLED_Embedded
52 #define MAYBE_Abort DISABLED_Abort
53 #else
54 #define MAYBE_PostMessage PostMessage
55 #define MAYBE_Basic Basic
56 #define MAYBE_Embedded Embedded
57 #define MAYBE_Abort Abort
58 #endif
59
60 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_PostMessage) {
61 RunTest("test_postmessage.html");
62 }
63
64 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_Basic) {
65 RunTest("testBasic.csv");
66 }
67
68 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_Embedded) {
69 RunTest("test_embedded.html");
70 }
71
72 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_Abort) {
73 RunTest("testAbort.csv");
74 }
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/mime_handler_view/mime_handler_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698