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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 (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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 18 matching lines...) Expand all
29 #endif 29 #endif
30 30
31 namespace extensions { 31 namespace extensions {
32 32
33 namespace { 33 namespace {
34 34
35 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; 35 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf";
36 36
37 class TabCaptureApiTest : public ExtensionApiTest { 37 class TabCaptureApiTest : public ExtensionApiTest {
38 public: 38 public:
39 void SetUpCommandLine(CommandLine* command_line) override { 39 void SetUpCommandLine(base::CommandLine* command_line) override {
40 ExtensionApiTest::SetUpCommandLine(command_line); 40 ExtensionApiTest::SetUpCommandLine(command_line);
41 // Specify smallish window size to make testing of tab capture less CPU 41 // Specify smallish window size to make testing of tab capture less CPU
42 // intensive. 42 // intensive.
43 command_line->AppendSwitchASCII(::switches::kWindowSize, "300,300"); 43 command_line->AppendSwitchASCII(::switches::kWindowSize, "300,300");
44 } 44 }
45 45
46 void AddExtensionToCommandLineWhitelist() { 46 void AddExtensionToCommandLineWhitelist() {
47 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 47 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
48 switches::kWhitelistedExtensionID, kExtensionId); 48 switches::kWhitelistedExtensionID, kExtensionId);
49 } 49 }
50 50
51 protected: 51 protected:
52 void SimulateMouseClickInCurrentTab() { 52 void SimulateMouseClickInCurrentTab() {
53 content::SimulateMouseClick( 53 content::SimulateMouseClick(
54 browser()->tab_strip_model()->GetActiveWebContents(), 54 browser()->tab_strip_model()->GetActiveWebContents(),
55 0, 55 0,
56 blink::WebMouseEvent::ButtonLeft); 56 blink::WebMouseEvent::ButtonLeft);
57 } 57 }
(...skipping 17 matching lines...) Expand all
75 // The tests are too slow to succeed with OSMesa on the bots. 75 // The tests are too slow to succeed with OSMesa on the bots.
76 if (UsingOSMesa()) 76 if (UsingOSMesa())
77 return true; 77 return true;
78 78
79 #if defined(NDEBUG) 79 #if defined(NDEBUG)
80 return false; 80 return false;
81 #else 81 #else
82 // TODO(miu): Look into enabling these tests for the Debug build bots once 82 // TODO(miu): Look into enabling these tests for the Debug build bots once
83 // they prove to be stable again on the Release bots. 83 // they prove to be stable again on the Release bots.
84 // http://crbug.com/396413 84 // http://crbug.com/396413
85 return !CommandLine::ForCurrentProcess()->HasSwitch( 85 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
86 "run-tab-capture-api-pixel-tests"); 86 "run-tab-capture-api-pixel-tests");
87 #endif 87 #endif
88 } 88 }
89 }; 89 };
90 90
91 // Tests API behaviors, including info queries, and constraints violations. 91 // Tests API behaviors, including info queries, and constraints violations.
92 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTests) { 92 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTests) {
93 AddExtensionToCommandLineWhitelist(); 93 AddExtensionToCommandLineWhitelist();
94 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "api_tests.html")) << message_; 94 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "api_tests.html")) << message_;
95 } 95 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return; 354 return;
355 } 355 }
356 content::RunMessageLoop(); 356 content::RunMessageLoop();
357 } 357 }
358 browser()->tab_strip_model()->RemoveObserver(&observer); 358 browser()->tab_strip_model()->RemoveObserver(&observer);
359 } 359 }
360 360
361 } // namespace 361 } // namespace
362 362
363 } // namespace extensions 363 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698