OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 if (newtab_result) | 701 if (newtab_result) |
702 *newtab_result = newtab; | 702 *newtab_result = newtab; |
703 } | 703 } |
704 | 704 |
705 // Tests that an extension page can call window.open to an extension URL and | 705 // Tests that an extension page can call window.open to an extension URL and |
706 // the new window has extension privileges. | 706 // the new window has extension privileges. |
707 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenExtension) { | 707 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenExtension) { |
708 ASSERT_TRUE(LoadExtension( | 708 ASSERT_TRUE(LoadExtension( |
709 test_data_dir_.AppendASCII("uitest").AppendASCII("window_open"))); | 709 test_data_dir_.AppendASCII("uitest").AppendASCII("window_open"))); |
710 | 710 |
711 TabContents* newtab; | 711 TabContents* newtab = NULL; // clang, needs investigation |
712 ASSERT_NO_FATAL_FAILURE(WindowOpenHelper( | 712 ASSERT_NO_FATAL_FAILURE(WindowOpenHelper( |
713 browser(), | 713 browser(), |
714 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + | 714 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + |
715 "/test.html"), | 715 "/test.html"), |
716 "newtab.html", &newtab)); | 716 "newtab.html", &newtab)); |
717 | 717 |
718 bool result = false; | 718 bool result = false; |
719 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 719 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
720 newtab->render_view_host(), L"", L"testExtensionApi()", &result)); | 720 newtab->render_view_host(), L"", L"testExtensionApi()", &result)); |
721 EXPECT_TRUE(result); | 721 EXPECT_TRUE(result); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 L" window.chrome.app.isInstalled = false;" | 920 L" window.chrome.app.isInstalled = false;" |
921 L" return 'BAD: Should have thrown by now...';" | 921 L" return 'BAD: Should have thrown by now...';" |
922 L" } catch (e) {" | 922 L" } catch (e) {" |
923 L" return 'GOOD: Saw expected error.';" | 923 L" return 'GOOD: Saw expected error.';" |
924 L" }" | 924 L" }" |
925 L" }()" | 925 L" }()" |
926 L");", | 926 L");", |
927 &result)); | 927 &result)); |
928 EXPECT_EQ("GOOD: Saw expected error.", result); | 928 EXPECT_EQ("GOOD: Saw expected error.", result); |
929 } | 929 } |
OLD | NEW |