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

Side by Side Diff: chrome/browser/extensions/api/serial/serial_apitest.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <deque> 5 #include <deque>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/extensions/api/serial/serial_api.h" 10 #include "chrome/browser/extensions/api/serial/serial_api.h"
(...skipping 18 matching lines...) Expand all
29 public: 29 public:
30 SerialApiTest() {} 30 SerialApiTest() {}
31 }; 31 };
32 32
33 } // namespace 33 } // namespace
34 34
35 namespace extensions { 35 namespace extensions {
36 36
37 class FakeSerialGetDevicesFunction : public AsyncExtensionFunction { 37 class FakeSerialGetDevicesFunction : public AsyncExtensionFunction {
38 public: 38 public:
39 virtual bool RunImpl() OVERRIDE { 39 virtual bool RunAsync() OVERRIDE {
40 base::ListValue* devices = new base::ListValue(); 40 base::ListValue* devices = new base::ListValue();
41 base::DictionaryValue* device0 = new base::DictionaryValue(); 41 base::DictionaryValue* device0 = new base::DictionaryValue();
42 device0->SetString("path", "/dev/fakeserial"); 42 device0->SetString("path", "/dev/fakeserial");
43 base::DictionaryValue* device1 = new base::DictionaryValue(); 43 base::DictionaryValue* device1 = new base::DictionaryValue();
44 device1->SetString("path", "\\\\COM800\\"); 44 device1->SetString("path", "\\\\COM800\\");
45 devices->Append(device0); 45 devices->Append(device0);
46 devices->Append(device1); 46 devices->Append(device1);
47 SetResult(devices); 47 SetResult(devices);
48 SendResponse(true); 48 SendResponse(true);
49 return true; 49 return true;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 ASSERT_TRUE(RunExtensionTest("serial/api")) << message_; 184 ASSERT_TRUE(RunExtensionTest("serial/api")) << message_;
185 } 185 }
186 186
187 IN_PROC_BROWSER_TEST_F(SerialApiTest, SerialRealHardware) { 187 IN_PROC_BROWSER_TEST_F(SerialApiTest, SerialRealHardware) {
188 ResultCatcher catcher; 188 ResultCatcher catcher;
189 catcher.RestrictToProfile(browser()->profile()); 189 catcher.RestrictToProfile(browser()->profile());
190 190
191 ASSERT_TRUE(RunExtensionTest("serial/real_hardware")) << message_; 191 ASSERT_TRUE(RunExtensionTest("serial/real_hardware")) << message_;
192 } 192 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/runtime/runtime_api.cc ('k') | chrome/browser/extensions/api/sessions/sessions_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698