| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/automation/automation_util.h" | 8 #include "chrome/browser/automation/automation_util.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_test_message_listener.h" | 12 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 13 #include "chrome/browser/extensions/shell_window_registry.h" | 13 #include "chrome/browser/extensions/shell_window_registry.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 15 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
| 18 #include "chrome/browser/ui/extensions/application_launch.h" |
| 18 #include "chrome/browser/ui/extensions/shell_window.h" | 19 #include "chrome/browser/ui/extensions/shell_window.h" |
| 19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/extensions/extension_constants.h" | 21 #include "chrome/common/extensions/extension_constants.h" |
| 21 #include "chrome/test/base/ui_test_utils.h" | 22 #include "chrome/test/base/ui_test_utils.h" |
| 22 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/common/context_menu_params.h" | 24 #include "content/public/common/context_menu_params.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 25 #include "ui/base/models/menu_model.h" | 26 #include "ui/base/models/menu_model.h" |
| 26 | 27 |
| 27 using content::WebContents; | 28 using content::WebContents; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 content::NotificationService::AllSources()); | 63 content::NotificationService::AllSources()); |
| 63 | 64 |
| 64 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII("platform_apps"). | 65 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII("platform_apps"). |
| 65 AppendASCII(name))); | 66 AppendASCII(name))); |
| 66 | 67 |
| 67 ExtensionService* service = browser()->profile()->GetExtensionService(); | 68 ExtensionService* service = browser()->profile()->GetExtensionService(); |
| 68 const Extension* extension = service->GetExtensionById( | 69 const Extension* extension = service->GetExtensionById( |
| 69 last_loaded_extension_id_, false); | 70 last_loaded_extension_id_, false); |
| 70 EXPECT_TRUE(extension); | 71 EXPECT_TRUE(extension); |
| 71 | 72 |
| 72 Browser::OpenApplication( | 73 ApplicationLaunch::OpenApplication( |
| 73 browser()->profile(), | 74 browser()->profile(), |
| 74 extension, | 75 extension, |
| 75 extension_misc::LAUNCH_NONE, | 76 extension_misc::LAUNCH_NONE, |
| 76 GURL(), | 77 GURL(), |
| 77 NEW_WINDOW); | 78 NEW_WINDOW); |
| 78 | 79 |
| 79 app_loaded_observer.Wait(); | 80 app_loaded_observer.Wait(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 // Gets the WebContents associated with the first shell window that is found | 83 // Gets the WebContents associated with the first shell window that is found |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 set_cookie_url, | 187 set_cookie_url, |
| 187 browser()->GetWebContentsAt(0), | 188 browser()->GetWebContentsAt(0), |
| 188 &cookie_size, | 189 &cookie_size, |
| 189 &cookie_value); | 190 &cookie_value); |
| 190 ASSERT_EQ("testCookie=1", cookie_value); | 191 ASSERT_EQ("testCookie=1", cookie_value); |
| 191 | 192 |
| 192 // Let the platform app request the same URL, and make sure that it doesn't | 193 // Let the platform app request the same URL, and make sure that it doesn't |
| 193 // see the cookie. | 194 // see the cookie. |
| 194 ASSERT_TRUE(RunPlatformAppTest("platform_apps/isolation")) << message_; | 195 ASSERT_TRUE(RunPlatformAppTest("platform_apps/isolation")) << message_; |
| 195 } | 196 } |
| OLD | NEW |