| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
| 6 #include "chrome/browser/apps/app_browsertest_util.h" | 6 #include "chrome/browser/apps/app_browsertest_util.h" |
| 7 #include "chrome/browser/extensions/extension_test_message_listener.h" | 7 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 8 #include "chrome/common/chrome_switches.h" | |
| 9 #include "chrome/test/base/ui_test_utils.h" | 8 #include "chrome/test/base/ui_test_utils.h" |
| 10 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
| 11 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| 12 #include "content/public/test/browser_test_utils.h" | 11 #include "content/public/test/browser_test_utils.h" |
| 13 #include "content/public/test/test_utils.h" | 12 #include "content/public/test/test_utils.h" |
| 14 #include "extensions/browser/guest_view/guest_view_manager.h" | 13 #include "extensions/browser/guest_view/guest_view_manager.h" |
| 15 #include "extensions/browser/guest_view/guest_view_manager_factory.h" | 14 #include "extensions/browser/guest_view/guest_view_manager_factory.h" |
| 15 #include "extensions/common/switches.h" |
| 16 #include "net/test/embedded_test_server/embedded_test_server.h" | 16 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 17 #include "net/test/embedded_test_server/http_request.h" | 17 #include "net/test/embedded_test_server/http_request.h" |
| 18 #include "net/test/embedded_test_server/http_response.h" | 18 #include "net/test/embedded_test_server/http_response.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class TestGuestViewManager : public extensions::GuestViewManager { | 22 class TestGuestViewManager : public extensions::GuestViewManager { |
| 23 public: | 23 public: |
| 24 explicit TestGuestViewManager(content::BrowserContext* context) : | 24 explicit TestGuestViewManager(content::BrowserContext* context) : |
| 25 extensions::GuestViewManager(context), | 25 extensions::GuestViewManager(context), |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 test_name.c_str(), | 125 test_name.c_str(), |
| 126 app_to_embed.c_str()))) { | 126 app_to_embed.c_str()))) { |
| 127 LOG(ERROR) << "UNABLE TO START TEST."; | 127 LOG(ERROR) << "UNABLE TO START TEST."; |
| 128 return; | 128 return; |
| 129 } | 129 } |
| 130 ASSERT_TRUE(done_listener.WaitUntilSatisfied()); | 130 ASSERT_TRUE(done_listener.WaitUntilSatisfied()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 134 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 135 command_line->AppendSwitch(switches::kEnableAppView); | 135 command_line->AppendSwitch(extensions::switches::kEnableAppView); |
| 136 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | 136 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 137 } | 137 } |
| 138 | 138 |
| 139 TestGuestViewManagerFactory factory_; | 139 TestGuestViewManagerFactory factory_; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 // Tests that <appview> is able to navigate to another installed app. | 142 // Tests that <appview> is able to navigate to another installed app. |
| 143 IN_PROC_BROWSER_TEST_F(AppViewTest, TestAppViewBasic) { | 143 IN_PROC_BROWSER_TEST_F(AppViewTest, TestAppViewBasic) { |
| 144 const extensions::Extension* skeleton_app = | 144 const extensions::Extension* skeleton_app = |
| 145 InstallPlatformApp("app_view/shim/skeleton"); | 145 InstallPlatformApp("app_view/shim/skeleton"); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 161 | 161 |
| 162 // Tests that <appview> correctly processes parameters passed on connect. | 162 // Tests that <appview> correctly processes parameters passed on connect. |
| 163 IN_PROC_BROWSER_TEST_F(AppViewTest, TestAppViewGoodDataShouldSucceed) { | 163 IN_PROC_BROWSER_TEST_F(AppViewTest, TestAppViewGoodDataShouldSucceed) { |
| 164 const extensions::Extension* skeleton_app = | 164 const extensions::Extension* skeleton_app = |
| 165 InstallPlatformApp("app_view/shim/skeleton"); | 165 InstallPlatformApp("app_view/shim/skeleton"); |
| 166 TestHelper("testAppViewGoodDataShouldSucceed", | 166 TestHelper("testAppViewGoodDataShouldSucceed", |
| 167 "app_view/shim", | 167 "app_view/shim", |
| 168 skeleton_app->id(), | 168 skeleton_app->id(), |
| 169 NO_TEST_SERVER); | 169 NO_TEST_SERVER); |
| 170 } | 170 } |
| OLD | NEW |