Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / extensions / api / context_menus / context_menu_apitest.cc
blobe4cd9cff4b9d5e66573ab6bc2f28a921b779eca3
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
16 #if defined(SYZYASAN)
17 #define MAYBE_ContextMenus DISABLED_ContextMenus
18 #else
19 #define MAYBE_ContextMenus ContextMenus
20 #endif
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
29 // should work.
30 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContextMenusFromMultipleContexts) {
31 ASSERT_TRUE(test_server()->Start());
32 ASSERT_TRUE(RunExtensionTest("context_menus/add_from_multiple_contexts"))
33 << message_;
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