| 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 "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 Loading... |
| 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 } |
| OLD | NEW |