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

Side by Side Diff: content/browser/net_info_browsertest.cc

Issue 865123003: Update {virtual,override,final} to follow C++11 style in content, round 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix format Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/run_loop.h" 6 #include "base/run_loop.h"
7 #include "content/public/common/content_switches.h" 7 #include "content/public/common/content_switches.h"
8 #include "content/public/test/browser_test_utils.h" 8 #include "content/public/test/browser_test_utils.h"
9 #include "content/public/test/content_browser_test.h" 9 #include "content/public/test/content_browser_test.h"
10 #include "content/public/test/content_browser_test_utils.h" 10 #include "content/public/test/content_browser_test_utils.h"
11 #include "content/shell/browser/shell.h" 11 #include "content/shell/browser/shell.h"
12 #include "net/base/network_change_notifier.h" 12 #include "net/base/network_change_notifier.h"
13 #include "net/base/network_change_notifier_factory.h" 13 #include "net/base/network_change_notifier_factory.h"
14 14
15 class NetInfoBrowserTest : public content::ContentBrowserTest { 15 class NetInfoBrowserTest : public content::ContentBrowserTest {
16 protected: 16 protected:
17 void SetUpCommandLine(base::CommandLine* command_line) override { 17 void SetUpCommandLine(base::CommandLine* command_line) override {
18 // TODO(jkarlin): Once NetInfo is enabled on all platforms remove this 18 // TODO(jkarlin): Once NetInfo is enabled on all platforms remove this
19 // switch. 19 // switch.
20 command_line->AppendSwitch(switches::kEnableNetworkInformation); 20 command_line->AppendSwitch(switches::kEnableNetworkInformation);
21 } 21 }
22 22
23 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
24 virtual void SetUp() override { 24 void SetUp() override {
25 // ChromeOS's NetworkChangeNotifier isn't known to content and therefore 25 // ChromeOS's NetworkChangeNotifier isn't known to content and therefore
26 // doesn't get created in content_browsertests. Insert a mock 26 // doesn't get created in content_browsertests. Insert a mock
27 // NetworkChangeNotifier. 27 // NetworkChangeNotifier.
28 net::NetworkChangeNotifier::CreateMock(); 28 net::NetworkChangeNotifier::CreateMock();
29 content::ContentBrowserTest::SetUp(); 29 content::ContentBrowserTest::SetUp();
30 } 30 }
31 #endif 31 #endif
32 32
33 void SetUpOnMainThread() override { 33 void SetUpOnMainThread() override {
34 net::NetworkChangeNotifier::SetTestNotificationsOnly(true); 34 net::NetworkChangeNotifier::SetTestNotificationsOnly(true);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // navigator.isOnline. 71 // navigator.isOnline.
72 IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, IsOnline) { 72 IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, IsOnline) {
73 NavigateToURL(shell(), content::GetTestUrl("", "net_info.html")); 73 NavigateToURL(shell(), content::GetTestUrl("", "net_info.html"));
74 SetConnectionType(net::NetworkChangeNotifier::CONNECTION_ETHERNET); 74 SetConnectionType(net::NetworkChangeNotifier::CONNECTION_ETHERNET);
75 EXPECT_TRUE(RunScriptExtractBool("getOnLine()")); 75 EXPECT_TRUE(RunScriptExtractBool("getOnLine()"));
76 SetConnectionType(net::NetworkChangeNotifier::CONNECTION_NONE); 76 SetConnectionType(net::NetworkChangeNotifier::CONNECTION_NONE);
77 EXPECT_FALSE(RunScriptExtractBool("getOnLine()")); 77 EXPECT_FALSE(RunScriptExtractBool("getOnLine()"));
78 SetConnectionType(net::NetworkChangeNotifier::CONNECTION_WIFI); 78 SetConnectionType(net::NetworkChangeNotifier::CONNECTION_WIFI);
79 EXPECT_TRUE(RunScriptExtractBool("getOnLine()")); 79 EXPECT_TRUE(RunScriptExtractBool("getOnLine()"));
80 } 80 }
OLDNEW
« no previous file with comments | « content/browser/media/capture/desktop_capture_device_aura_unittest.cc ('k') | content/browser/time_zone_monitor_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698