Examples of JSVariable


Examples of org.chromium.sdk.JsVariable

  private void ensureReceiver() throws MethodIsBlockingException {
    if (receiverVariableRef.get() != null) {
      return;
    }
    JsVariable result;

    PropertyReference ref = V8Helper.computeReceiverRef(frameObject);
    if (ref == null) {
      result = null;
    } else {
View Full Code Here

Examples of org.chromium.sdk.JsVariable

            } catch (JsonProtocolParseException e) {
              throw new RuntimeException(e);
            }
            InternalContext internalContext = getInternalContext();
            ValueMirror mirror = internalContext.getValueLoader().addDataToMap(body);
            JsVariable variable = new JsVariableImpl(internalContext.getValueLoader(),
                mirror, expression);
            callback.success(variable);
          }
          @Override
          public void failure(String message) {
View Full Code Here

Examples of org.chromium.sdk.JsVariable

  static JsVariable wrapExceptionValue(RemoteObjectValue valueData,
      WipValueBuilder valueBuilder) {
    JsValue exceptionValue = valueBuilder.wrap(valueData, null);

    final JsVariable property =
        WipValueBuilder.createVariable(exceptionValue, EVALUATE_EXCEPTION_INNER_NAME);

    JsObject wrapperValue = new JsObject() {
      @Override
      public RelayOk reloadHeavyValue(ReloadBiggerCallback callback,
          SyncCallback syncCallback) {
        throw new UnsupportedOperationException();
      }

      @Override
      public boolean isTruncated() {
        return false;
      }

      @Override
      public String getValueString() {
        return "<abnormal return>";
      }

      @Override
      public Type getType() {
        return Type.TYPE_OBJECT;
      }

      @Override
      public JsObject asObject() {
        return this;
      }

      @Override
      public String getRefId() {
        return null;
      }

      @Override
      public RemoteValueMapping getRemoteValueMapping() {
        return null;
      }

      @Override
      public JsVariable getProperty(String name) {
        if (name.equals(property.getName())) {
          return property;
        }
        return null;
      }
View Full Code Here

Examples of org.chromium.sdk.JsVariable

            for (PropertyDescriptorValue property : propertyList) {
              final String name = property.name();

              ValueNameBuilder valueNameBuilder =
                  WipExpressionBuilder.createRootName(name, false);
              JsVariable variable =
                  valueBuilder.createVariable(property.value(), valueNameBuilder);
              properties.add(variable);
            }
            final ScopeVariables scopeVariables = new ScopeVariables(properties, currentCacheState);
            return new Getter<ScopeVariables>() {
View Full Code Here

Examples of org.chromium.sdk.JsVariable

    if (realVariable == null) {
      return null;
    }

    final JsVariable jsVariable = realVariable.getJsVariable();

    final Variable.Real.HostObject hostObject = realVariable.getHostObject();

    if (hostObject == null) {
      return null;
    }

    return new Runnable() {
      @Override
      public void run() {
        String subExpression = hostObject.getExpression();

        String expression = "Object.getOwnPropertyDescriptor(" + subExpression + ", \"" +
            jsVariable.getName() + "\")";

        IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
        IWatchExpression watchExpression = expressionManager.newWatchExpression(expression);
        expressionManager.addExpression(watchExpression);
      }
View Full Code Here

Examples of org.chromium.sdk.JsVariable

      commandCallback = null;
    } else {
      commandCallback = new GenericCallback<DATA>() {
        @Override
        public void success(DATA data) {
          JsVariable variable = processResponse(data, destinationValueLoader, valueNameBuidler);
          callback.success(variable);
        }
        @Override
        public void failure(Exception exception) {
          callback.failure(exception.getMessage());
View Full Code Here

Examples of org.chromium.sdk.JsVariable

      }

      {
        // Check literals.
        for (LiteralTestCase literal : TEST_LITERALS) {
          JsVariable resultVar = evaluateSync(context.getGlobalEvaluateContext(),
              literal.javaScriptExpression);
          JsValue resultValue = resultVar.getValue();
          if (resultValue.getType() != literal.expectedType) {
            throw new SmokeException("Unexpected type of '" + literal.javaScriptExpression +
                "': " + resultValue.getType());
          }
          if (!literal.expectedDescription.equals(resultValue.getValueString())) {
            throw new SmokeException("Unexpected string value of '" +
                literal.javaScriptExpression + "': " + resultValue.getValueString());
          }
        }
      }

      // Do not block dispatcher thread.
      stateManager.setDefaultReceiver(IGNORE_SCRIPTS_VISITOR);

      List<? extends CallFrame> callFrames = context.getCallFrames();
      CallFrame topFrame = callFrames.get(0);

      JsScope localScope;
      findScope: {
        for (JsScope scope : topFrame.getVariableScopes()) {
          if (scope.getType() == JsScope.Type.LOCAL) {
            localScope = scope;
            break findScope;
          }
        }
        throw new SmokeException("Failed to find local scope");
      }

      JsVariable xVar = getVariable(localScope, "x");
      if (!"1".equals(xVar.getValue().getValueString())) {
        throw new SmokeException("Unexpected value of local variable");
      }
      JsVariable yVar = getVariable(localScope, "y");
      if (!"2".equals(yVar.getValue().getValueString())) {
        throw new SmokeException("Unexpected value of local variable");
      }

      for (CallFrame frame : callFrames) {
        checkExpression(frame);
View Full Code Here

Examples of org.chromium.sdk.JsVariable

      public void success(JsVariable variable) {
        variableHolder.setValue(variable);
      }
    };
    frame.getEvaluateContext().evaluateSync(FIBONACCI_EXPRESSION, null, callback);
    JsVariable variable = variableHolder.get();
    String resString = variable.getValue().getValueString();
    if (!"24".equals(resString)) {
      throw new SmokeException("Wrong expression value");
    }
  }
View Full Code Here

Examples of org.chromium.sdk.JsVariable

          return paramsWithResponse;
        }

        @Override
        public Step<JsVariable> processResponse(EVAL_DATA response) {
          JsVariable jsVariable =
              commandHandler.processResult(response, destinationValueLoader, valueNameBuidler);

          clearTempObjectAsync();

          return WipRelayRunner.createFinalStep(jsVariable);
View Full Code Here

Examples of org.chromium.sdk.JsVariable

            final String name = property.name();

            ValueNameBuilder valueNameBuilder =
                WipExpressionBuilder.createRootName(name, false);

            JsVariable variable;
            if (objectId == null) {
              variable = valueBuilder.createVariable(property.value(), valueNameBuilder);
            } else {
              variable = valueBuilder.createObjectProperty(property, objectId, valueNameBuilder);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.