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

Side by Side Diff: chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc

Issue 12212047: Linux/ChromeOS Chromium style checker cleanup, chrome/browser/extensions edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: 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) 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 "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_ api.h" 5 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_ api.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
13 #include "net/base/mock_host_resolver.h" 13 #include "net/base/mock_host_resolver.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 using ::testing::Eq; 17 using ::testing::Eq;
18 using ::testing::Property; 18 using ::testing::Property;
19 using ::testing::Return; 19 using ::testing::Return;
20 using ::testing::_; 20 using ::testing::_;
21 21
22 // A base class for tests below. 22 // A base class for tests below.
23 class ExtensionCloudPrintPrivateApiTest : public ExtensionApiTest { 23 class ExtensionCloudPrintPrivateApiTest : public ExtensionApiTest {
24 public: 24 public:
25 void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 25 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
26 ExtensionApiTest::SetUpCommandLine(command_line); 26 ExtensionApiTest::SetUpCommandLine(command_line);
27 command_line->AppendSwitchASCII(switches::kCloudPrintServiceURL, 27 command_line->AppendSwitchASCII(switches::kCloudPrintServiceURL,
28 "http://www.cloudprintapp.com/files/extensions/api_test/" 28 "http://www.cloudprintapp.com/files/extensions/api_test/"
29 "cloud_print_private"); 29 "cloud_print_private");
30 } 30 }
31 31
32 void SetUpInProcessBrowserTestFixture() OVERRIDE { 32 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
33 // Start up the test server and get us ready for calling the install 33 // Start up the test server and get us ready for calling the install
34 // API functions. 34 // API functions.
35 host_resolver()->AddRule("www.cloudprintapp.com", "127.0.0.1"); 35 host_resolver()->AddRule("www.cloudprintapp.com", "127.0.0.1");
36 ASSERT_TRUE(test_server()->Start()); 36 ASSERT_TRUE(test_server()->Start());
37 } 37 }
38 38
39 protected: 39 protected:
40 // Returns a test server URL, but with host 'www.cloudprintapp.com' so it 40 // Returns a test server URL, but with host 'www.cloudprintapp.com' so it
41 // matches the cloud print app's extent that we set up via command line 41 // matches the cloud print app's extent that we set up via command line
42 // flags. 42 // flags.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 .WillRepeatedly(Return(printers)); 90 .WillRepeatedly(Return(printers));
91 // Run this as a hosted app. Since we have overridden the cloud print service 91 // Run this as a hosted app. Since we have overridden the cloud print service
92 // URL in the command line, this URL should match the web extent for our 92 // URL in the command line, this URL should match the web extent for our
93 // cloud print component app and it should work. 93 // cloud print component app and it should work.
94 GURL page_url = GetTestServerURL( 94 GURL page_url = GetTestServerURL(
95 "enable_chrome_connector/cloud_print_success_tests.html"); 95 "enable_chrome_connector/cloud_print_success_tests.html");
96 ASSERT_TRUE(RunPageTest(page_url.spec())); 96 ASSERT_TRUE(RunPageTest(page_url.spec()));
97 } 97 }
98 98
99 #endif // !defined(OS_CHROMEOS) 99 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698