OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/ref_counted.h" | 6 #include "base/ref_counted.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 9 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 "/test.html"), | 710 "/test.html"), |
711 "chrome-extension://thisissurelynotavalidextensionid/newtab.html", NULL)); | 711 "chrome-extension://thisissurelynotavalidextensionid/newtab.html", NULL)); |
712 | 712 |
713 // If we got to this point, we didn't crash, so we're good. | 713 // If we got to this point, we didn't crash, so we're good. |
714 } | 714 } |
715 | 715 |
716 // Tests that calling window.open from the newtab page to an extension URL | 716 // Tests that calling window.open from the newtab page to an extension URL |
717 // gives the new window extension privileges - even though the opening page | 717 // gives the new window extension privileges - even though the opening page |
718 // does not have extension privileges, we break the script connection, so | 718 // does not have extension privileges, we break the script connection, so |
719 // there is no privilege leak. | 719 // there is no privilege leak. |
720 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenNoPrivileges) { | 720 // TODO(creis): This is disabled until we can restore window.opener if the new |
| 721 // window is navigated back to the same site as the original page. See |
| 722 // http://crbug.com/65953. |
| 723 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_WindowOpenNoPrivileges) { |
721 ASSERT_TRUE(LoadExtension( | 724 ASSERT_TRUE(LoadExtension( |
722 test_data_dir_.AppendASCII("uitest").AppendASCII("window_open"))); | 725 test_data_dir_.AppendASCII("uitest").AppendASCII("window_open"))); |
723 | 726 |
724 TabContents* newtab; | 727 TabContents* newtab; |
725 ASSERT_NO_FATAL_FAILURE(WindowOpenHelper( | 728 ASSERT_NO_FATAL_FAILURE(WindowOpenHelper( |
726 browser(), | 729 browser(), |
727 GURL("about:blank"), | 730 GURL("about:blank"), |
728 std::string("chrome-extension://") + last_loaded_extension_id_ + | 731 std::string("chrome-extension://") + last_loaded_extension_id_ + |
729 "/newtab.html", | 732 "/newtab.html", |
730 &newtab)); | 733 &newtab)); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 L" window.chrome.app.isInstalled = false;" | 900 L" window.chrome.app.isInstalled = false;" |
898 L" return 'BAD: Should have thrown by now...';" | 901 L" return 'BAD: Should have thrown by now...';" |
899 L" } catch (e) {" | 902 L" } catch (e) {" |
900 L" return 'GOOD: Saw expected error.';" | 903 L" return 'GOOD: Saw expected error.';" |
901 L" }" | 904 L" }" |
902 L" }()" | 905 L" }()" |
903 L");", | 906 L");", |
904 &result)); | 907 &result)); |
905 EXPECT_EQ("GOOD: Saw expected error.", result); | 908 EXPECT_EQ("GOOD: Saw expected error.", result); |
906 } | 909 } |
OLD | NEW |