From fd0109f2c0379fbec9d0c74d543b81d9c2f967f1 Mon Sep 17 00:00:00 2001 From: "ashishbhatt%netscape.com" Date: Tue, 29 Jan 2002 00:13:04 +0000 Subject: [PATCH] Added test cases for interface nsIClipboardCommand --- embedding/qa/testembed/DomWindow.cpp | 50 +++++ embedding/qa/testembed/DomWindow.h | 4 +- embedding/qa/testembed/Tests.cpp | 174 ++------------- embedding/qa/testembed/Tests.h | 1 + embedding/qa/testembed/makefile.win | 2 +- embedding/qa/testembed/nsIclipboardcmd.cpp | 243 +++++++++++++++++++++ embedding/qa/testembed/nsIclipboardcmd.h | 70 ++++++ embedding/qa/testembed/resource.h | 13 +- embedding/qa/testembed/testembed.aps | Bin 725 -> 725 bytes embedding/qa/testembed/testembed.dsp | 8 + embedding/qa/testembed/testembed.rc | 44 ++-- 11 files changed, 434 insertions(+), 175 deletions(-) create mode 100644 embedding/qa/testembed/nsIclipboardcmd.cpp create mode 100644 embedding/qa/testembed/nsIclipboardcmd.h diff --git a/embedding/qa/testembed/DomWindow.cpp b/embedding/qa/testembed/DomWindow.cpp index 3b19befe2393..cc2867989b45 100644 --- a/embedding/qa/testembed/DomWindow.cpp +++ b/embedding/qa/testembed/DomWindow.cpp @@ -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 oDomWindow; //nsCOMPtr 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 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 oDomWindow; + rv = qaWebBrowser->GetContentDOMWindow(getter_AddRefs(oDomWindow)); + if (!oDomWindow) + AfxMessageBox("Cannot create Dom Window Object"); + return oDomWindow; + +} diff --git a/embedding/qa/testembed/DomWindow.h b/embedding/qa/testembed/DomWindow.h index 51a72a57e6b9..9ee1fea3bc96 100644 --- a/embedding/qa/testembed/DomWindow.h +++ b/embedding/qa/testembed/DomWindow.h @@ -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(); diff --git a/embedding/qa/testembed/Tests.cpp b/embedding/qa/testembed/Tests.cpp index adf82f3902f4..910a558f44d5 100644 --- a/embedding/qa/testembed/Tests.cpp +++ b/embedding/qa/testembed/Tests.cpp @@ -59,6 +59,7 @@ #include "domwindow.h" #include "selection.h" #include "nsProfile.h" +#include "nsIClipboardCmd.h" #include "QaUtils.h" #include @@ -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 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 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 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 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 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 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 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 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 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); +} diff --git a/embedding/qa/testembed/Tests.h b/embedding/qa/testembed/Tests.h index e0aa68d340b9..dde39300a016 100644 --- a/embedding/qa/testembed/Tests.h +++ b/embedding/qa/testembed/Tests.h @@ -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() diff --git a/embedding/qa/testembed/makefile.win b/embedding/qa/testembed/makefile.win index 15a6937b9d3e..5e305eb573fc 100644 --- a/embedding/qa/testembed/makefile.win +++ b/embedding/qa/testembed/makefile.win @@ -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= \ diff --git a/embedding/qa/testembed/nsIclipboardcmd.cpp b/embedding/qa/testembed/nsIclipboardcmd.cpp new file mode 100644 index 000000000000..85d1c2de63c1 --- /dev/null +++ b/embedding/qa/testembed/nsIclipboardcmd.cpp @@ -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 + * Ashish Bhatt + * + * + * 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 +#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 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 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 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 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 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 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 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 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 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 diff --git a/embedding/qa/testembed/nsIclipboardcmd.h b/embedding/qa/testembed/nsIclipboardcmd.h new file mode 100644 index 000000000000..383dcd0925ce --- /dev/null +++ b/embedding/qa/testembed/nsIclipboardcmd.h @@ -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 + * + * + * 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 qaWebBrowser ; + + void OnStartTests(UINT nMenuID); + void OnPasteTest(); + void OnCopyTest(); + void OnSelectAllTest(); + void OnSelectNoneTest(); + void OnCutSelectionTest(); + void copyLinkLocationTest(); + void canCopySelectionTest(); + void canCutSelectionTest(); + void canPasteTest(); + +protected: + + +}; \ No newline at end of file diff --git a/embedding/qa/testembed/resource.h b/embedding/qa/testembed/resource.h index 285276c338ae..53f426257e42 100644 --- a/embedding/qa/testembed/resource.h +++ b/embedding/qa/testembed/resource.h @@ -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 diff --git a/embedding/qa/testembed/testembed.aps b/embedding/qa/testembed/testembed.aps index 58b087533f23e192cfcc305446cfc26886c4f21c..f20781242a39f683dd007f3d517265ae180da0ae 100644 GIT binary patch delta 19 acmcc0dX;s83zLW9L^mg