status = nsComponentManager::CreateInstance(kScrollingViewCID, nsnull, NS_GET_IID(nsIView), (void **)&rootView);
status = CallCreateInstance(kScrollingViewCID, &rootView);
GeometryTest::GeometryTest(BasicTest *aDoc){  PRInt32 rows = 4;  PRInt32 cols = 3;#if 0  NS_InitToolkit(PR_GetCurrentThread());  //NS_NewDeviceContext(&scribbleData.mContext);  NS_NewWindow(NULL, NS_GET_IID(nsIWidget), nsnull);#endif  nsIDeviceContext *dx;    static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);  nsresult rv = nsComponentManager::CreateInstance(kDeviceContextCID, nsnull, NS_GET_IID(nsIDeviceContext), (void **)&dx);  if (NS_OK == rv) {    dx->Init(nsnull);    dx->SetDevUnitsToAppUnits(dx->DevUnitsToTwips());    dx->SetAppUnitsToDevUnits(dx->TwipsToDevUnits());  }  nsPresContext * pc = nsnull;  nsresult status = NS_NewGalleyContext(&pc);  if ((NS_FAILED(status)) ||  nsnull==pc)  {    fprintf(out, "bad galley pc");    NS_ASSERTION(PR_FALSE, "bad galley pc");  }  pc->Init(dx, nsnull);  // create a view manager  nsIViewManager * vm = nsnull;  static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID);  status = nsComponentManager::CreateInstance(kViewManagerCID,                                         nsnull,                                         NS_GET_IID(nsIViewManager),                                         (void **)&vm);  if ((NS_FAILED(status)) ||  nsnull==vm)  {    fprintf(out, "bad view manager");    NS_ASSERTION(PR_FALSE, "bad view manager");  }  vm->Init(pc);  nsIView * rootView = nsnull;  // Create a view  static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLL_PORT_VIEW_CID);  status = nsComponentManager::CreateInstance(kScrollingViewCID,                                         nsnull,                                         NS_GET_IID(nsIView),                                         (void **)&rootView);  if ((NS_FAILED(status)) ||  nsnull==rootView)  {    fprintf(out, "bad view");    NS_ASSERTION(PR_FALSE, "bad view");  }  nsRect bounds(0, 0, 10000, 10000);  rootView->Init(vm, bounds, nsnull);  vm->SetRootView(rootView);  nsCOMPtr<nsIStyleSet> ss(do_CreateInstance(kStyleSetCID,&status));  if ((NS_FAILED(status)))  {    fprintf(out, "bad style set");    NS_ASSERTION(PR_FALSE, "bad style set");  }  mShell = nsnull;  status = NS_NewPresShell(&mShell);  if ((NS_FAILED(status)) ||  nsnull==mShell)  {    fprintf(out, "bad presentation shell.");    NS_ASSERTION(PR_FALSE, "");  }  mShell->Init(aDoc, pc, vm, ss);  aDoc->CreateCorrectContent(rows, cols);  CreateGeometry(aDoc, pc);  VerifyGeometry(aDoc, pc);  aDoc->CreateCorrectFullContent(rows, cols);  CreateGeometry(aDoc, pc);  VerifyGeometry(aDoc, pc);  /* paginated tests not ready yet...  NS_RELEASE(pc);  pc = nsnull;  status = NS_NewPrintPreviewContext(&pc);  if ((NS_FAILED(status)) ||  nsnull==pc)  {    fprintf(out, "bad paginated pc");    NS_ASSERTION(PR_FALSE, "");  }  pc->Init(dx, nsnull);  aDoc->CreateCorrectContent(rows, cols);  CreateGeometry(aDoc, pc);  VerifyGeometry(aDoc, pc);  aDoc->CreateCorrectFullContent(rows, cols);  CreateGeometry(aDoc, pc);  VerifyGeometry(aDoc, pc);  */}