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

Side by Side Diff: chrome/browser/geolocation/geolocation_browsertest.cc

Issue 10778044: Always enable dom automation for browser_tests. This avoids developers having to call EnableDOMAuto… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // 4. Permissions persisted in disk are respected. 200 // 4. Permissions persisted in disk are respected.
201 // 5. Incognito profiles don't use saved permissions. 201 // 5. Incognito profiles don't use saved permissions.
202 class GeolocationBrowserTest : public InProcessBrowserTest { 202 class GeolocationBrowserTest : public InProcessBrowserTest {
203 public: 203 public:
204 GeolocationBrowserTest() 204 GeolocationBrowserTest()
205 : infobar_(NULL), 205 : infobar_(NULL),
206 current_browser_(NULL), 206 current_browser_(NULL),
207 html_for_tests_("files/geolocation/simple.html"), 207 html_for_tests_("files/geolocation/simple.html"),
208 fake_latitude_(1.23), 208 fake_latitude_(1.23),
209 fake_longitude_(4.56), 209 fake_longitude_(4.56),
210 started_test_server_(false) { 210 started_test_server_(false) {}
211 EnableDOMAutomation();
212 }
213 211
214 // InProcessBrowserTest 212 // InProcessBrowserTest
215 virtual void SetUpOnMainThread() { 213 virtual void SetUpOnMainThread() {
216 ui_test_utils::OverrideGeolocation(fake_latitude_, fake_longitude_); 214 ui_test_utils::OverrideGeolocation(fake_latitude_, fake_longitude_);
217 } 215 }
218 216
219 // InProcessBrowserTest 217 // InProcessBrowserTest
220 virtual void TearDownInProcessBrowserTestFixture() { 218 virtual void TearDownInProcessBrowserTestFixture() {
221 LOG(WARNING) << "TearDownInProcessBrowserTestFixture. Test Finished."; 219 LOG(WARNING) << "TearDownInProcessBrowserTestFixture. Test Finished.";
222 } 220 }
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 "window.domAutomationController.setAutomationId(0);" 659 "window.domAutomationController.setAutomationId(0);"
662 "window.domAutomationController.send(window.close());"; 660 "window.domAutomationController.send(window.close());";
663 bool result = 661 bool result =
664 ui_test_utils::ExecuteJavaScript( 662 ui_test_utils::ExecuteJavaScript(
665 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), 663 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(),
666 L"", UTF8ToWide(script)); 664 L"", UTF8ToWide(script));
667 EXPECT_EQ(result, true); 665 EXPECT_EQ(result, true);
668 } 666 }
669 667
670 } // namespace 668 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_inline_install_browsertest.cc ('k') | chrome/browser/instant/instant_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698