OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class StubChrome : public Chrome { | 24 class StubChrome : public Chrome { |
25 public: | 25 public: |
26 StubChrome() {} | 26 StubChrome() {} |
27 virtual ~StubChrome() {} | 27 virtual ~StubChrome() {} |
28 | 28 |
29 // Overridden from Chrome: | 29 // Overridden from Chrome: |
30 virtual Status Load(const std::string& url) OVERRIDE { | 30 virtual Status Load(const std::string& url) OVERRIDE { |
31 return Status(kOk); | 31 return Status(kOk); |
32 } | 32 } |
33 virtual Status EvaluateScript(const std::string& function, | 33 virtual Status EvaluateScript(const std::string& frame, |
| 34 const std::string& function, |
34 scoped_ptr<base::Value>* result) OVERRIDE { | 35 scoped_ptr<base::Value>* result) OVERRIDE { |
35 return Status(kOk); | 36 return Status(kOk); |
36 } | 37 } |
37 virtual Status CallFunction(const std::string& function, | 38 virtual Status CallFunction(const std::string& frame, |
| 39 const std::string& function, |
38 const base::ListValue& args, | 40 const base::ListValue& args, |
39 scoped_ptr<base::Value>* result) OVERRIDE { | 41 scoped_ptr<base::Value>* result) OVERRIDE { |
40 return Status(kOk); | 42 return Status(kOk); |
41 } | 43 } |
| 44 virtual Status GetFrameByFunction(const std::string& frame, |
| 45 const std::string& function, |
| 46 const base::ListValue& args, |
| 47 std::string* out_frame) OVERRIDE { |
| 48 return Status(kOk); |
| 49 } |
42 virtual Status Quit() OVERRIDE { | 50 virtual Status Quit() OVERRIDE { |
43 return Status(kOk); | 51 return Status(kOk); |
44 } | 52 } |
45 }; | 53 }; |
46 | 54 |
47 class OkLauncher : public ChromeLauncher { | 55 class OkLauncher : public ChromeLauncher { |
48 public: | 56 public: |
49 OkLauncher() {} | 57 OkLauncher() {} |
50 virtual ~OkLauncher() {} | 58 virtual ~OkLauncher() {} |
51 | 59 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 SessionMap map; | 191 SessionMap map; |
184 Session session("id", scoped_ptr<Chrome>(new FailsToQuitChrome())); | 192 Session session("id", scoped_ptr<Chrome>(new FailsToQuitChrome())); |
185 map.Set(session.id, | 193 map.Set(session.id, |
186 scoped_refptr<SessionAccessor>(new FakeSessionAccessor(&session))); | 194 scoped_refptr<SessionAccessor>(new FakeSessionAccessor(&session))); |
187 base::DictionaryValue params; | 195 base::DictionaryValue params; |
188 scoped_ptr<base::Value> value; | 196 scoped_ptr<base::Value> value; |
189 ASSERT_EQ(kUnknownError, ExecuteQuit(&map, &session, params, &value).code()); | 197 ASSERT_EQ(kUnknownError, ExecuteQuit(&map, &session, params, &value).code()); |
190 ASSERT_FALSE(map.Has(session.id)); | 198 ASSERT_FALSE(map.Has(session.id)); |
191 ASSERT_FALSE(value.get()); | 199 ASSERT_FALSE(value.get()); |
192 } | 200 } |
OLD | NEW |