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

Side by Side Diff: chrome/browser/device_orientation/enable_switch_browsertest.cc

Issue 2834066: Fix win build errors. Don't initialize FilePath with const char*. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "chrome/browser/browser.h" 7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/tab_contents/tab_contents.h" 8 #include "chrome/browser/tab_contents/tab_contents.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/in_process_browser_test.h" 10 #include "chrome/test/in_process_browser_test.h"
11 #include "chrome/test/ui_test_utils.h" 11 #include "chrome/test/ui_test_utils.h"
12 12
13 class DeviceOrientationEnableSwitchTest : public InProcessBrowserTest { 13 class DeviceOrientationEnableSwitchTest : public InProcessBrowserTest {
14 public: 14 public:
15 GURL testUrl(const char* filename) { 15 GURL testUrl(const FilePath::CharType* filename) {
16 const FilePath kTestDir("device_orientation"); 16 const FilePath kTestDir(FILE_PATH_LITERAL("device_orientation"));
17 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename)); 17 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename));
18 } 18 }
19 }; 19 };
20 20
21 IN_PROC_BROWSER_TEST_F(DeviceOrientationEnableSwitchTest, UnavailabilityTest) { 21 IN_PROC_BROWSER_TEST_F(DeviceOrientationEnableSwitchTest, UnavailabilityTest) {
22 // Test that device orientation is not available to a web page if 22 // Test that device orientation is not available to a web page if
23 // the runtime switch is disabled. 23 // the runtime switch is disabled.
24 24
25 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 25 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
26 bool has_switch = command_line.HasSwitch(switches::kEnableDeviceOrientation); 26 bool has_switch = command_line.HasSwitch(switches::kEnableDeviceOrientation);
27 ASSERT_FALSE(has_switch) << "This test does not make sense if " 27 ASSERT_FALSE(has_switch) << "This test does not make sense if "
28 << "--enable-device-orientation is set."; 28 << "--enable-device-orientation is set.";
29 29
30 GURL test_url = testUrl("enable_switch_test.html"); 30 GURL test_url = testUrl(FILE_PATH_LITERAL("enable_switch_test.html"));
31 ui_test_utils::NavigateToURL(browser(), test_url); 31 ui_test_utils::NavigateToURL(browser(), test_url);
32 std::string status = browser()->GetSelectedTabContents()->GetURL().ref(); 32 std::string status = browser()->GetSelectedTabContents()->GetURL().ref();
33 EXPECT_EQ("pass", status) << "Page detected device orientation properties."; 33 EXPECT_EQ("pass", status) << "Page detected device orientation properties.";
34 } 34 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698