зеркало из https://github.com/mozilla/gecko-dev.git
Added test cases for interface nsIClipboardCommand
This commit is contained in:
Родитель
5f923accc2
Коммит
fd0109f2c0
|
@ -85,6 +85,12 @@ void CDomWindow::OnStartTests(UINT nMenuID)
|
|||
case ID_INTERFACES_NSIDOMWINDOW_GETNAME :
|
||||
//GetName();
|
||||
break;
|
||||
case ID_INTERFACES_NSIDOMWINDOW_GETTEXTZOOM :
|
||||
GetTextZoom();
|
||||
break;
|
||||
case ID_INTERFACES_NSIDOMWINDOW_SETTEXTZOOM :
|
||||
SetTextZoom();
|
||||
break;
|
||||
case ID_INTERFACES_NSIDOMWINDOW_GETSCSOLLX :
|
||||
GetScrollX();
|
||||
break;
|
||||
|
@ -119,6 +125,7 @@ void CDomWindow::RunAllTests()
|
|||
PRInt32 scrollX = 0 ;
|
||||
PRInt32 scrollY = 0;
|
||||
PRInt32 bVisible =0;
|
||||
float fTextZoom = 0.0;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> oDomWindow;
|
||||
//nsCOMPtr<nsIDOMWindow> oDomWindowTop;
|
||||
|
@ -191,6 +198,13 @@ void CDomWindow::RunAllTests()
|
|||
//rv = oDomBarProp->GetVisible(&bVisible);
|
||||
|
||||
|
||||
rv = oDomWindow->GetTextZoom(&fTextZoom);
|
||||
RvTestResult(rv, "nsIDOMWindow::GetTextZoom()' rv test", 1);
|
||||
|
||||
fTextZoom = 12.0 ;
|
||||
rv = oDomWindow->SetTextZoom(fTextZoom);
|
||||
RvTestResult(rv, "nsIDOMWindow::SetTextZoom()' rv test", 1);
|
||||
|
||||
rv = oDomWindow->GetScrollX(&scrollX);
|
||||
RvTestResult(rv, "nsIDOMWindow::GetScrollX()' rv test", 1);
|
||||
|
||||
|
@ -349,6 +363,31 @@ void CDomWindow::GetSelection()
|
|||
}
|
||||
}
|
||||
|
||||
void CDomWindow::GetTextZoom()
|
||||
{
|
||||
float fTextZoom = 0.0 ;
|
||||
nsCOMPtr<nsIDOMWindow> oDomWindow;
|
||||
rv = qaWebBrowser->GetContentDOMWindow(getter_AddRefs(oDomWindow));
|
||||
RvTestResult(rv, "nsIWebBrowser::GetContentDOMWindow()' rv test", 0);
|
||||
|
||||
if (!oDomWindow)
|
||||
{
|
||||
AfxMessageBox("Cannot create Dom Window Object");
|
||||
return;
|
||||
}
|
||||
rv = oDomWindow->GetTextZoom(&fTextZoom);
|
||||
RvTestResult(rv, "nsIDOMWindow::GetTextZoom()' rv test", 0);
|
||||
}
|
||||
|
||||
void CDomWindow::SetTextZoom()
|
||||
{
|
||||
float fTextZoom = 0.0 ;
|
||||
|
||||
fTextZoom = 12.0;
|
||||
rv = GetDOMOWindowObject()->SetTextZoom(fTextZoom);
|
||||
RvTestResult(rv, "nsIDOMWindow::SetTextZoom()' rv test", 0);
|
||||
}
|
||||
|
||||
void CDomWindow::GetScrollX()
|
||||
{
|
||||
PRInt32 scrollX = 0 ;
|
||||
|
@ -457,3 +496,14 @@ void CDomWindow::SizeToContent()
|
|||
rv = oDomWindow->SizeToContent();
|
||||
RvTestResult(rv, "nsIDOMWindow::SizeToContent()' rv test", 0);
|
||||
}
|
||||
|
||||
|
||||
nsIDOMWindow* CDomWindow::GetDOMOWindowObject()
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> oDomWindow;
|
||||
rv = qaWebBrowser->GetContentDOMWindow(getter_AddRefs(oDomWindow));
|
||||
if (!oDomWindow)
|
||||
AfxMessageBox("Cannot create Dom Window Object");
|
||||
return oDomWindow;
|
||||
|
||||
}
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
void GetFrames();
|
||||
void GetDocument();
|
||||
void GetSelection();
|
||||
void GetTextZoom();
|
||||
void SetTextZoom();
|
||||
void GetScrollX();
|
||||
void GetScrollY();
|
||||
void ScrollTo();
|
||||
|
@ -65,7 +67,7 @@ public:
|
|||
void ScrollByLines();
|
||||
void ScrollByPages();
|
||||
void SizeToContent();
|
||||
|
||||
nsIDOMWindow* GetDOMOWindowObject();
|
||||
public:
|
||||
virtual ~CDomWindow();
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include "domwindow.h"
|
||||
#include "selection.h"
|
||||
#include "nsProfile.h"
|
||||
#include "nsIClipboardCmd.h"
|
||||
#include "QaUtils.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -87,15 +88,6 @@ BEGIN_MESSAGE_MAP(CTests, CWnd)
|
|||
ON_COMMAND(ID_TOOLS_TESTYOURMETHOD, OnToolsTestYourMethod)
|
||||
ON_COMMAND(ID_TOOLS_TESTYOURMETHOD2, OnToolsTestYourMethod2)
|
||||
ON_COMMAND(ID_VERIFYBUGS_70228, OnVerifybugs70228)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_PASTE, OnPasteTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_COPYSELECTION, OnCopyTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_SELECTALL, OnSelectAllTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_SELECTNONE, OnSelectNoneTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_CUTSELECTION, OnCutSelectionTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_COPYLINKLOCATION, copyLinkLocationTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_CANCOPYSELECTION, canCopySelectionTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_CANCUTSELECTION, canCutSelectionTest)
|
||||
ON_COMMAND(ID_CLIPBOARDCMD_CANPASTE, canPasteTest)
|
||||
ON_COMMAND(ID_INTERFACES_NSIREQUEST_CANCEL, OnInterfacesNsirequest)
|
||||
ON_COMMAND(ID_INTERFACES_NSIDOMWINDOW_RUNALLTESTS, OnInterfacesNsidomwindow)
|
||||
ON_COMMAND(ID_INTERFACES_NSIDIRECTORYSERVICE_INIT, OnInterfacesNsidirectoryservice)
|
||||
|
@ -183,6 +175,17 @@ BEGIN_MESSAGE_MAP(CTests, CWnd)
|
|||
ON_COMMAND(ID_INTERFACES_NSIREQUEST_SETLOADGROUP, OnInterfacesNsirequest)
|
||||
ON_COMMAND(ID_INTERFACES_NSIREQUEST_SUSPEND, OnInterfacesNsirequest)
|
||||
ON_COMMAND(ID_INTERFACES_NSIREQUEST_RUNALLTESTS, OnInterfacesNsirequest)
|
||||
ON_COMMAND(ID_INTERFACES_NSIDOMWINDOW_GETTEXTZOOM, OnInterfacesNsidomwindow)
|
||||
ON_COMMAND(ID_INTERFACES_NSIDOMWINDOW_SETTEXTZOOM, OnInterfacesNsidomwindow)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCOPYSELECTION, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCUTSELECTION, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANPASTE, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYLINKLOCATION, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYSELECTION, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_CUTSELECTION, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_PASTE, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTALL, OnInterfacesNsiclipboardcommands)
|
||||
ON_COMMAND(ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTNONE, OnInterfacesNsiclipboardcommands)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
@ -633,153 +636,6 @@ void CTests::FileMoveTest(nsILocalFile *theTestFile, nsILocalFile *theFileOpDir)
|
|||
QAOutput("File was moved. MoveTo() test Passed.", 2);
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
//DHARMA - nsIClipboardCommands
|
||||
// Checking the paste() method.
|
||||
void CTests::OnPasteTest()
|
||||
{
|
||||
QAOutput("testing paste command", 1);
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->Paste();
|
||||
RvTestResult(rv, "nsIClipboardCommands::Paste()' rv test", 1);
|
||||
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the copySelection() method.
|
||||
void CTests::OnCopyTest()
|
||||
{
|
||||
QAOutput("testing copyselection command");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CopySelection();
|
||||
RvTestResult(rv, "nsIClipboardCommands::CopySelection()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the selectAll() method.
|
||||
void CTests::OnSelectAllTest()
|
||||
{
|
||||
QAOutput("testing selectall method");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->SelectAll();
|
||||
RvTestResult(rv, "nsIClipboardCommands::SelectAll()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the selectNone() method.
|
||||
void CTests::OnSelectNoneTest()
|
||||
{
|
||||
QAOutput("testing selectnone method");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->SelectNone();
|
||||
RvTestResult(rv, "nsIClipboardCommands::SelectNone()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the cutSelection() method.
|
||||
void CTests::OnCutSelectionTest()
|
||||
{
|
||||
QAOutput("testing cutselection method");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CutSelection();
|
||||
RvTestResult(rv, "nsIClipboardCommands::CutSelection()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the copyLinkLocation() method.
|
||||
void CTests::copyLinkLocationTest()
|
||||
{
|
||||
QAOutput("testing CopyLinkLocation method", 2);
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CopyLinkLocation();
|
||||
RvTestResult(rv, "nsIClipboardCommands::CopyLinkLocation()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the canCopySelection() method.
|
||||
void CTests::canCopySelectionTest()
|
||||
{
|
||||
PRBool canCopySelection = PR_FALSE;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CanCopySelection(&canCopySelection);
|
||||
RvTestResult(rv, "nsIClipboardCommands::CanCopySelection()' rv test", 1);
|
||||
|
||||
if(canCopySelection)
|
||||
QAOutput("The selection you made Can be copied", 2);
|
||||
else
|
||||
QAOutput("Either you did not make a selection or The selection you made Cannot be copied", 2);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the canCutSelection() method.
|
||||
void CTests::canCutSelectionTest()
|
||||
{
|
||||
PRBool canCutSelection = PR_FALSE;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CanCutSelection(&canCutSelection);
|
||||
RvTestResult(rv, "nsIClipboardCommands::CanCutSelection()' rv test", 1);
|
||||
|
||||
if(canCutSelection)
|
||||
QAOutput("The selection you made Can be cut", 2);
|
||||
else
|
||||
QAOutput("Either you did not make a selection or The selection you made Cannot be cut", 2);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the canPaste() method.
|
||||
void CTests::canPasteTest()
|
||||
{
|
||||
PRBool canPaste = PR_FALSE;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CanPaste(&canPaste);
|
||||
RvTestResult(rv, "nsIClipboardCommands::CanPaste()' rv test", 1);
|
||||
|
||||
if(canPaste)
|
||||
QAOutput("The clipboard contents can be pasted here", 2);
|
||||
else
|
||||
QAOutput("The clipboard contents cannot be pasted here", 2);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
//DHARMA
|
||||
|
||||
|
||||
// ***********************************************************************
|
||||
// ***************** Bug Verifications ******************
|
||||
// ***********************************************************************
|
||||
|
@ -867,3 +723,9 @@ void CTests::OnInterfacesNsiwebnav()
|
|||
oWebNav.OnStartTests(nCommandID);
|
||||
}
|
||||
|
||||
|
||||
void CTests::OnInterfacesNsiclipboardcommands()
|
||||
{
|
||||
CNsIClipBoardCmd oClipCmd(qaWebBrowser) ;
|
||||
oClipCmd.OnStartTests(nCommandID);
|
||||
}
|
||||
|
|
|
@ -141,6 +141,7 @@ protected:
|
|||
afx_msg void OnInterfacesNsishistory();
|
||||
afx_msg void OnTestsRemovehistorylistener();
|
||||
afx_msg void OnInterfacesNsiwebnav();
|
||||
afx_msg void OnInterfacesNsiclipboardcommands();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ LINCS = -Icomponents \
|
|||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\TestEmbed.obj \
|
||||
# .\$(OBJDIR)\nsIObserServ.obj \
|
||||
.\$(OBJDIR)\BrowserFrm.obj \
|
||||
.\$(OBJDIR)\BrowserFrameGlue.obj \
|
||||
.\$(OBJDIR)\BrowserView.obj \
|
||||
|
@ -84,6 +83,7 @@ OBJS = \
|
|||
.\$(OBJDIR)\domwindow.obj \
|
||||
.\$(OBJDIR)\selection.obj \
|
||||
.\$(OBJDIR)\nsProfile.obj \
|
||||
.\$(OBJDIR)\nsIClipBoardCmd.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
|
|
|
@ -0,0 +1,243 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Dharma Sirnapalli <dsirnapalli@netscape.com>
|
||||
* Ashish Bhatt <ashishbhatt@netscape.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// File Overview....
|
||||
//
|
||||
// Test cases for the nsIClipBoardCommand Interface
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "QaUtils.h"
|
||||
#include <stdio.h>
|
||||
#include "nsIClipboardCmd.h"
|
||||
|
||||
CNsIClipBoardCmd::CNsIClipBoardCmd(nsIWebBrowser* mWebBrowser)
|
||||
{
|
||||
qaWebBrowser = mWebBrowser;
|
||||
}
|
||||
|
||||
|
||||
CNsIClipBoardCmd::~CNsIClipBoardCmd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CNsIClipBoardCmd::OnStartTests(UINT nMenuID)
|
||||
{
|
||||
// Calls all or indivdual test cases on the basis of the
|
||||
// option selected from menu.
|
||||
|
||||
switch(nMenuID)
|
||||
{
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_PASTE :
|
||||
OnPasteTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYSELECTION :
|
||||
OnCopyTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTALL :
|
||||
OnSelectAllTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTNONE :
|
||||
OnSelectNoneTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_CUTSELECTION :
|
||||
OnCutSelectionTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYLINKLOCATION :
|
||||
copyLinkLocationTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCOPYSELECTION :
|
||||
canCopySelectionTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCUTSELECTION :
|
||||
canCutSelectionTest();
|
||||
break ;
|
||||
case ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANPASTE :
|
||||
canPasteTest();
|
||||
break ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
//DHARMA - nsIClipboardCommands
|
||||
// Checking the paste() method.
|
||||
void CNsIClipBoardCmd::OnPasteTest()
|
||||
{
|
||||
QAOutput("testing paste command", 1);
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->Paste();
|
||||
RvTestResult(rv, "nsIClipboardCommands::Paste()' rv test", 1);
|
||||
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the copySelection() method.
|
||||
void CNsIClipBoardCmd::OnCopyTest()
|
||||
{
|
||||
QAOutput("testing copyselection command");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CopySelection();
|
||||
RvTestResult(rv, "nsIClipboardCommands::CopySelection()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the selectAll() method.
|
||||
void CNsIClipBoardCmd::OnSelectAllTest()
|
||||
{
|
||||
QAOutput("testing selectall method");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->SelectAll();
|
||||
RvTestResult(rv, "nsIClipboardCommands::SelectAll()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the selectNone() method.
|
||||
void CNsIClipBoardCmd::OnSelectNoneTest()
|
||||
{
|
||||
QAOutput("testing selectnone method");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->SelectNone();
|
||||
RvTestResult(rv, "nsIClipboardCommands::SelectNone()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the cutSelection() method.
|
||||
void CNsIClipBoardCmd::OnCutSelectionTest()
|
||||
{
|
||||
QAOutput("testing cutselection method");
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CutSelection();
|
||||
RvTestResult(rv, "nsIClipboardCommands::CutSelection()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the copyLinkLocation() method.
|
||||
void CNsIClipBoardCmd::copyLinkLocationTest()
|
||||
{
|
||||
QAOutput("testing CopyLinkLocation method", 2);
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CopyLinkLocation();
|
||||
RvTestResult(rv, "nsIClipboardCommands::CopyLinkLocation()' rv test", 1);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the canCopySelection() method.
|
||||
void CNsIClipBoardCmd::canCopySelectionTest()
|
||||
{
|
||||
PRBool canCopySelection = PR_FALSE;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CanCopySelection(&canCopySelection);
|
||||
RvTestResult(rv, "nsIClipboardCommands::CanCopySelection()' rv test", 1);
|
||||
|
||||
if(canCopySelection)
|
||||
QAOutput("The selection you made Can be copied", 2);
|
||||
else
|
||||
QAOutput("Either you did not make a selection or The selection you made Cannot be copied", 2);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the canCutSelection() method.
|
||||
void CNsIClipBoardCmd::canCutSelectionTest()
|
||||
{
|
||||
PRBool canCutSelection = PR_FALSE;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CanCutSelection(&canCutSelection);
|
||||
RvTestResult(rv, "nsIClipboardCommands::CanCutSelection()' rv test", 1);
|
||||
|
||||
if(canCutSelection)
|
||||
QAOutput("The selection you made Can be cut", 2);
|
||||
else
|
||||
QAOutput("Either you did not make a selection or The selection you made Cannot be cut", 2);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
// Checking the canPaste() method.
|
||||
void CNsIClipBoardCmd::canPasteTest()
|
||||
{
|
||||
PRBool canPaste = PR_FALSE;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(qaWebBrowser);
|
||||
if (clipCmds)
|
||||
{
|
||||
rv = clipCmds->CanPaste(&canPaste);
|
||||
RvTestResult(rv, "nsIClipboardCommands::CanPaste()' rv test", 1);
|
||||
|
||||
if(canPaste)
|
||||
QAOutput("The clipboard contents can be pasted here", 2);
|
||||
else
|
||||
QAOutput("The clipboard contents cannot be pasted here", 2);
|
||||
}
|
||||
else
|
||||
QAOutput("We didn't get the clipboard object.", 1);
|
||||
}
|
||||
|
||||
//DHARMA
|
|
@ -0,0 +1,70 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ashish Bhatt <ashishbhatt@netscape.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// File Overview....
|
||||
//
|
||||
// Header file for nsIClipBoardCommand interface test cases
|
||||
|
||||
class CNsIClipBoardCmd
|
||||
{
|
||||
public:
|
||||
|
||||
CNsIClipBoardCmd(nsIWebBrowser* mWebBrowser);
|
||||
|
||||
public:
|
||||
~CNsIClipBoardCmd();
|
||||
|
||||
public:
|
||||
nsCOMPtr<nsIWebBrowser> qaWebBrowser ;
|
||||
|
||||
void OnStartTests(UINT nMenuID);
|
||||
void OnPasteTest();
|
||||
void OnCopyTest();
|
||||
void OnSelectAllTest();
|
||||
void OnSelectNoneTest();
|
||||
void OnCutSelectionTest();
|
||||
void copyLinkLocationTest();
|
||||
void canCopySelectionTest();
|
||||
void canCutSelectionTest();
|
||||
void canPasteTest();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
};
|
|
@ -174,6 +174,17 @@
|
|||
#define ID_INTERFACES_NSIWEBNAV_SETSESSIONHISTORY 32906
|
||||
#define ID_INTERFACES_NSIWEBNAV_RUNALLTESTS 32907
|
||||
#define ID_INTERFACES_NSIREQUEST_RUNALLTESTS 32908
|
||||
#define ID_INTERFACES_NSIDOMWINDOW_GETTEXTZOOM 32910
|
||||
#define ID_INTERFACES_NSIDOMWINDOW_SETTEXTZOOM 32911
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_PASTE 32912
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYSELECTION 32913
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTALL 32914
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTNONE 32915
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_CUTSELECTION 32916
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYLINKLOCATION 32917
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCOPYSELECTION 32918
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCUTSELECTION 32919
|
||||
#define ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANPASTE 32920
|
||||
#define ID_CLIPBOARDCMD_PASTE 42789
|
||||
#define ID_CLIPBOARDCMD_COPYSELECTION 42790
|
||||
#define ID_CLIPBOARDCMD_SELECTALL 42791
|
||||
|
@ -190,7 +201,7 @@
|
|||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 146
|
||||
#define _APS_NEXT_COMMAND_VALUE 32909
|
||||
#define _APS_NEXT_COMMAND_VALUE 32921
|
||||
#define _APS_NEXT_CONTROL_VALUE 1025
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
Двоичные данные
embedding/qa/testembed/testembed.aps
Двоичные данные
embedding/qa/testembed/testembed.aps
Двоичный файл не отображается.
|
@ -130,6 +130,10 @@ SOURCE=.\MostRecentUrls.cpp
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\nsIClipboardCmd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\nsiDirServ.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -230,6 +234,10 @@ SOURCE=.\MostRecentUrls.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\nsIClipboardCmd.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\nsiDirServ.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -281,6 +281,11 @@ BEGIN
|
|||
|
||||
MENUITEM "GetName", ID_INTERFACES_NSIDOMWINDOW_GETNAME
|
||||
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "GetTextZoom", ID_INTERFACES_NSIDOMWINDOW_GETTEXTZOOM
|
||||
|
||||
MENUITEM "SetTextZoom", ID_INTERFACES_NSIDOMWINDOW_SETTEXTZOOM
|
||||
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "GetScsollX", ID_INTERFACES_NSIDOMWINDOW_GETSCSOLLX
|
||||
|
||||
|
@ -374,6 +379,29 @@ BEGIN
|
|||
|
||||
MENUITEM "ShutDownCurrentProfile", ID_INTERFACES_NSIPROFILE_SHUTDOWNCURRENTPROFILE
|
||||
|
||||
END
|
||||
POPUP "nsIClipboardCommands"
|
||||
BEGIN
|
||||
MENUITEM "CanCopySelection", ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCOPYSELECTION
|
||||
|
||||
MENUITEM "CanCutSelection", ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANCUTSELECTION
|
||||
|
||||
MENUITEM "CanPaste", ID_INTERFACES_NSICLIPBOARDCOMMANDS_CANPASTE
|
||||
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "CopySelection", ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYSELECTION
|
||||
|
||||
MENUITEM "CutSelection", ID_INTERFACES_NSICLIPBOARDCOMMANDS_CUTSELECTION
|
||||
|
||||
MENUITEM "Paste", ID_INTERFACES_NSICLIPBOARDCOMMANDS_PASTE
|
||||
|
||||
MENUITEM "CopyLinkLocation", ID_INTERFACES_NSICLIPBOARDCOMMANDS_COPYLINKLOCATION
|
||||
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "SelectAll", ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTALL
|
||||
|
||||
MENUITEM "SelectNone", ID_INTERFACES_NSICLIPBOARDCOMMANDS_SELECTNONE
|
||||
|
||||
END
|
||||
POPUP "CallBacks"
|
||||
BEGIN
|
||||
|
@ -397,22 +425,6 @@ BEGIN
|
|||
MENUITEM "&70228", ID_VERIFYBUGS_70228
|
||||
MENUITEM "90195", ID_VERIFYBUGS_90195
|
||||
END
|
||||
POPUP "Clip&BoardTest"
|
||||
BEGIN
|
||||
MENUITEM "&Copy Selection", ID_CLIPBOARDCMD_COPYSELECTION
|
||||
|
||||
MENUITEM "&Paste", ID_CLIPBOARDCMD_PASTE
|
||||
MENUITEM "Select &All", ID_CLIPBOARDCMD_SELECTALL
|
||||
MENUITEM "Select &None", ID_CLIPBOARDCMD_SELECTNONE
|
||||
MENUITEM "Cu&t Selection", ID_CLIPBOARDCMD_CUTSELECTION
|
||||
MENUITEM "Copy &Link Location", ID_CLIPBOARDCMD_COPYLINKLOCATION
|
||||
|
||||
MENUITEM "Can Copy &Selection", ID_CLIPBOARDCMD_CANCOPYSELECTION
|
||||
|
||||
MENUITEM "Can C&ut Selection", ID_CLIPBOARDCMD_CANCUTSELECTION
|
||||
|
||||
MENUITEM "Can Pas&Te", ID_CLIPBOARDCMD_CANPASTE
|
||||
END
|
||||
END
|
||||
|
||||
IDR_CTXMENU_DOCUMENT MENU DISCARDABLE
|
||||
|
|
Загрузка…
Ссылка в новой задаче