summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/guest_view
diff options
context:
space:
mode:
authorsammc <sammc@chromium.org>2015-01-22 17:21:54 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-23 01:23:21 +0000
commitc5eb526d0e15b28dbbbcaae87d82e022e413b20d (patch)
tree4712813291096e6b9d16f61dd691b01f6089bc41 /extensions/renderer/guest_view
parent354304bc08fc693965750b27070e59bee364a922 (diff)
downloadchromium_src-c5eb526d0e15b28dbbbcaae87d82e022e413b20d.zip
chromium_src-c5eb526d0e15b28dbbbcaae87d82e022e413b20d.tar.gz
chromium_src-c5eb526d0e15b28dbbbcaae87d82e022e413b20d.tar.bz2
Add a mimeHandler extension API.
This adds the mimeHandler extension API, which is a simplified version of the streamsPrivateApi. Unlike the streamsPrivateApi, mimeHandler only allows access to streams from RenderFrames within MimeHandlerViewGuests, and in particular only allows access to the stream being handled by that MimeHandlerViewGuest instance. This removes the need for an event to be dispatched to the background page and a user-exposed view_id. BUG=439867 Review URL: https://codereview.chromium.org/797183005 Cr-Commit-Position: refs/heads/master@{#312728}
Diffstat (limited to 'extensions/renderer/guest_view')
-rw-r--r--extensions/renderer/guest_view/mime_handler_view/mime_handler_view_browsertest.cc39
1 files changed, 30 insertions, 9 deletions
diff --git a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_browsertest.cc b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_browsertest.cc
index bfb3e7c..d4c33d6 100644
--- a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_browsertest.cc
+++ b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_browsertest.cc
@@ -28,26 +28,47 @@ class MimeHandlerViewTest : public ExtensionApiTest {
return extension;
}
+
+ void RunTest(const std::string& path) {
+ const extensions::Extension* extension = LoadTestExtension();
+ ASSERT_TRUE(extension);
+
+ extensions::ResultCatcher catcher;
+
+ GURL extension_url("chrome-extension://" + std::string(kExtensionId) + "/" +
+ path);
+ ui_test_utils::NavigateToURL(browser(), extension_url);
+
+ if (!catcher.GetNextResult())
+ FAIL() << catcher.message();
+ }
};
// Not working on Windows because of crbug.com/443466.
#if defined(OS_WIN)
#define MAYBE_PostMessage DISABLED_PostMessage
+#define MAYBE_Basic DISABLED_Basic
+#define MAYBE_Embedded DISABLED_Embedded
+#define MAYBE_Abort DISABLED_Abort
#else
#define MAYBE_PostMessage PostMessage
+#define MAYBE_Basic Basic
+#define MAYBE_Embedded Embedded
+#define MAYBE_Abort Abort
#endif
IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_PostMessage) {
- const extensions::Extension* extension = LoadTestExtension();
- ASSERT_TRUE(extension);
+ RunTest("test_postmessage.html");
+}
- extensions::ResultCatcher catcher;
+IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_Basic) {
+ RunTest("testBasic.csv");
+}
- GURL extension_url("chrome-extension://" +
- std::string(kExtensionId) +
- "/test_postmessage.html");
- ui_test_utils::NavigateToURL(browser(), extension_url);
+IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_Embedded) {
+ RunTest("test_embedded.html");
+}
- if (!catcher.GetNextResult())
- FAIL() << catcher.message();
+IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, MAYBE_Abort) {
+ RunTest("testAbort.csv");
}