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 "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/login/login_prompt.h" | 11 #include "chrome/browser/ui/login/login_prompt.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 13 #include "chrome/common/extensions/extension_process_policy.h" |
13 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
14 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
15 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
16 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/render_widget_host.h" | 18 #include "content/public/browser/render_widget_host.h" |
18 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
19 #include "content/public/test/browser_test_utils.h" | 20 #include "content/public/test/browser_test_utils.h" |
20 #include "extensions/browser/api/web_request/web_request_api.h" | 21 #include "extensions/browser/api/web_request/web_request_api.h" |
21 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
22 #include "extensions/common/extension_builder.h" | 23 #include "extensions/common/extension_builder.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 listener_pageready.Reply(""); | 373 listener_pageready.Reply(""); |
373 EXPECT_TRUE(listener_contentscript.WaitUntilSatisfied()); | 374 EXPECT_TRUE(listener_contentscript.WaitUntilSatisfied()); |
374 EXPECT_TRUE(listener_framescript.WaitUntilSatisfied()); | 375 EXPECT_TRUE(listener_framescript.WaitUntilSatisfied()); |
375 | 376 |
376 // Collect the visited URLs. The content script and subframe does not run in | 377 // Collect the visited URLs. The content script and subframe does not run in |
377 // the extension's process, so the requests should be visible to the main | 378 // the extension's process, so the requests should be visible to the main |
378 // extension. | 379 // extension. |
379 listener_result.Reset(); | 380 listener_result.Reset(); |
380 listener_main2.Reply(""); | 381 listener_main2.Reply(""); |
381 EXPECT_TRUE(listener_result.WaitUntilSatisfied()); | 382 EXPECT_TRUE(listener_result.WaitUntilSatisfied()); |
382 if (content::AreAllSitesIsolatedForTesting()) { | 383 if (content::AreAllSitesIsolatedForTesting() || |
| 384 extensions::IsIsolateExtensionsEnabled()) { |
383 // With --site-per-process, the extension frame does run in the extension's | 385 // With --site-per-process, the extension frame does run in the extension's |
384 // process. | 386 // process. |
385 EXPECT_EQ("Intercepted requests: ?contentscript", | 387 EXPECT_EQ("Intercepted requests: ?contentscript", |
386 listener_result.message()); | 388 listener_result.message()); |
387 } else { | 389 } else { |
388 EXPECT_EQ("Intercepted requests: ?contentscript, ?framescript", | 390 EXPECT_EQ("Intercepted requests: ?contentscript, ?framescript", |
389 listener_result.message()); | 391 listener_result.message()); |
390 } | 392 } |
391 } | 393 } |
392 | 394 |
(...skipping 19 matching lines...) Expand all Loading... |
412 ExtensionTestMessageListener listener2("xmlhttprequest", false); | 414 ExtensionTestMessageListener listener2("xmlhttprequest", false); |
413 | 415 |
414 ASSERT_TRUE(LoadExtension( | 416 ASSERT_TRUE(LoadExtension( |
415 test_data_dir_.AppendASCII("webrequest_hosted_app"))); | 417 test_data_dir_.AppendASCII("webrequest_hosted_app"))); |
416 | 418 |
417 ui_test_utils::NavigateToURL(browser(), hosted_app_url); | 419 ui_test_utils::NavigateToURL(browser(), hosted_app_url); |
418 | 420 |
419 EXPECT_TRUE(listener1.WaitUntilSatisfied()); | 421 EXPECT_TRUE(listener1.WaitUntilSatisfied()); |
420 EXPECT_TRUE(listener2.WaitUntilSatisfied()); | 422 EXPECT_TRUE(listener2.WaitUntilSatisfied()); |
421 } | 423 } |
OLD | NEW |