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

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

Issue 6312154: Remove wstring from RVH's run Javascript command.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/test/automation/browser_proxy.h" 6 #include "chrome/test/automation/browser_proxy.h"
6 #include "chrome/test/automation/tab_proxy.h" 7 #include "chrome/test/automation/tab_proxy.h"
7 #include "chrome/test/ui/ui_test.h" 8 #include "chrome/test/ui/ui_test.h"
8 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
9 #include "net/test/test_server.h" 10 #include "net/test/test_server.h"
10 11
11 class NotificationsPermissionTest : public UITest { 12 class NotificationsPermissionTest : public UITest {
12 public: 13 public:
13 NotificationsPermissionTest() { 14 NotificationsPermissionTest() {
14 dom_automation_enabled_ = true; 15 dom_automation_enabled_ = true;
(...skipping 13 matching lines...) Expand all
28 ASSERT_TRUE(tab.get()); 29 ASSERT_TRUE(tab.get());
29 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, 30 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
30 tab->NavigateToURL(test_server.GetURL( 31 tab->NavigateToURL(test_server.GetURL(
31 "files/notifications/notifications_request_function.html"))); 32 "files/notifications/notifications_request_function.html")));
32 WaitUntilTabCount(1); 33 WaitUntilTabCount(1);
33 34
34 // Request permission by calling request() while eval'ing an inline script; 35 // Request permission by calling request() while eval'ing an inline script;
35 // That's considered a user gesture to webkit, and should produce an infobar. 36 // That's considered a user gesture to webkit, and should produce an infobar.
36 bool result; 37 bool result;
37 ASSERT_TRUE(tab->ExecuteAndExtractBool( 38 ASSERT_TRUE(tab->ExecuteAndExtractBool(
38 L"", 39 string16(),
39 L"window.domAutomationController.send(request());", 40 ASCIIToUTF16("window.domAutomationController.send(request());"),
40 &result)); 41 &result));
41 EXPECT_TRUE(result); 42 EXPECT_TRUE(result);
42 43
43 EXPECT_TRUE(tab->WaitForInfoBarCount(1)); 44 EXPECT_TRUE(tab->WaitForInfoBarCount(1));
44 } 45 }
45 46
46 // Flaky, http://crbug.com/62311. 47 // Flaky, http://crbug.com/62311.
47 TEST_F(NotificationsPermissionTest, FLAKY_TestNoUserGestureInfobar) { 48 TEST_F(NotificationsPermissionTest, FLAKY_TestNoUserGestureInfobar) {
48 net::TestServer test_server(net::TestServer::TYPE_HTTP, 49 net::TestServer test_server(net::TestServer::TYPE_HTTP,
49 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); 50 FilePath(FILE_PATH_LITERAL("chrome/test/data")));
50 ASSERT_TRUE(test_server.Start()); 51 ASSERT_TRUE(test_server.Start());
51 52
52 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 53 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
53 ASSERT_TRUE(browser.get()); 54 ASSERT_TRUE(browser.get());
54 scoped_refptr<TabProxy> tab(browser->GetActiveTab()); 55 scoped_refptr<TabProxy> tab(browser->GetActiveTab());
55 ASSERT_TRUE(tab.get()); 56 ASSERT_TRUE(tab.get());
56 57
57 // Load a page which just does a request; no user gesture should result 58 // Load a page which just does a request; no user gesture should result
58 // in no infobar. 59 // in no infobar.
59 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, 60 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
60 tab->NavigateToURL(test_server.GetURL( 61 tab->NavigateToURL(test_server.GetURL(
61 "files/notifications/notifications_request_inline.html"))); 62 "files/notifications/notifications_request_inline.html")));
62 WaitUntilTabCount(1); 63 WaitUntilTabCount(1);
63 64
64 int info_bar_count; 65 int info_bar_count;
65 ASSERT_TRUE(tab->GetInfoBarCount(&info_bar_count)); 66 ASSERT_TRUE(tab->GetInfoBarCount(&info_bar_count));
66 EXPECT_EQ(0, info_bar_count); 67 EXPECT_EQ(0, info_bar_count);
67 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698