Check-in [233bfb6414]
Overview
SHA1:233bfb641461bf869ba60ed7febfb5b617292b5c
Date: 2017-03-09 01:17:42
User: rkeene
Comment:Added test code, untested
Timelines: family | ancestors | chrome-testing
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-03-09
01:17
[233bfb6414] Leaf: Added test code, untested (user: rkeene, tags: chrome-testing)
01:16
[9e3e9917fe] Updated to include original request when an error occurs (user: rkeene, tags: trunk)
Changes

Modified build/chrome/cackey-chrome-plugin.cc from [77c6f00e8d] to [2d769e72a7].

   271    271   };
   272    272   
   273    273   namespace pp {
   274    274   	Module *CreateModule() {
   275    275   		return(new CACKeyModule());
   276    276   	}
   277    277   }
          278  +
          279  +#include "ppapi/c/ppb_core.h"
          280  +static PP_Bool isMainThread(void) {
          281  +	return((PP_Bool) true);
          282  +}
          283  +
          284  +extern "C" const void *ifaces(const char *name) {
          285  +	fprintf(stderr, "Asked to give an interface for \"%s\"\n", name);
          286  +
          287  +	if (strcmp(name, "PPB_Core;1.0") == 0) {
          288  +		static struct PPB_Core_1_0 x = {0};
          289  +
          290  +		x.IsMainThread = isMainThread;
          291  +
          292  +		fprintf(stderr, "Returning x\n");
          293  +
          294  +		return(&x);
          295  +	}
          296  +
          297  +	return(NULL);
          298  +}
          299  +
          300  +extern "C" int main(int argc, char **argv) {
          301  +	pp::Module *mod;
          302  +	pp::Instance *inst;
          303  +	PP_Instance instance = 0;
          304  +
          305  +	mod = new CACKeyModule();
          306  +
          307  +	mod->InternalInit(mod->pp_module(), ifaces);
          308  +
          309  +	inst = new CACKeyInstance(instance, mod->core());
          310  +
          311  +	{
          312  +		pp::Var *message;
          313  +		pp::VarDictionary messageDict;
          314  +
          315  +		messageDict.Set("target", "cackey");
          316  +		messageDict.Set("command", "init");
          317  +
          318  +		message = new pp::Var(messageDict.pp_var());
          319  +
          320  +		inst->HandleMessage(*message);
          321  +	}
          322  +
          323  +        printf("Hello, World !, inst = %p\n", inst);
          324  +
          325  +        return(0);
          326  +}