xref: /trunk/main/slideshow/test/views.cxx (revision df3f5cbc)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #include <cppuhelper/compbase1.hxx>
23 #include <comphelper/broadcasthelper.hxx>
24 
25 #include <basegfx/matrix/b2dhommatrix.hxx>
26 #include <basegfx/range/b2drectangle.hxx>
27 #include <cppcanvas/spritecanvas.hxx>
28 
29 #include "view.hxx"
30 #include "unoview.hxx"
31 #include "unoviewcontainer.hxx"
32 #include "shape.hxx"
33 #include "tests.hxx"
34 #include "gtest/gtest.h"
35 #include "com/sun/star/presentation/XSlideShowView.hpp"
36 
37 namespace target = slideshow::internal;
38 using namespace ::com::sun::star;
39 
40 namespace
41 {
42 
43 class UnoViewContainerTest : public ::testing::Test
44 {
45 public:
46 }; // class UnoViewContainerTest
47 
TEST_F(UnoViewContainerTest,testContainer)48 TEST_F(UnoViewContainerTest, testContainer)
49 {
50     target::UnoViewContainer aContainer;
51 
52     TestViewSharedPtr pView = createTestView();
53     aContainer.addView( pView );
54 
55     ASSERT_TRUE( 1 == std::distance( aContainer.begin(), aContainer.end() )) << "Testing container size";
56     ASSERT_TRUE( pView->paintScreen() ) << "Testing disposedness";
57     aContainer.dispose();
58     ASSERT_TRUE( 0 == std::distance( aContainer.begin(), aContainer.end() )) << "Testing dispose: container must be empty";
59     ASSERT_TRUE( !pView->paintScreen() ) << "Testing dispose: all elements must receive dispose";
60 }
61 
62 
63 } // namespace
64