| 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/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
| 7 #include "chrome/browser/extensions/lazy_background_page_test_util.h" | 7 #include "chrome/browser/extensions/lazy_background_page_test_util.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 9 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserTest, MAYBE_IncognitoSplit) { | 527 IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserTest, MAYBE_IncognitoSplit) { |
| 528 ExtensionTestMessageListener created("created item regular", false); | 528 ExtensionTestMessageListener created("created item regular", false); |
| 529 ExtensionTestMessageListener created_incognito("created item incognito", | 529 ExtensionTestMessageListener created_incognito("created item incognito", |
| 530 false); | 530 false); |
| 531 | 531 |
| 532 ExtensionTestMessageListener onclick("onclick fired regular", false); | 532 ExtensionTestMessageListener onclick("onclick fired regular", false); |
| 533 ExtensionTestMessageListener onclick_incognito("onclick fired incognito", | 533 ExtensionTestMessageListener onclick_incognito("onclick fired incognito", |
| 534 false); | 534 false); |
| 535 | 535 |
| 536 // Open an incognito window. | 536 // Open an incognito window. |
| 537 Browser* browser_incognito = ui_test_utils::OpenURLOffTheRecord( | 537 Browser* browser_incognito = |
| 538 browser()->profile(), GURL("about:blank")); | 538 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
| 539 | 539 |
| 540 ASSERT_TRUE(LoadContextMenuExtensionIncognito("incognito")); | 540 ASSERT_TRUE(LoadContextMenuExtensionIncognito("incognito")); |
| 541 | 541 |
| 542 // Wait for the extension's processes to tell us they've created an item. | 542 // Wait for the extension's processes to tell us they've created an item. |
| 543 ASSERT_TRUE(created.WaitUntilSatisfied()); | 543 ASSERT_TRUE(created.WaitUntilSatisfied()); |
| 544 ASSERT_TRUE(created_incognito.WaitUntilSatisfied()); | 544 ASSERT_TRUE(created_incognito.WaitUntilSatisfied()); |
| 545 | 545 |
| 546 GURL page_url("http://www.google.com"); | 546 GURL page_url("http://www.google.com"); |
| 547 | 547 |
| 548 // Create and build our test context menu. | 548 // Create and build our test context menu. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 ASSERT_TRUE(LoadContextMenuExtensionIncognito("incognito")); | 653 ASSERT_TRUE(LoadContextMenuExtensionIncognito("incognito")); |
| 654 | 654 |
| 655 // Wait for the extension's processes to tell us they've created an item. | 655 // Wait for the extension's processes to tell us they've created an item. |
| 656 ASSERT_TRUE(created.WaitUntilSatisfied()); | 656 ASSERT_TRUE(created.WaitUntilSatisfied()); |
| 657 ASSERT_TRUE(created_incognito.WaitUntilSatisfied()); | 657 ASSERT_TRUE(created_incognito.WaitUntilSatisfied()); |
| 658 ASSERT_EQ(2u, GetItems().size()); | 658 ASSERT_EQ(2u, GetItems().size()); |
| 659 | 659 |
| 660 browser()->profile()->DestroyOffTheRecordProfile(); | 660 browser()->profile()->DestroyOffTheRecordProfile(); |
| 661 ASSERT_EQ(1u, GetItems().size()); | 661 ASSERT_EQ(1u, GetItems().size()); |
| 662 } | 662 } |
| OLD | NEW |