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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueTest.cpp

Issue 1738623004: Rename enums/functions that collide in chromium style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-names-4
Patch Set: get-names-5: rebase-and-stuff Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "bindings/core/v8/SerializedScriptValue.h" 5 #include "bindings/core/v8/SerializedScriptValue.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "bindings/core/v8/SerializedScriptValueFactory.h" 8 #include "bindings/core/v8/SerializedScriptValueFactory.h"
9 #include "bindings/core/v8/V8Binding.h" 9 #include "bindings/core/v8/V8Binding.h"
10 #include "bindings/core/v8/V8BindingForTesting.h" 10 #include "bindings/core/v8/V8BindingForTesting.h"
(...skipping 17 matching lines...) Expand all
28 protected: 28 protected:
29 V8TestingScope m_scope; 29 V8TestingScope m_scope;
30 }; 30 };
31 31
32 TEST_F(SerializedScriptValueTest, UserSelectedFile) 32 TEST_F(SerializedScriptValueTest, UserSelectedFile)
33 { 33 {
34 String filePath = testing::blinkRootDir(); 34 String filePath = testing::blinkRootDir();
35 filePath.append("/Source/bindings/core/v8/SerializedScriptValueTest.cpp"); 35 filePath.append("/Source/bindings/core/v8/SerializedScriptValueTest.cpp");
36 File* originalFile = File::create(filePath); 36 File* originalFile = File::create(filePath);
37 ASSERT_TRUE(originalFile->hasBackingFile()); 37 ASSERT_TRUE(originalFile->hasBackingFile());
38 ASSERT_EQ(File::IsUserVisible, originalFile->userVisibility()); 38 ASSERT_EQ(File::IsUserVisible, originalFile->getUserVisibility());
39 ASSERT_EQ(filePath, originalFile->path()); 39 ASSERT_EQ(filePath, originalFile->path());
40 40
41 v8::Local<v8::Value> v8OriginalFile = toV8(originalFile, creationContext(), isolate()); 41 v8::Local<v8::Value> v8OriginalFile = toV8(originalFile, creationContext(), isolate());
42 RefPtr<SerializedScriptValue> serializedScriptValue = 42 RefPtr<SerializedScriptValue> serializedScriptValue =
43 SerializedScriptValueFactory::instance().create(isolate(), v8OriginalFile, n ullptr, nullptr, nullptr, ASSERT_NO_EXCEPTION); 43 SerializedScriptValueFactory::instance().create(isolate(), v8OriginalFile, n ullptr, nullptr, nullptr, ASSERT_NO_EXCEPTION);
44 v8::Local<v8::Value> v8File = serializedScriptValue->deserialize(isolate()); 44 v8::Local<v8::Value> v8File = serializedScriptValue->deserialize(isolate());
45 45
46 ASSERT_TRUE(V8File::hasInstance(v8File, isolate())); 46 ASSERT_TRUE(V8File::hasInstance(v8File, isolate()));
47 File* file = V8File::toImpl(v8::Local<v8::Object>::Cast(v8File)); 47 File* file = V8File::toImpl(v8::Local<v8::Object>::Cast(v8File));
48 EXPECT_TRUE(file->hasBackingFile()); 48 EXPECT_TRUE(file->hasBackingFile());
49 EXPECT_EQ(File::IsUserVisible, file->userVisibility()); 49 EXPECT_EQ(File::IsUserVisible, file->getUserVisibility());
50 EXPECT_EQ(filePath, file->path()); 50 EXPECT_EQ(filePath, file->path());
51 } 51 }
52 52
53 TEST_F(SerializedScriptValueTest, FileConstructorFile) 53 TEST_F(SerializedScriptValueTest, FileConstructorFile)
54 { 54 {
55 RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(); 55 RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create();
56 File* originalFile = File::create("hello.txt", 12345678.0, blobDataHandle); 56 File* originalFile = File::create("hello.txt", 12345678.0, blobDataHandle);
57 ASSERT_FALSE(originalFile->hasBackingFile()); 57 ASSERT_FALSE(originalFile->hasBackingFile());
58 ASSERT_EQ(File::IsNotUserVisible, originalFile->userVisibility()); 58 ASSERT_EQ(File::IsNotUserVisible, originalFile->getUserVisibility());
59 ASSERT_EQ("hello.txt", originalFile->name()); 59 ASSERT_EQ("hello.txt", originalFile->name());
60 60
61 v8::Local<v8::Value> v8OriginalFile = toV8(originalFile, creationContext(), isolate()); 61 v8::Local<v8::Value> v8OriginalFile = toV8(originalFile, creationContext(), isolate());
62 RefPtr<SerializedScriptValue> serializedScriptValue = 62 RefPtr<SerializedScriptValue> serializedScriptValue =
63 SerializedScriptValueFactory::instance().create(isolate(), v8OriginalFile, n ullptr, nullptr, nullptr, ASSERT_NO_EXCEPTION); 63 SerializedScriptValueFactory::instance().create(isolate(), v8OriginalFile, n ullptr, nullptr, nullptr, ASSERT_NO_EXCEPTION);
64 v8::Local<v8::Value> v8File = serializedScriptValue->deserialize(isolate()); 64 v8::Local<v8::Value> v8File = serializedScriptValue->deserialize(isolate());
65 65
66 ASSERT_TRUE(V8File::hasInstance(v8File, isolate())); 66 ASSERT_TRUE(V8File::hasInstance(v8File, isolate()));
67 File* file = V8File::toImpl(v8::Local<v8::Object>::Cast(v8File)); 67 File* file = V8File::toImpl(v8::Local<v8::Object>::Cast(v8File));
68 EXPECT_FALSE(file->hasBackingFile()); 68 EXPECT_FALSE(file->hasBackingFile());
69 EXPECT_EQ(File::IsNotUserVisible, file->userVisibility()); 69 EXPECT_EQ(File::IsNotUserVisible, file->getUserVisibility());
70 EXPECT_EQ("hello.txt", file->name()); 70 EXPECT_EQ("hello.txt", file->name());
71 } 71 }
72 72
73 } // namespace blink 73 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698