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
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/extension_action.h"
6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/test/base/ui_test_utils.h"
11 #include "extensions/test/result_catcher.h"
13 namespace extensions
{
15 // Times out on win syzyasan, http://crbug.com/166026
17 #define MAYBE_ContextMenus DISABLED_ContextMenus
19 #define MAYBE_ContextMenus ContextMenus
21 IN_PROC_BROWSER_TEST_F(ExtensionApiTest
, MAYBE_ContextMenus
) {
22 ASSERT_TRUE(RunExtensionTest("context_menus/basics")) << message_
;
23 ASSERT_TRUE(RunExtensionTest("context_menus/no_perms")) << message_
;
24 ASSERT_TRUE(RunExtensionTest("context_menus/item_ids")) << message_
;
25 ASSERT_TRUE(RunExtensionTest("context_menus/event_page")) << message_
;
28 // crbug.com/51436 -- creating context menus from multiple script contexts
30 IN_PROC_BROWSER_TEST_F(ExtensionApiTest
, ContextMenusFromMultipleContexts
) {
31 ASSERT_TRUE(test_server()->Start());
32 ASSERT_TRUE(RunExtensionTest("context_menus/add_from_multiple_contexts"))
34 const extensions::Extension
* extension
= GetSingleLoadedExtension();
35 ASSERT_TRUE(extension
) << message_
;
38 // Tell the extension to update the page action state.
39 ResultCatcher catcher
;
40 ui_test_utils::NavigateToURL(browser(),
41 extension
->GetResourceURL("popup.html"));
42 ASSERT_TRUE(catcher
.GetNextResult());
46 // Tell the extension to update the page action state again.
47 ResultCatcher catcher
;
48 ui_test_utils::NavigateToURL(browser(),
49 extension
->GetResourceURL("popup2.html"));
50 ASSERT_TRUE(catcher
.GetNextResult());
54 } // namespace extensions