Package org.chromium.sdk

Examples of org.chromium.sdk.JsVariable$SetValueCallback


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

    final JsVariable jsVariable = realVariable.getJsVariable();

    final String qualifiedName = realVariable.createHolderWatchExpression();
    if (qualifiedName == null) {
      return null;
    }

    return new Runnable() {
      @Override
      public void run() {
        String expression = "Object.getOwnPropertyDescriptor(" + qualifiedName + ", \"" +
            jsVariable.getName() + "\")";

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


    assertEquals("3", firstVal.getValueString()); //$NON-NLS-1$
    assertEquals("3", secondVal.getValueString()); //$NON-NLS-1$
    assertNull(firstVal.asObject());
    assertNull(secondVal.asObject());

    JsVariable xProperty = jsObject.getProperty("x");
    assertEquals("x", xProperty.getName()); //$NON-NLS-1$
    JsVariable yProperty = jsObject.getProperty("y");
    assertEquals("y", yProperty.getName()); //$NON-NLS-1$
  }
View Full Code Here

    Collection<JsVariableBase.Property> properties = jsArray.getProperties();
    assertEquals(2 + 1, properties.size()); // 2 array element properties and one length property.
    assertEquals(4, jsArray.getLength());
    SortedMap<Long, ? extends JsVariable> sparseArray = jsArray.toSparseArray();
    assertEquals(2, sparseArray.size());
    JsVariable firstElement = sparseArray.get(1L);
    JsVariable thirdElement = sparseArray.get(3L);
    assertNull(jsArray.get(-1L));
    assertNull(jsArray.get(0L));
    assertEquals(firstElement, jsArray.get(1L));
    assertEquals("1", firstElement.getName());
    assertNull(jsArray.get(2L));
    assertEquals(thirdElement, jsArray.get(3L));
    assertEquals("3", thirdElement.getName());
    assertNull(jsArray.get(10L));
    checkElementData(firstElement);
    checkElementData(thirdElement);
  }
View Full Code Here

  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

          }
        }
        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

      if (internalPropertyList != null) {
        for (InternalPropertyDescriptorValue propertyDescriptor : internalPropertyList) {
          String name = propertyDescriptor.name();

          JsVariable variable =
              valueBuilder.createVariable(propertyDescriptor.value(), name);
          internalProperties.add(variable);
        }
      }
View Full Code Here

    int maxLengthWithoutLastBracket = maxLength - 1;
    StringBuilder elementBuilder = new StringBuilder();
    int entriesWritten = 0;
    for (Map.Entry<Long, ? extends JsVariable> entry : indexToElement.entrySet()) {
      Long index = entry.getKey();
      JsVariable var = entry.getValue();
      if (!isFirst) {
        output.append(',');
      } else {
        isFirst = false;
      }
      elementBuilder.setLength(0);
      elementBuilder.append(index).append('=');
      renderInternal(var.getValue(), maxLengthWithoutLastBracket /* essentially, no limit */,
          false, elementBuilder);
      if (output.length() + elementBuilder.length() >= maxLengthWithoutLastBracket) {
        // reached max length
        appendNMore(output, indexToElement.size() - entriesWritten);
        break;
View Full Code Here

          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

    int maxLengthWithoutLastBracket = maxLength - 1;
    StringBuilder elementBuilder = new StringBuilder();
    int entriesWritten = 0;
    for (Map.Entry<Integer, ? extends JsVariable> entry : indexToElement.entrySet()) {
      Integer index = entry.getKey();
      JsVariable var = entry.getValue();
      if (!isFirst) {
        output.append(',');
      } else {
        isFirst = false;
      }
      elementBuilder.setLength(0);
      elementBuilder.append(index).append('=');
      renderInternal(var.getValue(), maxLengthWithoutLastBracket /* essentially, no limit */,
          false, elementBuilder);
      if (output.length() + elementBuilder.length() >= maxLengthWithoutLastBracket) {
        // reached max length
        appendNMore(output, indexToElement.size() - entriesWritten);
        break;
View Full Code Here

  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

TOP

Related Classes of org.chromium.sdk.JsVariable$SetValueCallback

Copyright © 2018 www.massapicom. 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.