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

Side by Side Diff: chrome/browser/notifications/notification_browsertest.cc

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments, merge to LKGR Created 8 years, 4 months 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 | Annotate | Revision Log
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 "chrome/browser/infobars/infobar_tab_helper.h" 5 #include "chrome/browser/infobars/infobar_tab_helper.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_tabstrip.h" 7 #include "chrome/browser/ui/browser_tabstrip.h"
8 #include "chrome/browser/ui/tab_contents/tab_contents.h" 8 #include "chrome/browser/ui/tab_contents/tab_contents.h"
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
(...skipping 20 matching lines...) Expand all
31 // That's considered a user gesture to webkit, and should produce an infobar. 31 // That's considered a user gesture to webkit, and should produce an infobar.
32 bool result; 32 bool result;
33 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 33 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
34 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), 34 chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
35 L"", 35 L"",
36 L"window.domAutomationController.send(request());", 36 L"window.domAutomationController.send(request());",
37 &result)); 37 &result));
38 EXPECT_TRUE(result); 38 EXPECT_TRUE(result);
39 39
40 EXPECT_EQ(1U, chrome::GetTabContentsAt(browser(), 0)->infobar_tab_helper()-> 40 EXPECT_EQ(1U, chrome::GetTabContentsAt(browser(), 0)->infobar_tab_helper()->
41 infobar_count()); 41 GetInfoBarCount());
42 } 42 }
43 43
44 // If this flakes, use http://crbug.com/62311. 44 // If this flakes, use http://crbug.com/62311.
45 IN_PROC_BROWSER_TEST_F(NotificationsPermissionTest, TestNoUserGestureInfobar) { 45 IN_PROC_BROWSER_TEST_F(NotificationsPermissionTest, TestNoUserGestureInfobar) {
46 ASSERT_TRUE(test_server()->Start()); 46 ASSERT_TRUE(test_server()->Start());
47 47
48 // Load a page which just does a request; no user gesture should result 48 // Load a page which just does a request; no user gesture should result
49 // in no infobar. 49 // in no infobar.
50 ui_test_utils::NavigateToURL( 50 ui_test_utils::NavigateToURL(
51 browser(), 51 browser(),
52 test_server()->GetURL( 52 test_server()->GetURL(
53 "files/notifications/notifications_request_inline.html")); 53 "files/notifications/notifications_request_inline.html"));
54 54
55 EXPECT_EQ(0U, chrome::GetTabContentsAt(browser(), 0)->infobar_tab_helper()-> 55 EXPECT_EQ(0U, chrome::GetTabContentsAt(browser(), 0)->infobar_tab_helper()->
56 infobar_count()); 56 GetInfoBarCount());
57 } 57 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/insecure_content_infobar_delegate.cc ('k') | chrome/browser/plugin_infobar_delegates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698