mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1031152 - Part 2: Define a JSAPI test for the SavedFrame public API; r=jandem
This commit is contained in:
parent
eb13ff659d
commit
79562d4566
@ -22,3 +22,45 @@ BEGIN_TEST(testSavedStacks_withNoStack)
|
||||
return true;
|
||||
}
|
||||
END_TEST(testSavedStacks_withNoStack)
|
||||
|
||||
BEGIN_TEST(testSavedStacks_ApiDefaultValues)
|
||||
{
|
||||
js::RootedSavedFrame savedFrame(cx, nullptr);
|
||||
|
||||
// Source
|
||||
JS::RootedString str(cx);
|
||||
JS::SavedFrameResult result = JS::GetSavedFrameSource(cx, savedFrame, &str);
|
||||
CHECK(result == JS::SavedFrameResult::AccessDenied);
|
||||
CHECK(str.get() == cx->runtime()->emptyString);
|
||||
|
||||
// Line
|
||||
uint32_t line = 123;
|
||||
result = JS::GetSavedFrameLine(cx, savedFrame, &line);
|
||||
CHECK(result == JS::SavedFrameResult::AccessDenied);
|
||||
CHECK(line == 0);
|
||||
|
||||
// Column
|
||||
uint32_t column = 123;
|
||||
result = JS::GetSavedFrameColumn(cx, savedFrame, &column);
|
||||
CHECK(result == JS::SavedFrameResult::AccessDenied);
|
||||
CHECK(column == 0);
|
||||
|
||||
// Function display name
|
||||
result = JS::GetSavedFrameFunctionDisplayName(cx, savedFrame, &str);
|
||||
CHECK(result == JS::SavedFrameResult::AccessDenied);
|
||||
CHECK(str.get() == nullptr);
|
||||
|
||||
// Parent
|
||||
JS::RootedObject parent(cx);
|
||||
result = JS::GetSavedFrameParent(cx, savedFrame, &parent);
|
||||
CHECK(result == JS::SavedFrameResult::AccessDenied);
|
||||
CHECK(parent.get() == nullptr);
|
||||
|
||||
// Stack string
|
||||
result = JS::GetSavedFrameSource(cx, savedFrame, &str);
|
||||
CHECK(result == JS::SavedFrameResult::AccessDenied);
|
||||
CHECK(str.get() == cx->runtime()->emptyString);
|
||||
|
||||
return true;
|
||||
}
|
||||
END_TEST(testSavedStacks_ApiDefaultValues)
|
||||
|
Loading…
Reference in New Issue
Block a user