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

Side by Side Diff: chrome/browser/chromeos/extensions/networking_private_apitest.cc

Issue 12220113: Next phase for chrome.networkingPrivate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed spaces in copyright header Created 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
11 11
12 namespace chromeos { 12 namespace chromeos {
13 13
14 class ExtensionNetworkingPrivateApiTest : public ExtensionApiTest { 14 class ExtensionNetworkingPrivateApiTest : public ExtensionApiTest {
15 public: 15 public:
16 // Whitelist the extension ID of the test extension. 16 // Whitelist the extension ID of the test extension.
17 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 17 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
18 ExtensionApiTest::SetUpCommandLine(command_line); 18 ExtensionApiTest::SetUpCommandLine(command_line);
19 command_line->AppendSwitchASCII( 19 command_line->AppendSwitchASCII(
20 switches::kWhitelistedExtensionID, "epcifkihnkjgphfkloaaleeakhpmgdmn"); 20 switches::kWhitelistedExtensionID, "epcifkihnkjgphfkloaaleeakhpmgdmn");
21 } 21 }
22
23 bool RunNetworkingSubtest(const std::string& subtest) {
24 return RunExtensionSubtest(
25 "networking", "main.html?" + subtest,
26 kFlagEnableFileAccess | kFlagLoadAsComponent);
27 }
22 }; 28 };
23 29
24 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest, BasicFunctions) { 30 // Place each subtest into a separate browser test so that the stub networking
25 ASSERT_TRUE(RunComponentExtensionTest("networking")) << message_; 31 // library state is reset for each subtest run. This way they won't affect each
32 // other.
33
34 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest, StartConnect) {
35 EXPECT_TRUE(RunNetworkingSubtest("startConnect")) << message_;
36 }
37
38 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest, StartDisconnect) {
39 EXPECT_TRUE(RunNetworkingSubtest("startDisconnect")) << message_;
40 }
41
42 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest,
43 StartConnectNonexistent) {
44 EXPECT_TRUE(RunNetworkingSubtest("startConnectNonexistent")) << message_;
45 }
46
47 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest, GetVisibleNetworks) {
48 EXPECT_TRUE(RunNetworkingSubtest("getVisibleNetworks")) << message_;
49 }
50
51 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest,
52 GetVisibleNetworksWifi) {
53 EXPECT_TRUE(RunNetworkingSubtest("getVisibleNetworksWifi")) << message_;
54 }
55
56 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest, GetProperties) {
57 EXPECT_TRUE(RunNetworkingSubtest("getProperties")) << message_;
58 }
59
60 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest,
61 OnNetworksChangedEvent) {
62 EXPECT_TRUE(RunNetworkingSubtest("onNetworksChangedEvent")) << message_;
63 }
64
65 IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest,
66 OnNetworkListChangedEvent) {
67 EXPECT_TRUE(RunNetworkingSubtest("onNetworkListChangedEvent")) << message_;
26 } 68 }
27 69
28 } // namespace chromeos 70 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698