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

Side by Side Diff: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "content/public/browser/notification_service.h" 47 #include "content/public/browser/notification_service.h"
48 #include "content/public/browser/render_frame_host.h" 48 #include "content/public/browser/render_frame_host.h"
49 #include "content/public/browser/render_view_host.h" 49 #include "content/public/browser/render_view_host.h"
50 #include "content/public/browser/render_widget_host.h" 50 #include "content/public/browser/render_widget_host.h"
51 #include "content/public/browser/web_contents.h" 51 #include "content/public/browser/web_contents.h"
52 #include "content/public/browser/web_contents_observer.h" 52 #include "content/public/browser/web_contents_observer.h"
53 #include "content/public/common/url_constants.h" 53 #include "content/public/common/url_constants.h"
54 #include "content/public/test/browser_test_utils.h" 54 #include "content/public/test/browser_test_utils.h"
55 #include "content/public/test/test_navigation_observer.h" 55 #include "content/public/test/test_navigation_observer.h"
56 #include "content/public/test/test_utils.h" 56 #include "content/public/test/test_utils.h"
57 #include "extensions/features/features.h"
57 #include "net/dns/mock_host_resolver.h" 58 #include "net/dns/mock_host_resolver.h"
58 #include "net/test/embedded_test_server/embedded_test_server.h" 59 #include "net/test/embedded_test_server/embedded_test_server.h"
59 #include "testing/gtest/include/gtest/gtest.h" 60 #include "testing/gtest/include/gtest/gtest.h"
60 #include "ui/events/keycodes/dom/dom_code.h" 61 #include "ui/events/keycodes/dom/dom_code.h"
61 #include "ui/events/keycodes/dom/keycode_converter.h" 62 #include "ui/events/keycodes/dom/keycode_converter.h"
62 63
63 using content::WebContents; 64 using content::WebContents;
64 using content::NativeWebKeyboardEvent; 65 using content::NativeWebKeyboardEvent;
65 66
66 namespace { 67 namespace {
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 tab->GetMainFrame()->ExecuteJavaScriptForTests(base::UTF8ToUTF16("alert()")); 579 tab->GetMainFrame()->ExecuteJavaScriptForTests(base::UTF8ToUTF16("alert()"));
579 runner->Run(); 580 runner->Run();
580 581
581 // Verify that after the dialog is closed, the popup is in front again. 582 // Verify that after the dialog is closed, the popup is in front again.
582 ui_test_utils::BrowserActivationWaiter waiter(popup_browser); 583 ui_test_utils::BrowserActivationWaiter waiter(popup_browser);
583 tab_strip->ActivateTabAt(1, true); 584 tab_strip->ActivateTabAt(1, true);
584 waiter.WaitForActivation(); 585 waiter.WaitForActivation();
585 ASSERT_EQ(popup_browser, chrome::FindLastActive()); 586 ASSERT_EQ(popup_browser, chrome::FindLastActive());
586 } 587 }
587 588
588 #if defined(ENABLE_EXTENSIONS) 589 #if BUILDFLAG(ENABLE_EXTENSIONS)
589 #define MAYBE_ModalPopUnderViaGuestView DISABLED_ModalPopUnderViaGuestView 590 #define MAYBE_ModalPopUnderViaGuestView DISABLED_ModalPopUnderViaGuestView
590 #else 591 #else
591 #define MAYBE_ModalPopUnderViaGuestView ModalPopUnderViaGuestView 592 #define MAYBE_ModalPopUnderViaGuestView ModalPopUnderViaGuestView
592 #endif 593 #endif
593 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, 594 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest,
594 MAYBE_ModalPopUnderViaGuestView) { 595 MAYBE_ModalPopUnderViaGuestView) {
595 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); 596 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
596 GURL url( 597 GURL url(
597 embedded_test_server()->GetURL("/popup_blocker/popup-window-open.html")); 598 embedded_test_server()->GetURL("/popup_blocker/popup-window-open.html"));
598 HostContentSettingsMapFactory::GetForProfile(browser()->profile()) 599 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 707
707 wait_for_new_tab.Wait(); 708 wait_for_new_tab.Wait();
708 709
709 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); 710 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile()));
710 ASSERT_EQ(2, browser()->tab_strip_model()->count()); 711 ASSERT_EQ(2, browser()->tab_strip_model()->count());
711 // Check that we create the background tab. 712 // Check that we create the background tab.
712 ASSERT_EQ(0, browser()->tab_strip_model()->active_index()); 713 ASSERT_EQ(0, browser()->tab_strip_model()->active_index());
713 } 714 }
714 715
715 } // namespace 716 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/blocked_content/app_modal_dialog_helper.cc ('k') | chrome/browser/ui/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698