Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: chrome/browser/extensions/extension_context_menu_browsertest.cc

Issue 11226037: Incognito-allowed package apps produce duplicate items in context menu (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed unittest Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "chrome/app/chrome_command_ids.h" 6 #include "chrome/app/chrome_command_ids.h"
7 #include "chrome/browser/extensions/extension_browsertest.h" 7 #include "chrome/browser/extensions/extension_browsertest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 EXPECT_FALSE(menu->IsCommandIdChecked(command_id)); 559 EXPECT_FALSE(menu->IsCommandIdChecked(command_id));
560 560
561 // Executing the checkbox also fires the onClicked event. 561 // Executing the checkbox also fires the onClicked event.
562 ExtensionTestMessageListener listener("onClicked fired for checkbox1", false); 562 ExtensionTestMessageListener listener("onClicked fired for checkbox1", false);
563 menu->ExecuteCommand(command_id); 563 menu->ExecuteCommand(command_id);
564 checkbox_checked.WaitUntilClosed(); 564 checkbox_checked.WaitUntilClosed();
565 565
566 EXPECT_TRUE(menu->IsCommandIdChecked(command_id)); 566 EXPECT_TRUE(menu->IsCommandIdChecked(command_id));
567 ASSERT_TRUE(listener.WaitUntilSatisfied()); 567 ASSERT_TRUE(listener.WaitUntilSatisfied());
568 } 568 }
569
570 IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserTest,
571 IncognitoSplitContextMenuCount) {
572 ExtensionTestMessageListener created("created item regular", false);
573 ExtensionTestMessageListener created_incognito("created item incognito",
574 false);
575
576 // Create an incognito profile.
577 ASSERT_TRUE(browser()->profile()->GetOffTheRecordProfile());
578 ASSERT_TRUE(LoadContextMenuExtensionIncognito("incognito"));
579
580 // Wait for the extension's processes to tell us they've created an item.
581 ASSERT_TRUE(created.WaitUntilSatisfied());
582 ASSERT_TRUE(created_incognito.WaitUntilSatisfied());
583 ASSERT_EQ(2u, GetItems().size());
584
585 browser()->profile()->DestroyOffTheRecordProfile();
586 ASSERT_EQ(1u, GetItems().size());
587 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698