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

Unified Diff: test/cctest/test-api.cc

Side-by-side diff isn't available for this file because of its large size.
Issue 2339123002: [builtins] Move StringLastIndexOf to a builtin. (Closed)
Patch Set: Test natives callable from extensions with str compare instead Created 4 years, 3 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:
Download patch
« src/objects.cc ('K') | « src/runtime/runtime-strings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index cc14ffa2d32e003f81d05c9798ae2c08c557e8be..709a1ff85ecb9b6baad09a7bb6a09639732bcf63 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -7451,15 +7451,13 @@ TEST(ExceptionExtensions) {
CHECK(context.IsEmpty());
}
-
static const char* kNativeCallInExtensionSource =
- "function call_runtime_last_index_of(x) {"
- " return %StringLastIndexOf(x, 'bob', 10);"
+ "function call_runtime_string_compare(x) {"
+ " return %StringCompare(x, x);"
"}";
-
static const char* kNativeCallTest =
- "call_runtime_last_index_of('bobbobboellebobboellebobbob');";
+ "call_runtime_string_compare('bobbobboellebobboellebobbob');";
// Test that a native runtime calls are supported in extensions.
TEST(NativeCallInExtensions) {
@@ -7471,11 +7469,10 @@ TEST(NativeCallInExtensions) {
v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions);
Context::Scope lock(context);
v8::Local<Value> result = CompileRun(kNativeCallTest);
- CHECK(result->Equals(context, v8::Integer::New(CcTest::isolate(), 3))
+ CHECK(result->Equals(context, v8::Integer::New(CcTest::isolate(), 0))
.FromJust());
}
-
class NativeFunctionExtension : public Extension {
public:
NativeFunctionExtension(const char* name, const char* source,
« src/objects.cc ('K') | « src/runtime/runtime-strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698