Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/JsEngine.cpp

Issue 10184021: Some refactoring of global JavaScript objects (Closed)
Patch Set: Created April 15, 2013, 2:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/GlobalJsObject.cpp ('k') | test/JsValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <AdblockPlus.h> 1 #include <AdblockPlus.h>
2 #include <fstream> 2 #include <fstream>
3 #include <gtest/gtest.h> 3 #include <gtest/gtest.h>
4 #include <sstream> 4 #include <sstream>
5 5
6 class ThrowingFileReader : public AdblockPlus::FileReader 6 class ThrowingFileReader : public AdblockPlus::FileReader
7 { 7 {
8 public: 8 public:
9 std::auto_ptr<std::istream> Read(const std::string& path) const 9 std::auto_ptr<std::istream> Read(const std::string& path) const
10 { 10 {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ASSERT_TRUE(value->IsString()); 100 ASSERT_TRUE(value->IsString());
101 ASSERT_EQ("foo", value->AsString()); 101 ASSERT_EQ("foo", value->AsString());
102 102
103 value = jsEngine.NewValue(12); 103 value = jsEngine.NewValue(12);
104 ASSERT_TRUE(value->IsNumber()); 104 ASSERT_TRUE(value->IsNumber());
105 ASSERT_EQ(12, value->AsInt()); 105 ASSERT_EQ(12, value->AsInt());
106 106
107 value = jsEngine.NewValue(true); 107 value = jsEngine.NewValue(true);
108 ASSERT_TRUE(value->IsBool()); 108 ASSERT_TRUE(value->IsBool());
109 ASSERT_TRUE(value->AsBool()); 109 ASSERT_TRUE(value->AsBool());
110
111 value = jsEngine.NewObject();
112 ASSERT_TRUE(value->IsObject());
113 ASSERT_EQ(0u, value->GetOwnPropertyNames().size());
110 } 114 }
OLDNEW
« no previous file with comments | « test/GlobalJsObject.cpp ('k') | test/JsValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld