• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ V8TestingScope类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中V8TestingScope的典型用法代码示例。如果您正苦于以下问题:C++ V8TestingScope类的具体用法?C++ V8TestingScope怎么用?C++ V8TestingScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了V8TestingScope类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TEST

TEST(AnimationTimingInputTest, TimingInputEndDelay)
{
    V8TestingScope scope;
    bool ignoredSuccess;
    EXPECT_EQ(10, applyTimingInputNumber(scope.isolate(), "endDelay", 10000, ignoredSuccess).endDelay);
    EXPECT_EQ(-2.5, applyTimingInputNumber(scope.isolate(), "endDelay", -2500, ignoredSuccess).endDelay);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:7,代码来源:TimingInputTest.cpp


示例2: TEST_F

TEST_F(PerformanceObserverTest, Enqueue) {
  V8TestingScope scope;
  initialize(scope.getScriptState());

  Persistent<PerformanceEntry> entry = PerformanceMark::create("m", 1234);
  EXPECT_EQ(0, numPerformanceEntries());

  m_observer->enqueuePerformanceEntry(*entry);
  EXPECT_EQ(1, numPerformanceEntries());
}
开发者ID:mirror,项目名称:chromium,代码行数:10,代码来源:PerformanceObserverTest.cpp


示例3: TEST_F

TEST_F(PerformanceBaseTest, Register) {
  V8TestingScope scope;
  initialize(scope.getScriptState());

  EXPECT_EQ(0, m_base->numObservers());
  EXPECT_EQ(0, m_base->numActiveObservers());

  m_base->registerPerformanceObserver(*m_observer.get());
  EXPECT_EQ(1, m_base->numObservers());
  EXPECT_EQ(0, m_base->numActiveObservers());

  m_base->unregisterPerformanceObserver(*m_observer.get());
  EXPECT_EQ(0, m_base->numObservers());
  EXPECT_EQ(0, m_base->numActiveObservers());
}
开发者ID:mirror,项目名称:chromium,代码行数:15,代码来源:PerformanceBaseTest.cpp


示例4: TEST

TEST(SerializedScriptValueTest, FileConstructorFile) {
    V8TestingScope scope;
    RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create();
    File* originalFile = File::create("hello.txt", 12345678.0, blobDataHandle);
    ASSERT_FALSE(originalFile->hasBackingFile());
    ASSERT_EQ(File::IsNotUserVisible, originalFile->getUserVisibility());
    ASSERT_EQ("hello.txt", originalFile->name());

    v8::Local<v8::Value> v8OriginalFile =
        toV8(originalFile, scope.context()->Global(), scope.isolate());
    RefPtr<SerializedScriptValue> serializedScriptValue =
        SerializedScriptValue::serialize(scope.isolate(), v8OriginalFile, nullptr,
                                         nullptr, ASSERT_NO_EXCEPTION);
    v8::Local<v8::Value> v8File =
        serializedScriptValue->deserialize(scope.isolate());

    ASSERT_TRUE(V8File::hasInstance(v8File, scope.isolate()));
    File* file = V8File::toImpl(v8::Local<v8::Object>::Cast(v8File));
    EXPECT_FALSE(file->hasBackingFile());
    EXPECT_EQ(File::IsNotUserVisible, file->getUserVisibility());
    EXPECT_EQ("hello.txt", file->name());
}
开发者ID:mirror,项目名称:chromium,代码行数:22,代码来源:SerializedScriptValueTest.cpp


示例5: TEST

TEST(AnimationEffectInputTest, LooslySorted) {
  V8TestingScope scope;
  Vector<Dictionary> jsKeyframes;
  v8::Local<v8::Object> keyframe1 = v8::Object::New(scope.isolate());
  v8::Local<v8::Object> keyframe2 = v8::Object::New(scope.isolate());
  v8::Local<v8::Object> keyframe3 = v8::Object::New(scope.isolate());

  setV8ObjectPropertyAsString(scope.isolate(), keyframe1, "width", "100px");
  setV8ObjectPropertyAsString(scope.isolate(), keyframe1, "offset", "0");
  setV8ObjectPropertyAsString(scope.isolate(), keyframe2, "width", "200px");
  setV8ObjectPropertyAsString(scope.isolate(), keyframe3, "width", "0px");
  setV8ObjectPropertyAsString(scope.isolate(), keyframe3, "offset", "1");

  jsKeyframes.push_back(
      Dictionary(scope.isolate(), keyframe1, scope.getExceptionState()));
  jsKeyframes.push_back(
      Dictionary(scope.isolate(), keyframe2, scope.getExceptionState()));
  jsKeyframes.push_back(
      Dictionary(scope.isolate(), keyframe3, scope.getExceptionState()));

  Element* element = appendElement(scope.document());
  EffectModel* animationEffect = EffectInput::convert(
      element,
      DictionarySequenceOrDictionary::fromDictionarySequence(jsKeyframes),
      nullptr, scope.getExceptionState());
  EXPECT_FALSE(scope.getExceptionState().hadException());
  const KeyframeEffectModelBase& keyframeEffect =
      *toKeyframeEffectModelBase(animationEffect);
  EXPECT_EQ(1, keyframeEffect.getFrames()[2]->offset());
}
开发者ID:,项目名称:,代码行数:30,代码来源:



注:本文中的V8TestingScope类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VArchive类代码示例发布时间:2022-05-31
下一篇:
C++ V8StringResource类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap