OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 #include "extensions/test/result_catcher.h" |
| 7 |
| 8 namespace extensions { |
| 9 |
| 10 using AppWindowRestrictedApisBrowserTest = ExtensionBrowserTest; |
| 11 |
| 12 // Test that the window events like onbeforeunload event are correctly |
| 13 // clobbered. |
| 14 IN_PROC_BROWSER_TEST_F(AppWindowRestrictedApisBrowserTest, UnloadEvents) { |
| 15 ResultCatcher catcher; |
| 16 ASSERT_TRUE(LoadExtension( |
| 17 test_data_dir_.AppendASCII("app_forbidden_apis/onbeforeunload"))); |
| 18 ASSERT_TRUE(catcher.GetNextResult()); |
| 19 } |
| 20 |
| 21 // Test that Document apis like document.write are correctly clobbered. |
| 22 IN_PROC_BROWSER_TEST_F(AppWindowRestrictedApisBrowserTest, DocumentApis) { |
| 23 ResultCatcher catcher; |
| 24 ASSERT_TRUE(LoadExtension( |
| 25 test_data_dir_.AppendASCII("app_forbidden_apis/document_apis"))); |
| 26 ASSERT_TRUE(catcher.GetNextResult()); |
| 27 } |
| 28 |
| 29 } // namespace extensions |
OLD | NEW |