ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / extensions / browser / guest_view / mime_handler_view / mime_handler_view_browsertest.cc
blob5b09caf3beeb4e9ff1b914dcf032c1b4b662fedb
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.
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 #include "net/test/embedded_test_server/embedded_test_server.h"
15 // The test extension id is set by the key value in the manifest.
16 const char* kExtensionId = "oickdpebdnfbgkcaoklfcdhjniefkcji";
18 class MimeHandlerViewTest : public ExtensionApiTest {
19 public:
20 ~MimeHandlerViewTest() override {}
22 const extensions::Extension* LoadTestExtension() {
23 const extensions::Extension* extension =
24 LoadExtension(test_data_dir_.AppendASCII("mime_handler_view"));
25 if (!extension)
26 return nullptr;
28 CHECK_EQ(std::string(kExtensionId), extension->id());
30 return extension;
33 void RunTest(const std::string& path) {
34 const extensions::Extension* extension = LoadTestExtension();
35 ASSERT_TRUE(extension);
37 ASSERT_TRUE(StartEmbeddedTestServer());
38 embedded_test_server()->ServeFilesFromDirectory(
39 test_data_dir_.AppendASCII("mime_handler_view"));
41 extensions::ResultCatcher catcher;
43 ui_test_utils::NavigateToURL(browser(),
44 embedded_test_server()->GetURL("/" + path));
46 if (!catcher.GetNextResult())
47 FAIL() << catcher.message();
51 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, PostMessage) {
52 RunTest("test_postmessage.html");
55 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, Basic) {
56 RunTest("testBasic.csv");
59 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, Embedded) {
60 RunTest("test_embedded.html");
63 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, Iframe) {
64 RunTest("test_iframe.html");
67 IN_PROC_BROWSER_TEST_F(MimeHandlerViewTest, Abort) {
68 RunTest("testAbort.csv");