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

Side by Side Diff: content/renderer/pepper/v8_var_converter_unittest.cc

Issue 264303002: PPAPI: Implement synchronous postMessage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: defer some changes Created 6 years, 6 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 "content/renderer/pepper/v8_var_converter.h" 5 #include "content/renderer/pepper/v8_var_converter.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace content { 42 namespace content {
43 43
44 namespace { 44 namespace {
45 45
46 class MockResourceConverter : public content::ResourceConverter { 46 class MockResourceConverter : public content::ResourceConverter {
47 public: 47 public:
48 virtual ~MockResourceConverter() {} 48 virtual ~MockResourceConverter() {}
49 virtual void Flush(const base::Callback<void(bool)>& callback) OVERRIDE { 49 virtual void Flush(const base::Callback<void(bool)>& callback) OVERRIDE {
50 callback.Run(true); 50 callback.Run(true);
51 } 51 }
52 virtual bool FlushSync() OVERRIDE {
53 return true;
54 }
52 virtual bool FromV8Value(v8::Handle<v8::Object> val, 55 virtual bool FromV8Value(v8::Handle<v8::Object> val,
53 v8::Handle<v8::Context> context, 56 v8::Handle<v8::Context> context,
54 PP_Var* result, 57 PP_Var* result,
55 bool* was_resource) OVERRIDE { 58 bool* was_resource) OVERRIDE {
56 *was_resource = false; 59 *was_resource = false;
57 return true; 60 return true;
58 } 61 }
59 virtual bool ToV8Value(const PP_Var& var, 62 virtual bool ToV8Value(const PP_Var& var,
60 v8::Handle<v8::Context> context, 63 v8::Handle<v8::Context> context,
61 v8::Handle<v8::Value>* result) OVERRIDE { 64 v8::Handle<v8::Value>* result) OVERRIDE {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 expected->SetWithStringKey("null", quux.get()); 445 expected->SetWithStringKey("null", quux.get());
443 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); 446 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops"));
444 expected->SetWithStringKey("undefined", oops.get()); 447 expected->SetWithStringKey("undefined", oops.get());
445 ScopedPPVar release_expected(ScopedPPVar::PassRef(), expected->GetPPVar()); 448 ScopedPPVar release_expected(ScopedPPVar::PassRef(), expected->GetPPVar());
446 449
447 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get(), true)); 450 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get(), true));
448 } 451 }
449 } 452 }
450 453
451 } // namespace content 454 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698