| 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 "chrome/browser/extensions/extension_action.h" | 5 #include "chrome/browser/extensions/extension_action.h" |
| 6 #include "chrome/browser/extensions/extension_action_manager.h" | 6 #include "chrome/browser/extensions/extension_action_manager.h" |
| 7 #include "chrome/browser/extensions/extension_action_test_util.h" | 7 #include "chrome/browser/extensions/extension_action_test_util.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
| 10 #include "chrome/browser/extensions/test_extension_dir.h" | 10 #include "chrome/browser/extensions/test_extension_dir.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 "try {\n" | 614 "try {\n" |
| 615 // "Complex" selector: | 615 // "Complex" selector: |
| 616 " new PageStateMatcher({css: ['div input']});\n" | 616 " new PageStateMatcher({css: ['div input']});\n" |
| 617 " Return('Failed to throw');\n" | 617 " Return('Failed to throw');\n" |
| 618 "} catch (e) {\n" | 618 "} catch (e) {\n" |
| 619 " Return(e.message);\n" | 619 " Return(e.message);\n" |
| 620 "}\n"), | 620 "}\n"), |
| 621 testing::ContainsRegex("compound selector.*: div input$")); | 621 testing::ContainsRegex("compound selector.*: div input$")); |
| 622 } | 622 } |
| 623 | 623 |
| 624 // https://crbug.com/497586 |
| 625 IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, |
| 626 WebContentsWithoutTabAddedNotificationAtOnLoaded) { |
| 627 // Add a web contents to the tab strip in a way that doesn't trigger |
| 628 // NOTIFICATION_TAB_ADDED. |
| 629 content::WebContents* contents = content::WebContents::Create( |
| 630 content::WebContents::CreateParams(profile())); |
| 631 browser()->tab_strip_model()->AppendWebContents(contents, false); |
| 632 |
| 633 // The actual extension contents don't matter here -- we're just looking to |
| 634 // trigger OnExtensionLoaded. |
| 635 ext_dir_.WriteManifest(kDeclarativeContentManifest); |
| 636 ext_dir_.WriteFile(FILE_PATH_LITERAL("background.js"), kBackgroundHelpers); |
| 637 ASSERT_TRUE(LoadExtension(ext_dir_.unpacked_path())); |
| 638 } |
| 639 |
| 624 } // namespace | 640 } // namespace |
| 625 } // namespace extensions | 641 } // namespace extensions |
| OLD | NEW |